Author Topic: Bitshares shorting is flawed and needs to be fixed ASAP  (Read 6200 times)

0 Members and 1 Guest are viewing this topic.

Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #30 on: April 20, 2017, 11:13:19 pm »
I understand that polo way is basically the same (just in different order), but much easier for use and have less friction.

Yes, this is what I am talking about. Just forget about their higher leverage for a moment (although this is also important factor). The hole process of shorting at polo is one simple action: you place a sell order. To settle your debt, you place a buy order. The final result is the same as in BTS, but everything is seamless, and you don't need to make unnecessarily  high deposits. The mechanics behind this is very simple, and I don't see a reason why it should not work at DEX. You can still use your bitAssets as money, i.e. buy/sell/transfer etc.   

The amount of collateral which you need to put upfront depends on the price at which you short sell your asset. If you short at feed price, you need to put only MCR-1 upfront, because the rest you get when you sell your asset, and before that you don't have no dept. If you sell at premium, you need to put less upfront, if you sell at discount, you need to put more. If you want to short, but don't want to sell, you need to put entire collateral upfront and then do what you want with your asset, same as you do now.

Same goes with closing position. It is ridiculous that you need to deposit additional funds on top of collateral to settle your debt on DEX,  or find other workarounds, because the only purpose of collateral is to be used to settle the debt. And again, the amount of collateral which you need to spend depends on the price at which you buy back you debt, cheaper you buy, less you spend. If somebody kindly sends you bitAsset for free, you just keep your collateral.

« Last Edit: April 21, 2017, 12:05:39 am by yvv »

Offline paliboy

Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #31 on: April 21, 2017, 07:11:37 am »
Same goes with closing position. It is ridiculous that you need to deposit additional funds on top of collateral to settle your debt on DEX,  or find other workarounds, because the only purpose of collateral is to be used to settle the debt. And again, the amount of collateral which you need to spend depends on the price at which you buy back you debt, cheaper you buy, less you spend. If somebody kindly sends you bitAsset for free, you just keep your collateral.

Let's say that I borrowed 10 bitUSD @ 100 BTS with 2000 BTS collateral and then sold it for 10x100 BTS.

  • I buy 5 bitUSD @ 84 BTS in market, half of the debt could be automatically settled - do we want to do it? How would it adjust the collateral? Proportionately or should it keed some platform-defined/user-defined collateral ratio?
  • I want to settle half of my debt, I click "Update position" in "Margin Positions" in Bitshares wallet, enter 5 into Debt input box and click "Update positon" button. Network buys necessary assets for me at market rate and updates the collateral ratio - the same problem as in point 1.

IMHO it shouldn't be very difficult to implement (semi-)automatic closing of positions. Which one would people prefer? Or do you want something completely different?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12912
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #32 on: April 21, 2017, 07:33:10 am »
[member=38641]paliboy[/member]
settlement works differently. It doesn't buy back the debt in the market, but exchanges it into collateral from the shorter that has the least collateral ratio - and it does to **AT MARKET PRICE**.
Currently, there is a proposal approved that will move 1% of the volume from your end to the end of the shorter as some kind of a "fee".

If you want to close your position with a single click, we can make transactions that buy and close in the same transaction
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline nmywn

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #33 on: April 21, 2017, 09:34:14 am »
I understand that polo way is basically the same (just in different order), but much easier for use and have less friction.

Yes, this is what I am talking about. Just forget about their higher leverage for a moment (although this is also important factor). The hole process of shorting at polo is one simple action: you place a sell order. To settle your debt, you place a buy order. The final result is the same as in BTS, but everything is seamless, and you don't need to make unnecessarily  high deposits. The mechanics behind this is very simple, and I don't see a reason why it should not work at DEX. You can still use your bitAssets as money, i.e. buy/sell/transfer etc.   

The amount of collateral which you need to put upfront depends on the price at which you short sell your asset. If you short at feed price, you need to put only MCR-1 upfront, because the rest you get when you sell your asset, and before that you don't have no dept. If you sell at premium, you need to put less upfront, if you sell at discount, you need to put more. If you want to short, but don't want to sell, you need to put entire collateral upfront and then do what you want with your asset, same as you do now.

Same goes with closing position. It is ridiculous that you need to deposit additional funds on top of collateral to settle your debt on DEX,  or find other workarounds, because the only purpose of collateral is to be used to settle the debt. And again, the amount of collateral which you need to spend depends on the price at which you buy back you debt, cheaper you buy, less you spend. If somebody kindly sends you bitAsset for free, you just keep your collateral.
I wouldn't call this "workarounds",  better would be "not obvious". . I gues when you're closing position on polo it execute margin call.

