Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSIP71 - Change Request: Incorporate core changes necessary for BSIP-0076 to allow a threshhold price #224

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
35 changes: 24 additions & 11 deletions bsip-0071.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BSIP: 71
Title: Add "Prevent Global Settlement" Flag for Smartcoin
Title: Add "Prevent Global Settlement and External Attacks" Flag for Smartcoin
Authors: Jerry Liu [email protected]
Stefan Schießl [email protected]
Status: Draft
Type: Protocol
Created: 2019-07-02
Expand All @@ -9,7 +10,7 @@

# Abstract

This BSIP proposes a new solution to handle bad debt: the core idea is, while bad debt appears, the system does not take over the bad debt positions; instead, it accepts the smartcoin devaluation caused by bad debt and it lets borrowing, margin call, and force settlement all operate referring to the BTS/devaluated smartcoin price. This solution avoids any global/partial settlement, and keeps the borrowing, margin calls and force settlement features to continue and allow the market to decide how to finally remove bad debt, either by BTS price restoration or by debt position adjustment/ margin call order filling/force settlement.
This BSIP proposes a new solution to handle bad debt: the core idea is, while bad debt appears, the system does not take over the bad debt positions; instead, it accepts the smartcoin devaluation caused by bad debt and it lets borrowing, margin call, and force settlement all operate referring to the BTS/devaluated smartcoin price. This solution avoids any global/partial settlement, and keeps the borrowing, margin calls and force settlement features to continue and allow the market to decide how to finally remove bad debt, either by BTS price restoration or by debt position adjustment/ margin call order filling/force settlement. In addition, this BSIP allows the asset owner to define an optional threshold price to prevent external market manipulation.

# Motivation

Expand All @@ -27,6 +28,8 @@ Global settlement is not a good way to handle bad debt, as can be seen to what h

The community has had extensive discussions about how to handle the bad debt in a better way in the future. However an easy way, [BSIP58](https://github.com/bitshares/bsips/blob/master/bsip-0058.md), has been implemented for smartcoins like bitCNY and bitUSD; it has worked successfully to prevent GS from happening with no other obvious impact. However, BSIP58 has some issues - it is suspected of market manipulation and it risks witnesses independence. Moving forward, this BSIP will be built based on BSIP58 and eliminate all its disadvantages.

[Shorting attacks and fake volume](https://bitsharestalk.org/index.php?topic=29635.0) have presumably caused massive price fluctuations which created the desire to define an optional threshold price in addition to the Global Settlement protection, which will act as a floor price. For committee-owned assets, this floor price is to be [decided by voting through BSIP-76](https://github.com/bitshares/bsips/blob/master/bsip-0076.md).

# Rationale

We now have several choices on handling bad debt:
Expand Down Expand Up @@ -57,22 +60,24 @@ The problem of Partial GS is that it does not resolve itself automatically when

The "Prevent Global Settlement" solution adopts a new idea to handle bad debt: while bad debt appears, the smartcoin will be devaluated at a ratio of the lowest CR from among the bad debt positions, yet all the smartcoin trading features, including borrowing, margin call and force settlement, will all switch to refer to GS price to ensure the continuity and fairness of all the features.



# Specifications

Add one flag "Prevent Global Settlement" to each smartcoin asset.
Add one flag "Prevent Global Settlement and External Attacks" to each smartcoin asset.

Introduce new parameters: *settlement price* and *call execution price*. They shall be calculated as:
Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. The remaining two shall be calculated as:
sschiessl-bcp marked this conversation as resolved.
Show resolved Hide resolved

```
if flag "Prevent Global Settlement" is enabled
settlement price = max(FP_M * (1 - settlement_offset), P_gs)
call execution price = max(FP_M * (1 + MSSR), P_gs)
if flag "Prevent Global Settlement and External Attacks" is enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add flags "Prevent Global Settlement"
flag "Prevent Global Settlement and External Attacks"

Which is the final name for the flag?

settlement price = max(FP_M * (1 - settlement_offset), P_gs, threshold price)
call execution price = max(FP_M * (1 + MSSR), P_gs, threshold price)
else
settlement price = FP_M * (1 - settlement_offset)
call execution price = FP_M * (1 + MSSR)
```

where *FP<sub>M</sub>* is the median of the prices published by witnesses, *MSSR* is the [maximum short-squeeze ratio](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset.hpp#L192-L193) and *settlement offset* is the [force settlement offset](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset_ops.hpp#L105-L106); witnesses should always feed the real market price.
where *FP<sub>M</sub>* is the median of the prices published by price feeders, *MSSR* is the [maximum short-squeeze ratio](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset.hpp#L192-L193) and *settlement offset* is the [force settlement offset](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset_ops.hpp#L105-L106); price feeders should always feed the real external market price.

The *settlement price* is the price that is used when executing forced settlements. Note that when a large forced settlement fills up a debt position completely, P<sub>gs</sub> is likely to change. The resulting new *settlement price* will be used when settling against the next debt position.
The *call execution price* is the price that is used when matching margin calls against limit orders or settlement requests. Again, when a large match fills up a debt position completely, P<sub>gs</sub> is likely to change. The resulting new *call execution price* will be used when settling against the next debt position.
Expand All @@ -84,8 +89,9 @@ FP<sub>M</sub> is still used for determining if a debt position is margin called

- [New mechanism to handle bad debt (black swan)](https://bitsharestalk.org/index.php?topic=27273.0)
- [New BSIP:GS protection via core code](https://bitsharestalk.org/index.php?topic=28681.0)
- [New BSIP: Add "Prevent Global Settlement" Flag for Smartcoin (old title: Global Settlement Protection via core code)](#179)
- [New BSIP: Add "Prevent Global Settlement" Flag for Smartcoin](#193)
- [New BSIP: Add "Prevent Global Settlement" Flag for Smartcoin (old title: Global Settlement Protection via core code)](https://github.com/bitshares/bsips/pull/179)
- [New BSIP: Add "Prevent Global Settlement" Flag for Smartcoin](https://github.com/bitshares/bsips/pull/193)
- [Threshold for price feeds through voting](https://github.com/bitshares/bsips/blob/master/bsip-0076.md)

# Discussion

Expand All @@ -101,9 +107,16 @@ Variant A (as specified here) prefers to match the bad debt positions first, hop

Variant B would have let bad debt positions matched at their own collateral ratio while matching other margin calls as before at FP<sub>M</sub> &times; MSSR, hoping to improve the overall collateralization. This also means that debt positions with better collateral ratio would have been preferred over bad debt, meaning that bad debt positions will remain sitting on the market for a longer time.

## The threshhold price

With this BSIP the threshhold price is defined by the asset owner. This may not be considered fair. A suitable
future extension is to let asset **holders** have a say in the threshhold price discovery. This could be done by
introducing a voting procedures where holders of the SmartCoin can participate, with their voting weight reflecting their
holdings of the SmartCoin in question. This procedure needs precise definition in a new BSIP.

# Summary for Shareholders
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impact on smartcoin, debt & bts holders?


It is important to eliminate concerns about global settlement. This is currently achieved with the technical options that are available to the witnesses. A more advanced solution as proposed here is needed.
It is important to eliminate concerns about global settlement and market manipulation. This is currently achieved with the technical options that are available to the price feeders (i.e. the witnesses for BitASsets like bitCNY). A more advanced solution as proposed here is needed that allows the price feeders to feed the real external market price.

# Copyright

Expand Down