From cfde51d6219a532b13bd5c3978cebda86fe1c138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Mon, 30 Sep 2019 10:36:27 +0200 Subject: [PATCH 01/13] Incorporate core changes to allow for threshhold price --- bsip-0071.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index 27f2d16..42bcb1a 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -9,7 +9,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. If addition, this BSIP allows the witnesses to define an optional threshold price to prevent external market manipulation. # Motivation @@ -27,6 +27,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. 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: @@ -57,16 +59,18 @@ 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*. While *threshold price* is fed by witnesses in addition to the usual feed price (same mechanics in finding consensus on price), the remaining two shall be calculated as: ``` -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 + settlement price = max(FP_M * (1 - settlement_offset), P_gs, floor price) + call execution price = max(FP_M * (1 + MSSR), P_gs, floor price) else settlement price = FP_M * (1 - settlement_offset) call execution price = FP_M * (1 + MSSR) @@ -86,6 +90,7 @@ FPM is still used for determining if a debt position is margin called - [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) +- [Threshold for price feeds through voting](https://github.com/bitshares/bsips/blob/master/bsip-0076.md) # Discussion From 544769889f0e1eb50bc8125928adc028bc794782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Mon, 30 Sep 2019 11:04:41 +0200 Subject: [PATCH 02/13] Update bsip-0071.md --- bsip-0071.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsip-0071.md b/bsip-0071.md index 42bcb1a..b1043f2 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -1,5 +1,5 @@ BSIP: 71 - Title: Add "Prevent Global Settlement" Flag for Smartcoin + Title: Add "Prevent Global Settlement and External Attacks" Flag for Smartcoin Authors: Jerry Liu bitcrab@qq.com Status: Draft Type: Protocol From 626e8a61e9c7b165dc8b3f950ad8a2e92f619885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Mon, 30 Sep 2019 13:46:13 +0200 Subject: [PATCH 03/13] threshhold price as asset owner bitasset option --- bsip-0071.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index b1043f2..a84414f 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -9,7 +9,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. If addition, this BSIP allows the witnesses to define an optional threshold price to prevent external market manipulation. +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. If addition, this BSIP allows the asset owner to define an optional threshold price to prevent external market manipulation. # Motivation @@ -65,18 +65,18 @@ The "Prevent Global Settlement" solution adopts a new idea to handle bad debt: w Add one flag "Prevent Global Settlement and External Attacks" to each smartcoin asset. -Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. While *threshold price* is fed by witnesses in addition to the usual feed price (same mechanics in finding consensus on price), the remaining two shall be calculated as: +Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. While *threshold price* is defeined by the asset owner as bitasset option. The remaining two shall be calculated as: ``` if flag "Prevent Global Settlement and External Attacks" is enabled - settlement price = max(FP_M * (1 - settlement_offset), P_gs, floor price) - call execution price = max(FP_M * (1 + MSSR), P_gs, floor price) + 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 *FPM* 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 *FPM* 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, Pgs 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, Pgs is likely to change. The resulting new *call execution price* will be used when settling against the next debt position. @@ -106,9 +106,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 FPM × 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 -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. 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 From 5d979b21e11789b3c1add3c00e3a5a9472d1902a Mon Sep 17 00:00:00 2001 From: Abit Date: Mon, 30 Sep 2019 21:24:07 +0200 Subject: [PATCH 04/13] Update wording and fix typo --- bsip-0071.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index a84414f..e301a0c 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -1,6 +1,7 @@ BSIP: 71 Title: Add "Prevent Global Settlement and External Attacks" Flag for Smartcoin Authors: Jerry Liu bitcrab@qq.com + Stefan Schießl stefan.schiessl@blockchainprojectsbv.com Status: Draft Type: Protocol Created: 2019-07-02 @@ -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. If addition, this BSIP allows the asset owner to define an optional threshold price to prevent external market manipulation. +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 @@ -27,7 +28,7 @@ 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. This floor price is to be [decided by voting through BSIP-76](https://github.com/bitshares/bsips/blob/master/bsip-0076.md). +[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 @@ -65,7 +66,7 @@ The "Prevent Global Settlement" solution adopts a new idea to handle bad debt: w Add one flag "Prevent Global Settlement and External Attacks" to each smartcoin asset. -Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. While *threshold price* is defeined by the asset owner as bitasset option. The remaining two shall be calculated as: +Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. The remaining two shall be calculated as: ``` if flag "Prevent Global Settlement and External Attacks" is enabled @@ -88,8 +89,8 @@ FPM 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 @@ -115,7 +116,7 @@ holdings of the SmartCoin in question. This procedure needs precise definition i # Summary for Shareholders -It is important to eliminate concerns about global settlement. 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. +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 From 171fd7697fed247f89fe2922579140e84f1674cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Fri, 4 Oct 2019 09:29:11 +0200 Subject: [PATCH 05/13] add spec for threshold price --- bsip-0071.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsip-0071.md b/bsip-0071.md index e301a0c..c1eebfe 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -66,7 +66,7 @@ The "Prevent Global Settlement" solution adopts a new idea to handle bad debt: w Add one flag "Prevent Global Settlement and External Attacks" to each smartcoin asset. -Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. The remaining two shall be calculated as: +Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. While the *threshold price* is a new BitAsset option and defined by the asset owner, the remaining two shall be calculated as: ``` if flag "Prevent Global Settlement and External Attacks" is enabled From e9cbe1f14974330a9e4b68e5cfec6fc0e651db59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Fri, 4 Oct 2019 09:34:35 +0200 Subject: [PATCH 06/13] reformatted --- bsip-0071.md | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index c1eebfe..55064c4 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -54,11 +54,17 @@ In my view, a good way to handle bad debt need to follow below principles: In above mentioned 5 solutions, only "5. Prevent Global Settlement" fulfills all 3 principles. -Partial GS is another attractive solution: it is similar to Global Settlement but differs in that (a) only takes over the bad debt positions and moves them to a settlement pool without touching the debt positions with CR>1, and (b) users can issue force settlement from the pool, from the margin call orders, or from the good debt position depending on which has the lowest CR. +Partial GS is another attractive solution: it is similar to Global Settlement but differs in that +(a) only takes over the bad debt positions and moves them to a settlement pool without touching the debt positions with CR>1, and +(b) users can issue force settlement from the pool, from the margin call orders, or from the good debt position +depending on which has the lowest CR. The problem of Partial GS is that it does not resolve itself automatically when the price recovers. -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. +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. @@ -77,11 +83,20 @@ else call execution price = FP_M * (1 + MSSR) ``` -where *FPM* 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, Pgs 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, Pgs is likely to change. The resulting new *call execution price* will be used when settling against the next debt position. -FPM is still used for determining if a debt position is margin called, as before, at FPM × (1 + [MCR](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset.hpp#L189-L190)). +where *FPM* 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, Pgs 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, Pgs is likely to change. +The resulting new *call execution price* will be used when settling against the next debt position. +FPM is still used for determining if a debt position is margin called, as before, at FPM × +(1 + [MCR](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset.hpp#L189-L190)). **Note:** when comparing prices, `max` is to be understood in terms of debt %div; collateral. @@ -97,15 +112,24 @@ FPM is still used for determining if a debt position is margin called ## settlement_price / feed_price -Some may perceive it as confusing or unfair that borrowing and force settlement may refer to different prices. However, in a period where the least collateralized short position has insufficient collateral in terms of FP_m, it would be dangerous to use the resulting settlement_price for borrowing as well, because that would allow creation of short positions that are undercollateralized from the start. +Some may perceive it as confusing or unfair that borrowing and force settlement may refer to different prices. +However, in a period where the least collateralized short position has insufficient collateral in terms of FP_m, +it would be dangerous to use the resulting settlement_price for borrowing as well, because that would allow creation +of short positions that are undercollateralized from the start. ## Least collateralized short Two variants for the *call execution price* have been discussed. -Variant A (as specified here) prefers to match the bad debt positions first, hoping that this way the bad debt will be resolved quickly. This also means that if Pgs moves away from the market price, **no** margin calls will be filled, not even those with a collateral ratio that would allow them being matched with market orders. This can lead to more bad debt piling up instead of resolving at least some debt positions through margin calls. +Variant A (as specified here) prefers to match the bad debt positions first, hoping that this way the bad debt will +be resolved quickly. This also means that if Pgs moves away from the market price, **no** margin calls will +be filled, not even those with a collateral ratio that would allow them being matched with market orders. +This can lead to more bad debt piling up instead of resolving at least some debt positions through margin calls. -Variant B would have let bad debt positions matched at their own collateral ratio while matching other margin calls as before at FPM × 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. +Variant B would have let bad debt positions matched at their own collateral ratio while matching other margin calls +as before at FPM × 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 @@ -116,7 +140,9 @@ holdings of the SmartCoin in question. This procedure needs precise definition i # Summary for Shareholders -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. +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 From e434d6f6627075ae6206f7f88c4776f65838fddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Fri, 4 Oct 2019 09:35:21 +0200 Subject: [PATCH 07/13] =?UTF-8?q?=C3=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsip-0071.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsip-0071.md b/bsip-0071.md index 55064c4..d8eb341 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -98,7 +98,7 @@ The resulting new *call execution price* will be used when settling against the FPM is still used for determining if a debt position is margin called, as before, at FPM × (1 + [MCR](https://github.com/bitshares/bitshares-core/blob/e8567d0425ec27d29036a9a9178df5afd8ca6f25/libraries/protocol/include/graphene/protocol/asset.hpp#L189-L190)). -**Note:** when comparing prices, `max` is to be understood in terms of debt %div; collateral. +**Note:** when comparing prices, `max` is to be understood in terms of debt divided by collateral. # References From beb1e36c9ec44b1650c37082414654516de3e7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Fri, 4 Oct 2019 09:37:51 +0200 Subject: [PATCH 08/13] Update bsip-0071.md --- bsip-0071.md | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index d8eb341..45f206d 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -10,25 +10,43 @@ # 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. In addition, this BSIP allows the asset owner to define an optional threshold price to prevent external market manipulation. +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 -BitShares has a mechanism to handle debt positions whose collateral is valued less than the debt itself ("bad debt"). This mechanism is called global settlement ("black swan") and is triggered when the published feed price (FP) is less than or equal to the product of the global settlement price (Pgs) and the maximum short-squeeze ratio (MSSR). +BitShares has a mechanism to handle debt positions whose collateral is valued less than the debt itself ("bad debt"). +This mechanism is called global settlement ("black swan") and is triggered when the published feed price (FP) is less +than or equal to the product of the global settlement price (Pgs) and the maximum short-squeeze ratio (MSSR). FP ≤ Pgs × MSSR If this does occur it means that the collateral ratio (CR) of at least one debt position is less than the MSSR. -Global settlement is not a good way to handle bad debt, as can be seen to what happened to bitUSD. After global settlement was triggered for bitUSD in December 2018: +Global settlement is not a good way to handle bad debt, as can be seen to what happened to bitUSD. +After global settlement was triggered for bitUSD in December 2018: - traders could no longer borrow bitUSD; - the price of bitUSD dropped below USD because of insufficient collateral; and, - it will take a long time for bitUSD to be revived. -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. +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). +[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 @@ -42,9 +60,12 @@ We now have several choices on handling bad debt: We need to do a deep review on bad debt before evaluating above solutions. -Bad debt means in some debt positions the debt cannot be fully paid by selling the collaterals via margin call/force settlement at the market price. In other words, the relevant smartcoin loses sufficient collateral to back the value and will possibly devalue. +Bad debt means in some debt positions the debt cannot be fully paid by selling the collaterals via margin +call/force settlement at the market price. In other words, the relevant smartcoin loses sufficient collateral +to back the value and will possibly devalue. -At this moment, the system should accept the fact that the smartcoin will possibly devalue, find ways to minimize the impact to different parties in the market and the time to revive. +At this moment, the system should accept the fact that the smartcoin will possibly devalue, +find ways to minimize the impact to different parties in the market and the time to revive. In my view, a good way to handle bad debt need to follow below principles: @@ -55,7 +76,8 @@ In my view, a good way to handle bad debt need to follow below principles: In above mentioned 5 solutions, only "5. Prevent Global Settlement" fulfills all 3 principles. Partial GS is another attractive solution: it is similar to Global Settlement but differs in that -(a) only takes over the bad debt positions and moves them to a settlement pool without touching the debt positions with CR>1, and +(a) only takes over the bad debt positions and moves them to a settlement pool without touching the debt +positions with CR>1, and (b) users can issue force settlement from the pool, from the margin call orders, or from the good debt position depending on which has the lowest CR. @@ -66,13 +88,13 @@ while bad debt appears, the smartcoin will be devaluated at a ratio of the lowes 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 and External Attacks" to each smartcoin asset. -Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. While the *threshold price* is a new BitAsset option and defined by the asset owner, the remaining two shall be calculated as: +Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. +While the *threshold price* is a new BitAsset option and defined by the asset owner, +the remaining two shall be calculated as: ``` if flag "Prevent Global Settlement and External Attacks" is enabled From 07e7cf168dee961eaf0ca1adf7d0b71446624c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Fri, 4 Oct 2019 10:34:31 +0200 Subject: [PATCH 09/13] add voting power reduction --- bsip-0071.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index 45f206d..aa483cc 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -90,9 +90,13 @@ will all switch to refer to GS price to ensure the continuity and fairness of al # Specifications -Add one flag "Prevent Global Settlement and External Attacks" to each smartcoin asset. +#### Add flags "Prevent Global Settlement" and "Set Threshhold price" to each smartcoin asset. + +Those flags are set by the asset owner, and come with their respective permission like all others. +Default values + +#### Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. -Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. While the *threshold price* is a new BitAsset option and defined by the asset owner, the remaining two shall be calculated as: @@ -122,6 +126,10 @@ FPM is still used for determining if a debt position is margin called **Note:** when comparing prices, `max` is to be understood in terms of debt divided by collateral. +#### Adjustment to voting power + +The voting power for BTS backed SmartCoins added to the owner of a margin position is reduced. Only the exccess collateral counts as voting power. Example: If a position has CR 1.8, the voting power from this position only counts the BTS that represent the excess of 0.8. Reasoning for this is given in the section Discussion / Voting power. + # References - [New mechanism to handle bad debt (black swan)](https://bitsharestalk.org/index.php?topic=27273.0) @@ -160,6 +168,27 @@ future extension is to let asset **holders** have a say in the threshhold price 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. +## Voting power + +As of right now, a SmartCoin that has BTS as its collateral provides the full amount of collateral as voting power. +This is not considered to be fair since it is borrowed voting power and gives incentives to squeeze out as much as +possible from a margin position to increase voting weight (borrow, sell bitasset on market, borrow more, and so on). +This is adressed by adjusting voting power of a position, and the suggested solution ensures that the voting power of +a margin position holders remains unchanged, with the assumption that he sells the newly borrowed bitasset on the +respective BTS market. + +# Impacts and Risks + + - If the Global Settlement prevention is enabled, the SmartCoin holders lose the ability to instantly settle after a + Global Settlement would have occured, and are forced to use the open market if they want to avoid holding a + SmartCoin that is eventually undercollaterized + + - If the Threshhold price is enabled, the promise of being able to settle for equivalent value of the collateral SmartCoin holders are extradited to the asset's owner ability to set it, with the direct implication on the force settlement price. The Threshhold price is defined to prevent external market manipulation, but ultimately the asset owner may use any justification for setting the threshold. + + - If the Threshhold is set, conflict of interest exists if the asset owner is also borrowing the asset into existence + + - If the Threshhold price is set, margin positions creators essentially have a call price limit that they can set in order to avoid ever being margin called. This means the position carries no risk for the margin position holder anymore, which can be seen as incentive to borrow as much as possible without considering the consequences. This is the reason to adjust the voting weight of a BitAsset position + # Summary for Shareholders It is important to eliminate concerns about global settlement and market manipulation. This is currently achieved with From 99375bf2999d3052da273a8150e435ab71e8752e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Fri, 4 Oct 2019 10:44:01 +0200 Subject: [PATCH 10/13] refine summary --- bsip-0071.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bsip-0071.md b/bsip-0071.md index aa483cc..9d1f081 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -194,6 +194,7 @@ respective BTS market. 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. +For BTS backed SmartCoins, the voting power of margin positions is adjusted to reflect the actually underlying voting power. # Copyright From 24d4235e4d4feb45c228b4155026c8f1b6f3b8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Mon, 7 Oct 2019 11:59:32 +0200 Subject: [PATCH 11/13] add default comment --- bsip-0071.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index 9d1f081..ca5a4b8 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -93,7 +93,7 @@ will all switch to refer to GS price to ensure the continuity and fairness of al #### Add flags "Prevent Global Settlement" and "Set Threshhold price" to each smartcoin asset. Those flags are set by the asset owner, and come with their respective permission like all others. -Default values +As default, both flags are deactivated while the permission is on. #### Introduce new parameters: *threshold price*, *settlement price* and *call execution price*. @@ -113,7 +113,7 @@ where *FPM* is the median of the prices published by price feeders, * [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. +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, Pgs is likely to change. From da0b034056928dc2be2939cedff1d805a259d3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Mon, 14 Oct 2019 08:47:31 +0200 Subject: [PATCH 12/13] unchanged voting power --- bsip-0071.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bsip-0071.md b/bsip-0071.md index ca5a4b8..bbfab4d 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -174,8 +174,7 @@ As of right now, a SmartCoin that has BTS as its collateral provides the full am This is not considered to be fair since it is borrowed voting power and gives incentives to squeeze out as much as possible from a margin position to increase voting weight (borrow, sell bitasset on market, borrow more, and so on). This is adressed by adjusting voting power of a position, and the suggested solution ensures that the voting power of -a margin position holders remains unchanged, with the assumption that he sells the newly borrowed bitasset on the -respective BTS market. +a margin position holders remains unchanged as compared to before the creation of the margin position, with the assumption that he sells the newly borrowed bitasset on the respective BTS market. # Impacts and Risks From d66a54fecca5c319e46b7e0ddcd221af8557aac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Mon, 14 Oct 2019 08:54:25 +0200 Subject: [PATCH 13/13] refine calculation section --- bsip-0071.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bsip-0071.md b/bsip-0071.md index bbfab4d..7de641a 100644 --- a/bsip-0071.md +++ b/bsip-0071.md @@ -101,9 +101,15 @@ While the *threshold price* is a new BitAsset option and defined by the asset ow the remaining two shall be calculated as: ``` -if flag "Prevent Global Settlement and External Attacks" is enabled +if flag "Prevent Global Settlement" and "Set Threshhold price" is enabled 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 if "Prevent Global Settlement" + settlement price = max(FP_M * (1 - settlement_offset), P_gs) + call execution price = max(FP_M * (1 + MSSR), P_gs) +else if "Set Threshhold price" + settlement price = max(FP_M * (1 - settlement_offset), threshold price) + call execution price = max(FP_M * (1 + MSSR), threshold price) else settlement price = FP_M * (1 - settlement_offset) call execution price = FP_M * (1 + MSSR)