Anyway,  it's just illusion created for "all in"  type of guys, after the "sell" balances stay the same: same debt, same collateral, same free funds. Would be cool to have that. This can be done instead current one, actually - I was wrong (again) and I see it now. The only change is ability to create fake market pressure with less funds.

Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #34 on: April 21, 2017, 12:12:29 pm »

I wouldn't call this "workarounds",  better would be "not obvious". . I gues when you're closing position on polo it execute margin call.

No, it sells your collateral at the market. You can specify the amount and price to be settled or just settle all at current market price. Margin call is triggered when collateral ratio hits the limit, same as in bitshares.

Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #35 on: April 21, 2017, 12:29:08 pm »


Let's say that I borrowed 10 bitUSD @ 100 BTS with 2000 BTS collateral and then sold it for 10x100 BTS.

  • I buy 5 bitUSD @ 84 BTS in market, half of the debt could be automatically settled - do we want to do it? How would it adjust the collateral? Proportionately or should it keed some platform-defined/user-defined collateral ratio?

If you were 10 bitUSD short and you bought back 5 bitUSD, you owe only 5 bitUSD. You want it or not does not matter, your debt is 5 bitUSD, that's the fact.

Quote
  • I want to settle half of my debt, I click "Update position" in "Margin Positions" in Bitshares wallet, enter 5 into Debt input box and click "Update positon" button. Network buys necessary assets for me at market rate and updates the collateral ratio - the same problem as in point 1.

None of these "borrow asset" or "update position" buttons are needed. Margin trading is not different from regular trading except for the amount of funds available to spend. You should be able to run a regular trading bot on margin account, which knows only "buy" and "sell" operations the same way as you run it on regular account, and exchange engine should open and close position for you when needed up to the limit defined by your margin deposit. Check polo, coinbase, bitfinex, everywhere you don't "borrow" or "update", you just buy and sell. This makes a lot of sense to me.

Edit: Oh, and you don't need to keep a separate deposit for each opened position, because it is a ratio of total equity to total dept which matters. If your MCR=2 and you are short in bitUSD and bitSilver with 2.2x collateral, and bitSilver goes up by 10%, there is no need to trigger a margin call yet, because your deposit is still enough to back both positions.

« Last Edit: April 21, 2017, 01:20:21 pm by yvv »

Offline paliboy

Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #36 on: April 21, 2017, 02:30:16 pm »
Let's say that I borrowed 10 bitUSD @ 100 BTS with 2000 BTS collateral and then sold it for 10x100 BTS.

  • I buy 5 bitUSD @ 84 BTS in market, half of the debt could be automatically settled - do we want to do it? How would it adjust the collateral? Proportionately or should it keed some platform-defined/user-defined collateral ratio?

If you were 10 bitUSD short and you bought back 5 bitUSD, you owe only 5 bitUSD. You want it or not does not matter, your debt is 5 bitUSD, that's the fact.

Yes, technically my debt would be 5 bitUSD but if I understand it correctly, it works differently right now. My account would have 5 bitUSD and 10 bitUSD debt, in the case of margin call, whole 10 bitUSD would be settled and I would still have my 5 bitUSD in my account, wouldn't I?

  • I want to settle half of my debt, I click "Update position" in "Margin Positions" in Bitshares wallet, enter 5 into Debt input box and click "Update positon" button. Network buys necessary assets for me at market rate and updates the collateral ratio - the same problem as in point 1.

None of these "borrow asset" or "update position" buttons are needed. Margin trading is not different from regular trading except for the amount of funds available to spend. You should be able to run a regular trading bot on margin account, which knows only "buy" and "sell" operations the same way as you run it on regular account, and exchange engine should open and close position for you when needed up to the limit defined by your margin deposit. Check polo, coinbase, bitfinex, everywhere you don't "borrow" or "update", you just buy and sell. This makes a lot of sense to me.

I completely agree with you that "borrow asset" and "update positon" buttons are not needed. I'm just trying to bring ideas how to improve trader's experience with minimal changes in platform itself. Your proposal suggests "normal" and "margin" accounts - I'm not sure how difficult would it be to implement.

