New BSIP: Call Order Options (Stop-Loss and etc)
- Dominant language
- No language data
- Stars
- 59
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
Just write some thoughts here, perhaps will make a detailed BSIP later. People who have interest can help compose as well.
After https://github.com/bitshares/bitshares-core/issues/343 is fixed, call price of call orders (short positions) will be updated after every match, in favor of consistent margin call process logic and black swan detection. But some traders DO NOT want this behavior, for stop-loss purpose for example.
Here we propose some new options that traders can set onto their call positions:
* [x] target CR: an optional collateral ratio, when the position being automatically liquidized, sell no more than required collateral until CR of the position reaches this value.
* default: not set, which means sell as much collateral as possible (same to current behavior)
* [ ] stop-loss price: an optional price to release (sell) collateral automatically when feed_price is below it (in terms of collateral/debt), the behavior will be placing some collateral on market for sale, at the price equals to `feed_price/MSSR`, until target CR is reached. (Note: MSSR is a ratio greater than `1`)
* default: not set, which means will sell collateral only when CR < MCR (same to current behavior)
* [ ] take-profit price: an optional price to release (sell) collateral automatically when feed_price is above it (in terms of collateral/debt), the behavior will be placing some collateral on market for sale at the specified price to repay the whole debt (capped by debt amount).
* default: not set, which means never take profit automatically (same to current behavior)
Assuming feed_price is in terms of debt / collateral, e.g. how much CNY per BTS
```
target_CR = new_collateral / ( new_debt / feed_price )
= ( collateral - amount_to_sell ) * feed_price / ( debt - amount_to_get )
= ( collateral - amount_to_sell ) * feed_price / ( debt - amount_to_sell * (feed_price / MSSR) )
=>
amount_to_sell = (debt * target_CR - collateral * feed_price) * MSSR / (target_CR - MSSR) / feed_price
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the referenced bitshares-core issue 343 and the existing BSIP process in this repository. The issue is still a collection of proposed options rather than a defined change, so completion would require a settled specification, agreed behavior, and an accepted detailed BSIP.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blockchain
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100