Author Topic: Done my first short but now can I cover with a "limit" order?  (Read 2370 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
@arhag: would you like to extend the "Short" article in the bitshares wiki? That would be awesome!
http://wiki.bitshares.org/index.php/BitShares/Short
I have a feeling your experience and understanding of that topic is a lot better than mine.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Option 3: Short to your self by using your remaining BTS to creat bitUSD before the margin call, and use these bitUSD to cover.

I think you misunderstood the scenario. In the scenario I described 100% of his BTS would be locked as collateral in a short position. He would have 0 free BTS to use in another short position.

But your comment brought up a good point for the conservative strategy I proposed in [1] in my previous post. There is no guarantee that the BitUSD needed could be purchased at a price less than 150 BTS/BitUSD. In the case, you may not be able to do the cover chain with the numbers I posted and could therefore be unable to cover and even eventually exposed to a margin call. This means one would need enough BTS to do a self-short at the price feed to create enough BitUSD to cover the next short position up the chain. So before I assumed you need half the BTS of the collateral of the short position you want to cover, but in reality in the worst case scenario (horrible bear market) you need 1.5x the BTS of the collateral of the short position you want to cover. This is essentially the same thing as reversing the order of short positions and having each subsequent margin be 2/3 the previous margin.

So the new break down of a 3645 BTS margin short order would be: 1) 1215 BTS margin; 2) 810 BTS margin; 3) 540 BTS margin; 4) 360 BTS margin; 5) 240 BTS margin; 6) 160 BTS margin; 7) 320 BTS margin. If each of these were shorted at the 100 BTS/BitUSD price, the corresponding short positions would owe: 1) 6.075 BitUSD; 2) 4.05 BitUSD; 3) 2.70 BitUSD; 4) 1.80 BitUSD; 5) 1.20 BitUSD; 6) 0.80 BitUSD; 7) 1.60 BitUSD (a total of 18.225 BitUSD owed). The worst case scenario would require self-shorting at a new 150 BTS/BitUSD price (just prior to margin call of previous short positions). With 6.075 BitUSD, short position 1 would be covered,  unlocking 1822.5 BTS collateral which could be used to self-short (short position 2') at the 150 BTS/BitUSD price to generate a new 4.05 BitUSD. This 4.05 BitUSD would be used to cover short position 2, unlocking 1215 BTS collateral which could be used to self-short (short position 3') at the 150 BTS/BitUSD price to generate a new 2.70 BitUSD. This process can be repeated down the chain until short position 6 is covered unlocking 240 BTS collateral. In order to self-short 1.60 BitUSD (short position 7') at the 150 BTS/BitUSD price, it would require 720 BTS. This means an additional 480 BTS would be needed to start with. That 1.60 BitUSD can then be used to cover short position 7 and unlock 480 BTS of collateral. Furthermore, to self-short the original 6.075 BitUSD (short position 1') at the 150 BTS/BitUSD price requires an additional 2733.75 BTS at the beginning. This means with a total of 6858.75 BTS, only 3645 BTS could be used as the margin for the initial set of shorts (assuming the worst case scenario with the above strategy where the short order was split into 7 short orders), or 3645/6858.75 = 53.14%. Another way to look at it is that I need 3213.75 free BTS to support this roll over process in the worst case scenario (excluding margin calls) for the set of shorts that had a total collateral of 5467.5 BTS, or a 3213.75/5467.5 = 58.78% free BTS to collateral BTS ratio (again assuming using the above strategy where the short order was split into 7 short orders). If the worst case scenario did occur, it would mean that the shorts would simply be rolled over except this time there would be only 480 BTS lying around which is not enough to do the roll over process again.

