Author Topic: A proposal to update the margin call process  (Read 1811 times)

0 Members and 1 Guest are viewing this topic.

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1073
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
A proposal to update the margin call process
« on: February 04, 2018, 02:45:31 pm »
according to the current margin call rule, when the collateral rate of the debt position fall under 1.75, all the collateral are put into an order to sell at the price of settlement price * 0.9.

a big problem generalized by this rule is, when there is a huge debt position be margin called, a huge sell order will be there, this enhance the trend of the price go down, and speed up the coming of more margin call, this positive-feedback always lead to a disaster.

speculators realize that there a big chance to make money by shorting BTS and buy back BTS from the margin call order, they keep there eye on this and find chance to manually create margin call, the result is, users who generate smartcoin to cultivate the ecosystem are always in danger and be hurt now and then, and the price of BTS are in a big limit to go up.

actually it is not a must to sell all the collaterized BTS when the debt position is margin called, it's possible to split the debt position into 2 parts, give one part(let's call it reserve part) a higher collateral ratio(let's call it reserve collateral ratio) and put the other part(enhance part) into sell with a lower collateral ratio(let's call it enhance collateral ratio), this can reduce the quantity of sell orders and slow down the price to go down.

here we need to introduce 2 global parameters:

reserve collateral ratio (RCR) and enhance collateral ratio(ECR).

when a debt position are margin called, a process will be trigged to splict the position to 2 parts, the ratio for collateral that be put into reserve collateral part are:

r = RCR*(MCR-ECR)/MCR(RCR-ECR)

suppose MCR = 1.75, RCR = 1.8, ECR = 1.5, then r = 85.7%
suppose MCR = 1.75, RCR = 1.85, ECR = 1.5, then r = 75.5%

I believe this will help BTS a lot.

I wonder whether this is possible from development perspective and I hope this topic can be discussed more.




Offline sschiessl

Re: A proposal to update the margin call process
« Reply #1 on: February 04, 2018, 03:32:04 pm »
I agree that big margin calls have a significant impact on the market, there is room for improvement.
Are there any mechanics in the fiat world to learn from / compare to?

Anyways, I like your approach, but.it.seems overly complicated, but maybe there is thought in it that I can't grasp yet, I am in no position to qualify your proposal. Could you explain more why you wanted two parameters?

Anyways, the first thought that came to my head is to introduce a fallback collateral ratio (can be set optional by the user when creating the position, to not break existing logic, must be e.g. 1.85 or higher) . The mechanic would be as follows:
 If a position is margin called, an order is placed to sell as many BTS as needed to reduce the debt, such that the position has a collateral ratio higher or equal to the fallback ratio after the sale.
This introduces also a implicit reserve and enhance part but utilizes only one parameter.
« Last Edit: February 04, 2018, 03:49:32 pm by sschiessl »

Offline pc

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Re: A proposal to update the margin call process
« Reply #2 on: February 04, 2018, 04:24:18 pm »
IMO it's a bad idea to split one short into two, because the lower collateralized one is more likely to cause a black swan.

But I agree that it is not really required the the whole position is margin called. In fact I think the current implementation is flawed in that regard. It would normally be sufficient to sell *some* of the collateral to cover the debt. As long as the price is better than the collateral ratio (CR) of the short position, the CR will improve through such trades, and can eventually move out of margin call territory. At this point, the short position should no longer automatically buy back the debt. The current implementation continues to do so. This should be fixed.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3482
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: A proposal to update the margin call process
« Reply #3 on: February 04, 2018, 04:55:19 pm »
This issue will be addressed by fixing https://github.com/bitshares/bitshares-core/issues/343 .

In short,
* always update the call price after a short position got partially margin called, and
* always start matching from position with least collateral ratio.

With this logic, if a big position is partially called by a small limit order, the position will leave on the book with lower call price (in terms of debt/collateral, e.g. how much CNY per BTS). It can still be fully called by a big limit order though, which is at same risk as small positions.
« Last Edit: March 05, 2018, 10:58:26 am by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline KenMonkey

  • Full Member
  • ***
  • Posts: 112
    • View Profile
  • BitShares: kmnk
Re: A proposal to update the margin call process
« Reply #4 on: February 04, 2018, 07:54:37 pm »
Ugh understanding bitshares economics is hard. And then it's up to the stakeholders to vote correctly. We need to be smart and we need to have good explanations.

Any ideas on this?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12728
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: A proposal to update the margin call process
« Reply #5 on: February 04, 2018, 09:38:12 pm »
This issue will be addressed by fixing https://github.com/bitshares/bitshares-core/issues/343 .

In short,
* always update the call price after a short position got partially margin called, and
* always start matching from position with least collateral ratio.

