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.
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?