bitshares / bsips

BitShares Improvement Proposals and Protocols. These technical documents describe the process of updating and improving the BitShares blockchain and technical ecosystem.
https://bitshares.github.io
63 stars 86 forks source link

BSIP62: Close Margin Position #211

Closed bitcrab closed 5 years ago

ryanRfox commented 5 years ago

Please add the Issue to the Discussion heading: https://github.com/bitshares/bsips/issues/156

sschiessl-bcp commented 5 years ago

@abitmore @bitcrab

from the mechanics, would it make sense to additionally allow that the user defines "sell X of the collateral, and set the price dynamically (like a real margin position) Y% below feed price (Y > 0)"?

abitmore commented 5 years ago

@sschiessl-bcp a dynamic price or a user-defined MSSR is "good to have" to me, but I think it would complicate the implementation (see also #51).

sschiessl-bcp commented 5 years ago

@sschiessl-bcp a dynamic price or a user-defined MSSR is "good to have" to me, but I think it would complicate the implementation (see also #51).

I would like to include it in this BSIP, with a note to postpone it to the second next protocol upgrade. Feasible or weird? For me personally, dynamic price makes the most sense.

abitmore commented 5 years ago

No creation fee refund when the order is cancelled.

The order should be cancelled automatically if the asset is globally settled.

The order should be cancelled automatically if the position is manually closed.

The order should be cancelled automatically when remaining collateral in the position is less than the amount selling in the order.

What if the order is asking for more than its debt, due to margin called or debt position updated?

Will the order has an expiration too? And what about fill_or_kill?

sschiessl-bcp commented 5 years ago

All comments up till now have been addressed, resolved where possible. Please have a look!

sschiessl-bcp commented 5 years ago

Considering the mentioned edge cases I am still wondering if it would not be easier to merely re-use existing margin call logic.

Either way, I have added it to the BSIP

abitmore commented 5 years ago

merely re-use existing margin call logic.

It looks like that we can reuse the logic, but not that simple when coding. I agree to add it to the BSIP though, if it's too hard to efficiently implement it , we can leave it out in the first release.

sschiessl-bcp commented 5 years ago

@abitmore please approve if you agree this is ready for voting.

shulthz commented 4 years ago

If want BSIP62 to become really useful? It must charge the MCFR fees++Liquidity penalty 1%; #164

If someone want to use BSIP62, the system will charge the MCFR fees ++Liquidity penalty 1% from the user;

shulthz commented 4 years ago

If this BSIP didn't charge fees like BSIP74, it will become very foolish like before. Market will prove it in the future.

sschiessl-bcp commented 4 years ago

I see no reason not too include it as well, can be added to BSIP74 specification.

shulthz commented 4 years ago

I see no reason not too include it as well, can be added to BSIP74 specification.

Maybe. But this BSIP is very different with BSIP74, in some case, they are against, i think BSIP62 not only need MCFR fees, but also need some Liquidity penalty fee, as BSIP62 consume the depth and liquidity of BSIP74 advance. If no margin call in the market, nobody want to use it, if somebody want to use it, that's mean there will have a quick market volatility, he want to close his position in the market quickly, that's mean he will consume the depth and liquidity of the market advance, other margin call will not have enough liquidity and depth, if he can't close his position all, he will make a lower price than margin call price make sure the market can consume it all, that's very dangerous.

BSIP74 should have a function of share fees, as this, the Liquidity penalty fee of BSIP62 must adapt with the proportion of share fees.

BSIP62 fees will be: MCFR quantity (1+share proportion),

e.g.

if BSIP74: MSSR=1.10, MCFR=0.10, share proportion=20%,

so BSIP62 fees will be: MCFR quantity (1+0.2)

BOB in BSIP74, will sell 100 bts out, and pay 10 bts fees, share 2 bts to the buyer, system got 8 bts.

BOS in BSIP60, will sell 100 bts out, and pay 12 bts fees, system will get 12 bts.

Thank you.