Edit: Oh, and you don't need to keep a separate deposit for each opened position, because it is a ratio of total equity to total dept which matters. If your MCR=2 and you are short in bitUSD and bitSilver with 2.2x collateral, and bitSilver goes up by 10%, there is no need to trigger a margin call yet, because your deposit is still enough to back both positions.

 +5% I completely agree, this might be the first candidate for improvement. Would it require a hard fork? How to handle already-open positions? Could we implement it iteratively, e.g. handle collateral for bitUSD and bitCNY as one unit, it it's stable, add bitBTC, bitSILVER etc?


Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #37 on: April 21, 2017, 03:49:22 pm »

Yes, technically my debt would be 5 bitUSD but if I understand it correctly, it works differently right now. My account would have 5 bitUSD and 10 bitUSD debt, in the case of margin call, whole 10 bitUSD would be settled and I would still have my 5 bitUSD in my account, wouldn't I?

Yes, exactly. Currently, you may have 5 bitUSD short position opened and 1000 bitUSD on your balance, and you can be margin called if BTS/USD price moves. This does not make sense to me at all.

Quote
Your proposal suggests "normal" and "margin" accounts - I'm not sure how difficult would it be to implement.

Not at all. This could be the same account, but you lock a fraction of BTS into "margin deposit". This means that you can't use these BTS other way than to settle margin position. This would define how much you can go below your current balance. Suppose, you have 1000 BTS and 10 bitUSD in your account. BitUSD is falling, you want to short. You lock 1000 BTS into margin deposit, and this allows you to sell 20 bitUSD at 100 BTS/bitUSD. Now you are 10 bitUSD short, covered with 2000 BTS collateral, and you have another 1000 BTS unlocked, which you can transfer, sell, or add to margin deposit and short 10 bitUSD more. Currently, bitshares allows you to achieve the same result either by going through more steps, or by adding more funds into your account.

Quote
+5% I completely agree, this might be the first candidate for improvement. Would it require a hard fork? How to handle already-open positions? Could we implement it iteratively, e.g. handle collateral for bitUSD and bitCNY as one unit, it it's stable, add bitBTC, bitSILVER etc?

I have no idea what it would take to fix this. One thing I know for sure, that if you keep adding new features on top of old mistakes, you are going to end up with complete mess.

Offline tbone

  • Hero Member
  • *****
  • Posts: 632
    • View Profile
  • BitShares: tbone2
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #38 on: April 21, 2017, 09:32:08 pm »
You need to try margin trading at other exchanges to see how screwed is bitshares shorting. I tried shorting at poloniex last night, and now very regret that I did not try this earlier, because it makes so much more sense than shorting in BTS. At poloniex, you deposit 1 BTC, and this allows you to short 2.5 BTC worth of any assets by simply placing sell orders. When your order is filled, BTC which you got from short selling, is added to your initial deposit to back up the debt which you just created. You settle your debt by simply placing a buy order. When it is filled, your collateral is transferred to other party and your debt is settled. This is how margin trading is actually supposed to work. You deposit only 40% collateral upfront, but your position is 140% collateralized.

The guys who coded shorting in BTS clearly had no clue what are they doing. To issue bitAsset, we need to deposit a double collateral upfront, and to settle the debt we need to deposit 100% on top of double collateral. This is ridiculous and defeats the whole purpose of margin trading, which is to trade large amount with small funds. MPA is a very nice concept, which is buried under flawed implementation. Shorting is a central piece of BTS monetary system, but it is totally screwed. This has to be fixed ASAP. BTS shareholders should hire somebody who has expertise in developing trading software, pay them well through worker and let them fix shorting and all other flaws. Before this is done, don't dream about mass adoption, because other exchanges offer much cleaner products.

What a strange thread.  First of all, leverage with Poloniex is based on p2p lending.  Bitshares could offer this feature via a bond market, which has been proposed and discussed in the past but never implemented due to lack of consensus on whether and how it should be funded.  Were you not paying attention?   

Also, even if Bitshares had a bond market for leverage, that is a totally different feature than shorting on Bitshares, which is designed for the purpose of creating bitAssets.  So why are you comparing "margin trading at other exchanges to...Bitshares shorting"?  LOL.   Obviously these are 2 completely different things, each with utterly different purposes. 