With this logic, if a big position is partially called by a small limit order, the position will leave on the book with higher call price. It can still be fully called by a big limit order though, which is at same risk as small positions.
+5%
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1073
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
Re: A proposal to update the margin call process
« Reply #6 on: February 05, 2018, 05:16:48 am »
This issue will be addressed by fixing https://github.com/bitshares/bitshares-core/issues/343 .

In short,
* always update the call price after a short position got partially margin called, and
* always start matching from position with least collateral ratio.

With this logic, if a big position is partially called by a small limit order, the position will leave on the book with higher call price. It can still be fully called by a big limit order though, which is at same risk as small positions.

great, in my view this issue should be give the highest priority to solve, the current process give manipulators big chance to short BTS and make money and increase the risk of black swan, all this hurt the BTS ecosystem greatly.

[member=18687]abit[/member] please ask me to attend the test afte development.
« Last Edit: February 05, 2018, 05:22:05 am by bitcrab »

Offline sschiessl

Re: A proposal to update the margin call process
« Reply #7 on: February 05, 2018, 09:58:56 am »
This issue will be addressed by fixing https://github.com/bitshares/bitshares-core/issues/343 .

In short,
* always update the call price after a short position got partially margin called, and
* always start matching from position with least collateral ratio.

With this logic, if a big position is partially called by a small limit order, the position will leave on the book with higher call price. It can still be fully called by a big limit order though, which is at same risk as small positions.

This will very likely resolve most of the issues, yet one enables to buy the whole margin call. I think that hurts the BTS price when the whole market is going up. Clever traders can bet on the markets rising (all cryptos are connected in that somehow) and simply buy the whole margin call order without driving up the BTS price accordingly, which is bad for all BTS holders.

I think some mechanic should be added to avoid buying the whole order if a collateral ratio of e.g. 2.00 can be achieved by partial selling (of course making sure in the formula that you can buy the whole order if the ratio is e.g. less than 1.5 or something). I would be happy to support working out a proper mechanics for this issue if there is agreement. Nevertheless, just fixing the above issue is also very beneficial.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3482
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: A proposal to update the margin call process
« Reply #8 on: February 05, 2018, 11:37:37 am »
This issue will be addressed by fixing https://github.com/bitshares/bitshares-core/issues/343 .

In short,
* always update the call price after a short position got partially margin called, and
* always start matching from position with least collateral ratio.

With this logic, if a big position is partially called by a small limit order, the position will leave on the book with higher call price. It can still be fully called by a big limit order though, which is at same risk as small positions.

This will very likely resolve most of the issues, yet one enables to buy the whole margin call. I think that hurts the BTS price when the whole market is going up. Clever traders can bet on the markets rising (all cryptos are connected in that somehow) and simply buy the whole margin call order without driving up the BTS price accordingly, which is bad for all BTS holders.

I think some mechanic should be added to avoid buying the whole order if a collateral ratio of e.g. 2.00 can be achieved by partial selling (of course making sure in the formula that you can buy the whole order if the ratio is e.g. less than 1.5 or something). I would be happy to support working out a proper mechanics for this issue if there is agreement. Nevertheless, just fixing the above issue is also very beneficial.
I think it's possible to implement a mechanism that only minimum required collateral is sold, to archive a given collateral ratio, the MCR (175%), or perhaps another parameter that a little more than MCR to avoid dust data (orders/fills).

However, under certain circumstances (to stop loss for example) traders want to be fully magin called and/or don't want the call price to be updated. The demands are fair to some extent.

So, this is a serious question: what mechanism is better for the ecosystem? I'm not sure so far.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline sschiessl

Re: A proposal to update the margin call process
« Reply #9 on: February 05, 2018, 12:07:16 pm »
This issue will be addressed by fixing https://github.com/bitshares/bitshares-core/issues/343 .

In short,
* always update the call price after a short position got partially margin called, and
* always start matching from position with least collateral ratio.

With this logic, if a big position is partially called by a small limit order, the position will leave on the book with higher call price. It can still be fully called by a big limit order though, which is at same risk as small positions.

This will very likely resolve most of the issues, yet one enables to buy the whole margin call. I think that hurts the BTS price when the whole market is going up. Clever traders can bet on the markets rising (all cryptos are connected in that somehow) and simply buy the whole margin call order without driving up the BTS price accordingly, which is bad for all BTS holders.

I think some mechanic should be added to avoid buying the whole order if a collateral ratio of e.g. 2.00 can be achieved by partial selling (of course making sure in the formula that you can buy the whole order if the ratio is e.g. less than 1.5 or something). I would be happy to support working out a proper mechanics for this issue if there is agreement. Nevertheless, just fixing the above issue is also very beneficial.
I think it's possible to implement a mechanism that only minimum required collateral is sold, to archive a given collateral ratio, the MCR (175%), or perhaps another parameter that a little more than MCR to avoid dust data (orders/fills).