To go further we would want to see how much of the BTS could be used to do the roll over process multiple times in the worst case scenario. When 3645 BTS was used as the short margin in the above scheme, the collateral in the initial set of shorts was 5467.5 BTS (call this C_1), and after one roll over only 480 BTS was left after the roll over process, or 480/5467.5 = 8.78% of the initial collateral amount. After one roll over process the collateral in the new set of shorts increase by 50% to 8201.25 BTS (call this C_2). We know that we require 58.78% of this collateral amount (or 4820.69 BTS) as free BTS to do the roll over process one more time but only get 480 BTS (or 8.78% of the initial collateral amount) out of the roll over process. So the amount of additional free BTS needed prior to the second roll over process is F_1 = 0.5878 * C_2 - 0.0878 * C_1 = 0.5878 * 1.5 *  C_1 - 0.0878 * C_1 = 0.7939 * C_1. In fact, the amount of additional free BTS needed prior to the (n+1)th roll over process is F_n = 0.7939 * C_n, where C_n = 1.5^(n-1) * C_1. Then the ratio between the amount of free BTS needed to support N roll overs and the initial collateral amount is r_N = 0.5878 + (F_1 + F_2 + ... + F_(N-1))/C_1 = 0.5878 + 0.7939 * (1 + 1.5 + 1.5^2 + ... + 1.5^(N-2)) = 0.5878 + 0.7939 * 2 * (1.5^(N-1) - 1) = 1.5878 * ((1.5)^(N-1)) - 1.0. So if the original margin you want to use for the initial short is M, then C_1 = 1.5*M and the amount of free BTS needed is C_1 * r_N = 1.5 * M * r_N. Thus the percentage of the total BTS that can be used as the margin for the initial short while still allowing for N rollovers in the worst case scenario (using the above scheme with the short order split into 7 short orders) is p_N = M / (M + 1.5 * M * r_N) = 1/(1 + 1.5 * r_N) = 1/(2.3817 * (1.5)^(N-1) - 0.5).

So as an example, Let's say I have 10,000 BTS and I want to use the above method to short BitUSD without realizing any losses for 3 months (N = 2)  under the assumption that the price of BTS (in BitUSD) never drops more than 33% from the roll over / initial short price within 30 days after any roll over / initial short point and that there are no BitUSD sell orders at or below the price feed at the time of roll overs. In that case, to be conservative and plan for the worse case, I should not use more than 32.54% of my BTS (or 3254 BTS) as the initial margin for the short. In other words, I could only short sell 1627 BTS worth of BitUSD (at a price of 100 BTS/BitUSD this would mean only being able to conservatively short sell 16.27 BitUSD with my 10,000 BTS, or 100 BitUSD worth of BTS). In the worst case scenario (under the constraints of assumptions listed above), after 90 days from my initial short, the price feed would be just under 337.5 BTS/BitUSD and I would have 644.75 BTS free and 7 short positions that collectively owed 16.27 BitUSD and had 10982.25 BTS in collateral (just slightly under the margin call limit). If the price magically rebounded suddenly to 100 BTS/BitUSD and then the shorts expired and fully matched at this new price feed, I would end up with 10,000 BTS again (no profit and no loss).
« Last Edit: March 01, 2015, 03:08:10 pm by arhag »

Offline merlin0113

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Thanks for your help. I don't have any available bitUSD as the only thing I have done is buy BTS and then short bitUSD. My question is can I control the price at which I cover using a limit order? I gather the current design only allows one to cover at the current feed price (aside from depositing extra funds and making a separate bitUSD limit buy).

Up to recently, BitShares did not allow the collateral locked in the short position to be used to buy BitUSD to cover the debt outside of automatic covers caused by either expired shorts (after 30 days) or margin calls (which you normally want to avoid). Recently bytemaster talked about the ability to set the call price (in BTS/BitUSD) on a cover to anything you want above the minimum call price. This could be done by the short position owner to trigger a "margin call" intentionally to act like a limit order that buys the BitUSD using the collateral in the short position. I am not sure if this triggered margin call will match with any orders up to the price feed or up to 10% above the price feed. If it is the latter, this can be a dangerous thing to do since if the orders up to and including the price feed could disappear suddenly (say the order owners detect your call price change transaction on the network and try to front run you) then you can end up paying a lot more than you intended. Either way this doesn't do what you want because it doesn't allow you to specify your own custom price limit. There is also the question of whether this feature (I hesitate to call it that because of how it is implemented) has even been implemented in the current version of the client.

For now, just ignore that feature and pretend it doesn't exist. What this means is that you are either forced to cover with a BitUSD balance that you already own or simply wait until expiration. There is one other thing to keep in mind about expired covering. I think the current implementation of the client has a bug (unless it has already been fixed) in which automatic cover orders of expired shorts will actually buy up to 10% above the price feed rather than just up to and including the price feed as they are supposed to. So again, relying on expired covering might be a bit risky.

Now from your description it seems that you used your entire BTS balance as collateral for a short, is that correct? In that case you are forced to wait until expiration or you need to buy more BitUSD (or more BTS which you then trade for BitUSD) using outside money. This is why you shouldn't use all of your BTS for short collateral; you need to keep some BTS around to be able to buy the BitUSD you will need to cover your short debt. You could then use this BTS to place a BitUSD buy order at the price you want to cover at. What this effectively means is that the amount of margin you need to initially provide for the short is not really 2x but 3x or even 3.5x if you want to be extra safe (2x that gets locked along with the BitUSD buyer's 1x in the collateral, and then the other 1x to 1.5x you keep to support your BitUSD buy order to get the amount of BitUSD necessary to cover the debt).