Finally, in your apples to zebras comparison, you've also managed to oversimplify the process of using margin on Poloiniex.  For example, you failed to mention that you have to move funds into a special margin account, where the funds will be totally segregated from your other funds.  And once you have a margin position, the only way to get off margin is to close the position (and move funds back to the regular trading account if you just want to trade without margin).  This is far more complicated than it needs to be.  With a traditional brokerage, for example, there's no separate margin account.  Simply buying more assets than you have enough fiat funds to cover (i.e. causing your collateral ratio to go below 100%) automatically puts you on margin.  To get off margin, you just bring your collateral ratio back to 100% or more by simply closing some or all of any position(s), or by adding more fiat, or both.   

In any event, there's one thing I kind of agree with you on.  On the DEX it would be nice if your collateral ratio was calculated based on all short positions combined, not individually.  That would be easier to manage.  But doing it that way is not a total no-brainer because I can see how some people would prefer to manage collateral separately for each asset.  I imagine users could be given the choice of managing collateral combined or separately.  Another thing to consider, though, is that combined collateral would introduce some complexity when it comes to forced settlement of least collateralized positions.  Although I'm sure that could be worked out.

Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #39 on: April 21, 2017, 11:54:57 pm »
...

I am not comparing zebras and apples, I am comparing two crypto exchanges with similar set of features if you noticed. And this comparison is not in favor of bitshares, particularly in margin trading part. I am not talking about bond market, I am talking about bitAsset, which are issued through shorting, which is trading on margin.  If forex brokers do margin trading even better than poloniex, this does not make bitshares shorting look any better. And don't tell me that this is because DEX is so special, that you can't do shorting a sane way, I don't buy this. Could you give a reasonable explanation, why you need to deposit almost 200% collateral upfront, before you short sell? And why do you need to deposit additional 100% on top of 200% collateral to close the position? May be I am wrong and there is such necessity, but I would like see a reasoning.

Offline svk

Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #40 on: April 22, 2017, 07:44:53 am »
You have to remember that unlike Poloniex bitshares is a blockchain based exchange which imposes some limitations on what is feasible in terms of performance.

Most if not all the changes you're talking about here would require a hard fork, but I can't judge if they're even technically possible.

One idea that I like is being able to close your position by using the collateral you've already set aside, I suspect the reason for that is the lack or market orders. However, that could be worked around by an operation that placed a limit order with a high enough price that it would just walk the orderbook. It would need to be a fill-or-kill order so that it fails of it can't get filled completely.
Worker: dev.bitsharesblocks

Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #41 on: April 22, 2017, 04:36:22 pm »
You have to remember that unlike Poloniex bitshares is a blockchain based exchange which imposes some limitations on what is feasible in terms of performance.

Most if not all the changes you're talking about here would require a hard fork, but I can't judge if they're even technically possible.

Everybody keep saying that decentralization imposes this and that limitations. If it is so limited, why do we need decentralization at all? Imo, most of these "limitation" is just lack of competence.

Quote
One idea that I like is being able to close your position by using the collateral you've already set aside, I suspect the reason for that is the lack or market orders. However, that could be worked around by an operation that placed a limit order with a high enough price that it would just walk the orderbook. It would need to be a fill-or-kill order so that it fails of it can't get filled completely.

Here is a constructive talking. And why should it be fill-or-kill? You are 10 bitUSD short, you have enough collateral to buy up to collateral_ratio*call_price, you place a limit order to buy 10 bitUSD, you buy 1 bitUSD, you are 9 bitUSD short now, and you have 9 bitUSD buy order at same price.  What is wrong with that? As long as you collateral ratio stays  above MCR, you are safe, you can do whatever you want, borrow, settle, whatever .

Offline nmywn

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #42 on: April 22, 2017, 08:12:29 pm »
[member=40079]yvv[/member] because he's thinking how to improve user experience through automation in GUI , not about changing contract design. If order is not filled and market moves wrong direction then you have margin call.




Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #43 on: April 22, 2017, 09:27:37 pm »
[member=40079]yvv[/member] because he's thinking how to improve user experience through automation in GUI , not about changing contract design. If order is not filled and market moves wrong direction then you have margin call.

This is exactly a problem which automation should solve. It should close all  margin orders when a margin call is triggered. Why do you want to close them before?

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Re: Bitshares shorting is flawed and needs to be fixed ASAP
« Reply #44 on: April 23, 2017, 08:03:26 am »
[member=40079]yvv[/member] because he's thinking how to improve user experience through automation in GUI , not about changing contract design. If order is not filled and market moves wrong direction then you have margin call.

This is exactly a problem which automation should solve. It should close all  margin orders when a margin call is triggered. Why do you want to close them before?

Margin calls execute at 10% above the price feed, i. e. the shorter is punished for not managing his position properly.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de