However, under certain circumstances (to stop loss for example) traders want to be fully magin called and/or don't want the call price to be updated. The demands are fair to some extent.

So, this is a serious question: what mechanism is better for the ecosystem? I'm not sure so far.

If that second parameter can be optionally set by the user when creating the position (e.g. must be 2.00 or higher), you have both options and you dont kill the logic of existing positions (they would be handled as a position with the parameter left blank)
« Last Edit: February 05, 2018, 12:08:49 pm by sschiessl »

Offline yvv

  • Hero Member
  • *****
  • Posts: 1182
    • View Profile
Re: A proposal to update the margin call process
« Reply #10 on: February 05, 2018, 12:43:25 pm »
Sorry, but OP proposal is a piece of shit.

Quote
I think it's possible to implement a mechanism that only minimum required collateral is sold

This is how it should work. It is a simple math, damn it! And remove short squeeze protection to prevent global settlements.


Offline pc

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Re: A proposal to update the margin call process
« Reply #11 on: February 05, 2018, 02:24:32 pm »
I think that hurts the BTS price when the whole market is going up. Clever traders can bet on the markets rising (all cryptos are connected in that somehow) and simply buy the whole margin call order without driving up the BTS price accordingly, which is bad for all BTS holders.

When BTS is going up it is unlikely that there are any margin calls that could be "exploited" like this. Also, the volume of buying up a single margin call will usually be too low to influence the price one way or another.

IMO we shouldn't make the margin call algorithm more complicated than necessary. Just match full orders until the call price is safe again.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3482
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: A proposal to update the margin call process
« Reply #12 on: February 05, 2018, 08:01:52 pm »
Sorry, but OP proposal is a piece of shit.

Quote
I think it's possible to implement a mechanism that only minimum required collateral is sold

This is how it should work. It is a simple math, damn it!

If that second parameter can be optionally set by the user when creating the position (e.g. must be 2.00 or higher), you have both options and you dont kill the logic of existing positions (they would be handled as a position with the parameter left blank)

If going this way, it would be a bigger change, need more discussion. UI need to adapt as well.

And remove short squeeze protection to prevent global settlements.
You can vote for witnesses those are feeding a value that you like.

IMO we shouldn't make the margin call algorithm more complicated than necessary. Just match full orders until the call price is safe again.
Debatable.
It's not too complicated to implement "selling only required collateral".


target_CR = new_collateral / ( new_debt * feed_price )
          = (collateral - amount_to_sell) / (debt - amount_to_get) / feed_price
          = (collateral - amount_to_sell) / (debt - amount_to_sell / (feed_price * (1 - MSSR))) / feed_price
=>
amount_to_sell = (collateral - debt * feed_price * target_CR) * (1 - MSSR) / (1 - MSSR - target_CR)


Assuming feed_price is in terms of debt / collateral, e.g. how much CNY per BTS
Code: [Select]
target_CR = new_collateral / ( new_debt / feed_price )
          = ( collateral - amount_to_sell ) * feed_price / ( debt - amount_to_get )
          = ( collateral - amount_to_sell ) * feed_price / ( debt - amount_to_sell * (feed_price / MSSR) )
=>
amount_to_sell = (debt * target_CR - collateral * feed_price) * MSSR / (target_CR - MSSR) / feed_price
« Last Edit: March 05, 2018, 01:34:30 pm by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3482
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: A proposal to update the margin call process
« Reply #13 on: February 06, 2018, 12:36:05 pm »
About the stop-loss options and etc, I just started a discussion about a new BSIP: https://github.com/bitshares/bsips/issues/51 , please participate.

It is a new feature, no BSIP, no voting by stake holders, won't be implemented.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Online Thul3

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: A proposal to update the margin call process
« Reply #14 on: February 16, 2018, 09:11:07 pm »
I would also add a USD/BTS colletaral ratio function based on amount so it would be less possible to get these kind of big margin calls.Means as higher the amount of collateral as higher the ratio to lower the risk to get margin called.
Bitcraps margin call was a good example how his margin call sucked out all the bitUSD from the market.
Each and every coin was at least 10% cheaper than on other exchanges.And there was no possibility and liquidity to get funds
from external exchanges to buy these margin calls without loosing money.
Since Margin Call was offered 10% under settlement price and all coins had already a 10% lower price than on external exchanges there was no way to transfer liquidity to DEX without making a loss on that trading.
So the main intention to get the margin call quickly eaten by a lower price of 10% is only valid for margin calls to a certain seize.
DEX has till today a lack of liquidity of bitUSD which you can see that most coins are still 5% cheaper than on external exchanges.

I also agree that only the amount of BTS should be offered for sale on a margin call which is enought to get all colletreal back to minimal Ratio + 0.xx