So as an example, let's say you had 3,500 BTS and the current price feed was 110 BTS/BitUSD. Let's say you were willing to short at a price as low as 100 BTS/BitUSD. Let's also say that you wanted to exit your short position if the price went down to 90 BTS/BitUSD. You would put 2,000 BTS as the margin for a short order at the price feed with a price limit of 100 BTS/BitUSD (meaning the maximum debt you could end up owing from the short position(s) would be 10 BitUSD). In the worst case scenario (excluding margin calls) your short position would be fully matched  at the 100 BTS/BitUSD price with someone's bid for 10 BitUSD purchased using 1000 BTS (locking 3000 BTS in the collateral of the short position) and then the price of BitUSD would grow all the way up to 149 BTS/BitUSD (if it reached 150 BTS/BitUSD it would trigger a margin call which you want to avoid). Even if you had to buy BitUSD at a price of 150 BTS/BitUSD, you could use all 1,500 BTS of your remaining BTS balance outside of the collateral to buy the 10 BitUSD which you would then use to cover the short and get back the 3000 BTS collateral (that would be a net loss of 500 BTS). This is a more naive conservative strategy; there are ways to keep smaller amounts of a BTS balance without adding additional risk by splitting up the short orders [1].

Now let's say your short position was fully matched at the 100 BTS/BitUSD price (again 3000 BTS locked in collateral with a 10 BitUSD debt owed). At this point you would want to use your remaining BTS balance to put a BitUSD buy order for a quantity of 10 BitUSD at whatever price limit you wish to exit your BTS long exposure at. So if that price was 90 BTS/BitUSD you would use 900 BTS to put a buy order for 10 BitUSD at the 90 BTS/BitUSD price. The remaining 600 BTS would be kept in your wallet as your BTS balance. Now you can simply leave your wallet alone (making sure the price doesn't get close to the 150 BTS/BitUSD margin call price of course) and let the market take care of everything. Eventually you come back (before the expiration date) and discover whether your buy order was matched or not. If was fully matched you use that 10 BitUSD to cover the short and you end up with 3600 BTS (a net profit of 100 BTS). If was not fully matched, you may decide to cancel the order and instead buy the needed BitUSD at a higher BTS/BitUSD price (meaning smaller profits or even a loss), or you simply cancel the order and let the short expire and have the blockchain do the forced covering for you at any price up to and including the price feed.

[1] If you want to reduce the amount of BTS you need to keep outside of the collateral you can split up your short orders. Here is one strategy for the above example. Instead of having one short order with 2000 BTS margin, you break up the order into the following 5 short orders: 1) 1000 BTS margin; 2) 500 BTS margin; 3) 250 BTS margin; 4) 125 BTS margin; 5) 125 BTS margin. (Note: you can break it up in a similar manner to more orders if you wish but that decision depends on user convenience, unless automated by a bot, and more importantly on the quantity of the margin of the smallest order relative to the transaction fees.)  Now in the worst case scenario (excluding margin calls) half the amount of the collateral in any short position would be needed to trade for the necessary amount of BitUSD to cover the debt of that short position. So for the case of short position 5, which would have a collateral of 187.5 BTS, one would need 93.75 BTS outside of collateral to fully cover short position 5. By doing so, one would then have 187.5 BTS outside of collateral, half of which can be put aside and the other half (93.75 BTS) could be used to repeat the process by buying BitUSD to cover short position 4. Short position 4's collateral (187.5 BTS) can be used to buy BitUSD to cover short position 3. Short position 3's collateral (375 BTS) can be used to buy BitUSD to cover short position 2. This continues until all of the short positions have been fully covered and user is left with 1593.75 BTS. Since the user originally had a total of 2000 BTS dedicated for margins of short orders and an additional 93.75 BTS held outside of the collateral to initialize the covering chain, that means there would be a net loss of 500 BTS in this scenario (just like in the previous example).
If the number of short orders you want to split the shorting process (of a total of M BTS margin) into is N (in the above example N = 5), then the margin provided for the smallest short order is (M / 2^(N-1)) BTS, and thus the amount of BTS that should be kept outside of the collateral is 0.75 * (M/ 2^(N-1)) BTS, or 1.5 * (M / 2^N) BTS. That means if the total amount of BTS you own is T = M + 1.5*(M / 2^N) = M * (1 + 1.5/2^N) BTS, then the maximum percentage p of your BTS balance that you should use for short orders if you want to be conservative (assuming you following the above procedure to split the orders up into N orders as described above, where N is an integer greater than 0) is p = M/T = 1/(1 + 1.5/2^N).

 [/quote]In that case you are forced to wait until expiration or you need to buy more BitUSD (or more BTS which you then trade for BitUSD) using outside money.
