BitShares Forum

Main => General Discussion => Topic started by: bigcat on December 19, 2014, 07:01:39 pm

Title: what will happen when many margin orders are expiring
Post by: bigcat on December 19, 2014, 07:01:39 pm
If buying and shorting depth aren't deep enough, when margin orders are expiring, will they dump the price to 0? Maybe not likely to happen in the USD market, but in other market this might happen. For example in the current EUR/BTS market, 1050 EUR needs to be covered in 9 days, but the current short depth is only 1020. When those 1050 EUR are expiring, will they empty the buying order book?  Does it mean that if I put an order right before those margin orders expire, e.g., to buy 1 million BTS for 0.01 EUR and I'll get the deal?
Title: Re: what will happen when many margin orders are expiring
Post by: vlight on December 19, 2014, 07:07:20 pm
afaik it 'rides' the feed price.
Title: Re: what will happen when many margin orders are expiring
Post by: Chuckone on December 19, 2014, 07:10:47 pm
afaik it 'rides' the feed price.

Yep, they create a wall at feed price
Title: Re: what will happen when many margin orders are expiring
Post by: bigcat on December 19, 2014, 07:12:34 pm
So one can never buy below the feed price? Even when all shorts are gone?
Title: Re: what will happen when many margin orders are expiring
Post by: toast on December 19, 2014, 07:19:39 pm
You can, just not when it's happening automatically b/c of expired margin
Title: Re: what will happen when many margin orders are expiring
Post by: bigcat on December 19, 2014, 07:31:36 pm
i c. so the part of expired margin that cannot be automatically covered will become a permanent selling wall whose price floats with the feed, right?
If no one is buying that wall, or if the feed price goes so low that there isn't enough to cover the issued assets, does it mean that the system is owing the issued assets and can't find a way to pay it back?
Title: Re: what will happen when many margin orders are expiring
Post by: toast on December 19, 2014, 07:36:12 pm
i c. so the part of expired margin that cannot be automatically covered will become a permanent selling wall whose price floats with the feed, right?
If no one is buying that wall, or if the feed price goes so low that there isn't enough to cover the issued assets, does it mean that the system is owing the issued assets and can't find a way to pay it back?

You can find more details elsewhere, but yes, if collateral is insufficient to buy back the assets, the system "owes" dollars it doesn't have. The collateral requirements are so high with such frequent turnover to be able to cover extreme volatility so that this never happens.

There are two main options for what the system "should" do in this event. It could be built to force everyone to settle as soon as there is insufficient collateral so that your USD is swapped for BTS at the last moment the system can afford it. The other is the just let it continue, meaning the assets would track the value of their collateral until collateralization levels recovered.

The design goal of BTS is to minimize that particular systemic risk.
Title: Re: what will happen when many margin orders are expiring
Post by: bigcat on December 19, 2014, 07:54:11 pm
Although forcing the settlement of USD might be good for the system, as a user it's hard to imagine that the system could tamper with the USD deposited in each account. I believe the current release just continues working and hopes that this never happens or can be solved in the future.
There should better be a low limit of the selling wall, so that if feed goes too low the selling price won't follow. That probably offers a chance to solve the deficit in the future. Otherwise it might be causing permanent deficit in the system and not sure if there will be a way to solve it.
Title: Re: what will happen when many margin orders are expiring
Post by: arhag on December 19, 2014, 08:48:19 pm
There are two main options for what the system "should" do in this event. It could be built to force everyone to settle as soon as there is insufficient collateral so that your USD is swapped for BTS at the last moment the system can afford it. The other is the just let it continue, meaning the assets would track the value of their collateral until collateralization levels recovered.

What if at the moment under-collateralization happens, the blockchain decides the fraction f of the outstanding BitUSD balance it would have to destroy for the remaining outstanding BitUSD balance to equal the total BitUSD debt owed by collateralized shorts. Then it would take that f fraction of any user's BitUSD balance that was held during that block and convert it into a BitUSD IOU given to the user (in reality a note is made for that block in the database and each client visualizes this change and the conversion only happens on transfer of the BitUSD). Converting the fraction of BitUSD balances into BitUSD IOUs "fixes" the BitUSD under-collateralization issue but still of course means the blockchain has more liabilities than assets because of the extra BitUSD IOUs. If further under-collateralization occurs, further conversions from BitUSD to BitUSD IOU are done by the blockchain. Now as the BitUSD reserves grow (through collected short interest for example), the blockchain can use that to convert a fraction of the outstanding BitUSD IOU back into actual BitUSD.

The reason for the separation into BitUSD and BitUSD IOU is so that the bank run scenario can be avoided. It doesn't matter whether one exits out of BitUSD into BTS early or later. The slow movers aren't going to be left holding the bag (left with BitUSD with absolutely no shorts to back it). All BitUSD holders would pay in proportion due to under-collateralization of some shorts, which is fair since BitUSD is supposed to be fungible. BitUSD IOUs would of course have some value (depending on the market's belief that the blockchain can pay the holders back), but it is not fungible with BitUSD so it would have a different price and also could not be used to cover shorts.
Title: Re: what will happen when many margin orders are expiring
Post by: theoretical on December 29, 2014, 03:46:56 pm
You can find more details elsewhere, but yes, if collateral is insufficient to buy back the assets, the system "owes" dollars it doesn't have.

The "correct" thing to do is stop paying yield and use USD from the yield fund to repay the "owed" dollars, i.e.:

- The short auto-buys and burns as many USD as it can with its collateral at the best price
- In this scenario, that won't be enough USD to cover the position
- The system burns additional USD from the yield fund to make up the difference

Thus the amount of the USD burned ends up equal to the USD that were created when the short position was opened.

I'm not sure if this was actually implemented, or if it was only discussed.