[/quote]

Option 3: Short to your self by using your remaining BTS to creat bitUSD before the margin call, and use these bitUSD to cover. This is necessary step when 1.There is no enough BTS buy order near the feed price, which is always the case in bear market; 2. And you don't have bitUSD balance; 3. And you don't want your short order to expire, because this is too risky as you will forced to cover at whatever low feed price in this case; 3. And you would remain your short positon longer than 30 days.

So kindly remainder: Don't short bitUSD in bear market, at least not large amount.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Thanks for your help. I don't have any available bitUSD as the only thing I have done is buy BTS and then short bitUSD. My question is can I control the price at which I cover using a limit order? I gather the current design only allows one to cover at the current feed price (aside from depositing extra funds and making a separate bitUSD limit buy).

Up to recently, BitShares did not allow the collateral locked in the short position to be used to buy BitUSD to cover the debt outside of automatic covers caused by either expired shorts (after 30 days) or margin calls (which you normally want to avoid). Recently bytemaster talked about the ability to set the call price (in BTS/BitUSD) on a cover to anything you want above the minimum call price. This could be done by the short position owner to trigger a "margin call" intentionally to act like a limit order that buys the BitUSD using the collateral in the short position. I am not sure if this triggered margin call will match with any orders up to the price feed or up to 10% above the price feed. If it is the latter, this can be a dangerous thing to do since if the orders up to and including the price feed could disappear suddenly (say the order owners detect your call price change transaction on the network and try to front run you) then you can end up paying a lot more than you intended. Either way this doesn't do what you want because it doesn't allow you to specify your own custom price limit. There is also the question of whether this feature (I hesitate to call it that because of how it is implemented) has even been implemented in the current version of the client.

For now, just ignore that feature and pretend it doesn't exist. What this means is that you are either forced to cover with a BitUSD balance that you already own or simply wait until expiration. There is one other thing to keep in mind about expired covering. I think the current implementation of the client has a bug (unless it has already been fixed) in which automatic cover orders of expired shorts will actually buy up to 10% above the price feed rather than just up to and including the price feed as they are supposed to. So again, relying on expired covering might be a bit risky.

Now from your description it seems that you used your entire BTS balance as collateral for a short, is that correct? In that case you are forced to wait until expiration or you need to buy more BitUSD (or more BTS which you then trade for BitUSD) using outside money. This is why you shouldn't use all of your BTS for short collateral; you need to keep some BTS around to be able to buy the BitUSD you will need to cover your short debt. You could then use this BTS to place a BitUSD buy order at the price you want to cover at. What this effectively means is that the amount of margin you need to initially provide for the short is not really 2x but 3x or even 3.5x if you want to be extra safe (2x that gets locked along with the BitUSD buyer's 1x in the collateral, and then the other 1x to 1.5x you keep to support your BitUSD buy order to get the amount of BitUSD necessary to cover the debt).

So as an example, let's say you had 3,500 BTS and the current price feed was 110 BTS/BitUSD. Let's say you were willing to short at a price as low as 100 BTS/BitUSD. Let's also say that you wanted to exit your short position if the price went down to 90 BTS/BitUSD. You would put 2,000 BTS as the margin for a short order at the price feed with a price limit of 100 BTS/BitUSD (meaning the maximum debt you could end up owing from the short position(s) would be 10 BitUSD). In the worst case scenario (excluding margin calls) your short position would be fully matched  at the 100 BTS/BitUSD price with someone's bid for 10 BitUSD purchased using 1000 BTS (locking 3000 BTS in the collateral of the short position) and then the price of BitUSD would grow all the way up to 149 BTS/BitUSD (if it reached 150 BTS/BitUSD it would trigger a margin call which you want to avoid). Even if you had to buy BitUSD at a price of 150 BTS/BitUSD, you could use all 1,500 BTS of your remaining BTS balance outside of the collateral to buy the 10 BitUSD which you would then use to cover the short and get back the 3000 BTS collateral (that would be a net loss of 500 BTS). This is a more naive conservative strategy; there are ways to keep smaller amounts of a BTS balance without adding additional risk by splitting up the short orders [1].

Now let's say your short position was fully matched at the 100 BTS/BitUSD price (again 3000 BTS locked in collateral with a 10 BitUSD debt owed). At this point you would want to use your remaining BTS balance to put a BitUSD buy order for a quantity of 10 BitUSD at whatever price limit you wish to exit your BTS long exposure at. So if that price was 90 BTS/BitUSD you would use 900 BTS to put a buy order for 10 BitUSD at the 90 BTS/BitUSD price. The remaining 600 BTS would be kept in your wallet as your BTS balance. Now you can simply leave your wallet alone (making sure the price doesn't get close to the 150 BTS/BitUSD margin call price of course) and let the market take care of everything. Eventually you come back (before the expiration date) and discover whether your buy order was matched or not. If was fully matched you use that 10 BitUSD to cover the short and you end up with 3600 BTS (a net profit of 100 BTS). If was not fully matched, you may decide to cancel the order and instead buy the needed BitUSD at a higher BTS/BitUSD price (meaning smaller profits or even a loss), or you simply cancel the order and let the short expire and have the blockchain do the forced covering for you at any price up to and including the price feed.

[1] If you want to reduce the amount of BTS you need to keep outside of the collateral you can split up your short orders. Here is one strategy for the above example. Instead of having one short order with 2000 BTS margin, you break up the order into the following 5 short orders: 1) 1000 BTS margin; 2) 500 BTS margin; 3) 250 BTS margin; 4) 125 BTS margin; 5) 125 BTS margin. (Note: you can break it up in a similar manner to more orders if you wish but that decision depends on user convenience, unless automated by a bot, and more importantly on the quantity of the margin of the smallest order relative to the transaction fees.)  Now in the worst case scenario (excluding margin calls) half the amount of the collateral in any short position would be needed to trade for the necessary amount of BitUSD to cover the debt of that short position. So for the case of short position 5, which would have a collateral of 187.5 BTS, one would need 93.75 BTS outside of collateral to fully cover short position 5. By doing so, one would then have 187.5 BTS outside of collateral, half of which can be put aside and the other half (93.75 BTS) could be used to repeat the process by buying BitUSD to cover short position 4. Short position 4's collateral (187.5 BTS) can be used to buy BitUSD to cover short position 3. Short position 3's collateral (375 BTS) can be used to buy BitUSD to cover short position 2. This continues until all of the short positions have been fully covered and user is left with 1593.75 BTS. Since the user originally had a total of 2000 BTS dedicated for margins of short orders and an additional 93.75 BTS held outside of the collateral to initialize the covering chain, that means there would be a net loss of 500 BTS in this scenario (just like in the previous example).
If the number of short orders you want to split the shorting process (of a total of M BTS margin) into is N (in the above example N = 5), then the margin provided for the smallest short order is (M / 2^(N-1)) BTS, and thus the amount of BTS that should be kept outside of the collateral is 0.75 * (M/ 2^(N-1)) BTS, or 1.5 * (M / 2^N) BTS. That means if the total amount of BTS you own is T = M + 1.5*(M / 2^N) = M * (1 + 1.5/2^N) BTS, then the maximum percentage p of your BTS balance that you should use for short orders if you want to be conservative (assuming you following the above procedure to split the orders up into N orders as described above, where N is an integer greater than 0) is p = M/T = 1/(1 + 1.5/2^N).
« Last Edit: March 01, 2015, 05:15:31 am by arhag »

Offline merlin0113

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Thanks for your help. I don't have any available bitUSD as the only thing I have done is buy BTS and then short bitUSD. My question is can I control the price at which I cover using a limit order? I gather the current design only allows one to cover at the current feed price (aside from depositing extra funds and making a separate bitUSD limit buy).

Yes.

Offline bitmarley

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Thanks for your help. I don't have any available bitUSD as the only thing I have done is buy BTS and then short bitUSD. My question is can I control the price at which I cover using a limit order? I gather the current design only allows one to cover at the current feed price (aside from depositing extra funds and making a separate bitUSD limit buy).


Offline merlin0113

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Done my first short now when I press "Cover" under the Open Margin Orders section I see options for what appears to be a market order to cover.
But is there a way to cover with a limit order or will it force me to cover exactly at the current feed price?

At current design, pressing "cover" menu simply means you would payback the bitUSD with available bitUSD balance of your account.

Offline bitmarley

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Done my first short now when I press "Cover" under the Open Margin Orders section I see options for what appears to be a market order to cover.
But is there a way to cover with a limit order or will it force me to cover exactly at the current feed price?