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

BSIP71: Add "Prevent Global Settlement" Flag for Smartcoin (old title: Global Settlement Protection via core code) #179

Closed bitcrab closed 1 year ago

bitcrab commented 5 years ago

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.

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

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:

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

Rationale

We now have several choices on handling bad debt:

  1. Global Settlement
  2. Global Settlement Protection via Price Feeding
  3. Convert Bad Debt Positions to Limit Orders
  4. Take Over only Under-Collateralized Debt Positions without GS (aka Partial GS)
  5. Prevent Global Settlement

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.

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:

  1. Do not punish good traders who have managed to maintain their collateral ratio well.
  2. Do not stop the smartcoin features, including borrowing, margin call and force settlement, and all these operations should refer to the same price.
  3. Ensure the debt positions/margin call orders be settled in the order from lower CR to higher CR.

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.

The problem of Partial GS is that borrowing and force settlement may refer to different prices which will lead to obvious confusion and unfairness.

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.

Introduce a new parameter: settlement price. Its value shall be calculated as:

if flag "Prevent Global Settlement" is enabled
    setlement price =  max(FP_M, P_gs)
else
    settlement price =  FP_M

where FPM is the median of the prices published by witnesses; witnesses should always feed the real market price.

All calculations of debt position collateral ratios and trading price determinations in borrowing, margin call and force settlement shall refer to the settlement price instead of directly to the feed price.

Potential Risks

References

Discussion

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.

Copyright

This document is placed in the public domain.

bangzi1001 commented 4 years ago

I agree asset owners should able to enable Global Settlement Protection for their assets.

At this moment, BitCNY and BitUSD Global Settlement Protection are done by witnesses in their price feed script but due to high turnover of witnesses, nobody can ensure after 1-2 years how many new witnesses enable Global Settlement Protection in their price feed script.

abitmore commented 4 years ago

A related discussion is here: https://bitsharestalk.org/index.php?topic=27273.0

abitmore commented 4 years ago

FWIW earlier discussions about BSIP58: https://github.com/bitshares/bsips/issues/135

clockworkgr commented 4 years ago

Completely disagree. Not even sure how this is even a discussion.

matle85 commented 4 years ago

GS protection completely undermines how the assets are meant to work.

Disagree.

CryptickCryptick1 commented 4 years ago

For context and understanding of the prior global settlements I would like to share the 20 plus page article I wrote for last global settlement. While not directly having all the answers, I think this pulls a few noteworthy ideas into the discussion. https://www.dexbot.info/2019/05/21/understanding-trading-activity-and-potential-causes-of-bitasset-settlement/

abitmore commented 4 years ago

The basic idea of this issue is that we should not punish the good traders who are maintaining their collateral ratio well (E.G. always above 175% even 200%).

Actually there are 3 topics (questions) here:

  1. whether to punish good traders who have managed to maintain their collateral ratio well
  2. whether the system would take over positions of traders who have failed to maintain their collateral ratio up to a level (I don't say this is a punishment since some traders may just want it)
  3. protect debt asset holders to what level when there appears a debt position with CR below 100%

The original GS rule

Answers to the questions:

  1. Question: whether to punish good traders who have managed to maintain their collateral ratio well? Answer: yes
  2. Question: whether the system would take over positions of traders who have failed to maintain their collateral ratio up to a level? Answer: yes
  3. Question: protect debt asset holders to what level when there appears a debt position with CR below 100%? Answer: low (let the debt asset float with the collateral asset immediately, although there are chances that one bitUSD could worth more than 1 fiat USD)

IMHO the answer of this rule to the 1st question is stupid, and the 3rd answer is not ideal.

Current voted-in GS protection rule

Answers:

  1. Question: whether to punish good traders who have managed to maintain their collateral ratio well? Answer: no
  2. Question: whether the system would take over positions of traders who have failed to maintain their collateral ratio up to a level? Answer: no
  3. Question: protect debt asset holders to what level when there appears a debt position with CR below 100%? Answer: medium (after the under-collateralized (CR<100%) debt positions are closed due to margin calls or force settlements, the rest debt holders can get full-valued collateral via either margin calls or force-settlements)

I think the main reason that some people are against this rule is the 2nd "no".

Some people are against it due to the appearance (adjusted feed price showing on UI). Actually if it's implemented in core, witnesses will no longer need to publish "fake" price feeds, thus UI will show a normal feed price, and an adjusted "settle price" (which is already showing in UI).

A few people are against it due to the 3rd answer, since it doesn't 100% guarantee that debt asset holders could get fully-valued collateral via force-settlement.

The "convert bad debt positions to limit orders" rule

The mechanism is proposed in forum https://bitsharestalk.org/index.php?topic=27273.0. The answers are:

  1. Question: whether to punish good traders who have managed to maintain their collateral ratio well? Answer: some (they still expose to force-settlements and margin calls instead of the took-over positions)
  2. Question: whether the system would take over positions of traders who have failed to maintain their collateral ratio up to a level? Answer: yes
  3. Question: protect debt asset holders to what level when there appears a debt position with CR below 100%? Answer: high (they can always get full-valued collateral if there are positions not took over)

The main debate is whether this rule favors debt asset owners too much.

The "take over only under-collateralized debt positions but no GS" rule (aka partial GS)

Answers by this rule:

  1. Question: whether to punish good traders who have managed to maintain their collateral ratio well? Answer: no
  2. Question: whether the system would take over positions of traders who have failed to maintain their collateral ratio up to a level? Answer: yes
  3. Question: protect debt asset holders to what level when there appears a debt position with CR below 100%? Answer: medium (same as the GS protection rule)

This is a new idea.

When CR of a debt position drops below a threshold (E.G. 110%), the system take over the debt by moving the collateral and debt to a special "debt-watcher" account, the original borrower's debt position would be closed and he'll lose all the collateral. The debt position of the special account still exposes to margin calls and force-settlements, same as other debt positions, if it has the lowest CR, it gets filled first.

Related topics

I think it's better to change related things at same time. One thing is #164, with this, we can use some fees to fund the special "debt-watcher" account, so it would be slower to a global under-collateralization situation when price of collateral asset drops.

CryptickCryptick1 commented 4 years ago

Interesting Idea... Can I suggest adding a slow moving time frame such as 24 hours before this happens? Reasoning: First, people have lives and might be unhappy to see all positions disappear overnight or while they are at work. Second, markets are volatile, and one would not want to see all positions wiped out by a sudden down tick and or temporary market manipulation. If might also make it easier for coding as those calculations would only need to happen periodically. As far as what time frame to use, would be open to various ideas just don't want to see it misused.

abitmore commented 4 years ago

I am against introducing a time frame, since it may greatly add complexity, also it's somehow unfair to the opponents. For traders, if they put money in margin trading, they should be prepared that one day the money may lose suddenly. Great efforts are required for individual traders to maintain their debt positions well, if one is not prepared, don't join. Cryptocurrency markets aren't like traditional futures markets which only open a few hours a day (so you have lots of time to sleep) and you can sue someone to get some money back if something went wrong.

froooze commented 4 years ago

I like to convert bad debt positions to a limit order, which is also a kind of GS protection + #182

Inmortak commented 4 years ago

I am all against the current Global Settlement Protection (or its new fake name: Active Smartcoin Devaluation) embedded at the core level. I find it a pretty sloppy mechanism. It brings falsehood to the system. Falsehood whose consequences would accumulate over time and are totally unpredictable. For starters, it creates the stimulus for bad debtors to become even worst debtors.

A solution to the problem of bad debtors, though, needs to be embedded in the core level. Partial GS with a debt-watcher account may just do the trick. If that debt-watcher account collects fees from certain transactions, so that it tends to increase its collateral over time, it would prevent bad positions to hit the market immediately and the ensuing amplification of the downward trend of the collateral's price.

Interesting Idea... Can I suggest adding a slow moving time frame such as 24 hours before this happens? Reasoning: First, people have lives and might be unhappy to see all positions disappear overnight or while they are at work. Second, markets are volatile, and one would not want to see all positions wiped out by a sudden down tick and or temporary market manipulation. If might also make it easier for coding as those calculations would only need to happen periodically. As far as what time frame to use, would be open to various ideas just don't want to see it misused.

This, because we are interested in bringing people to the platform, which needs to be friendly. We don't want to scare the hell out of borrowers due to their natural human incompetence and weakness, and send them back home penny-less and humiliated in a matter of the few seconds the market takes to fluctuate.

froooze commented 4 years ago

@Inmortak: We are talking here, what is the best way to handle debt, when every thing else failed before. This should be part of the core, because it is a fundamental security risk and should not relay on other parties.

Debt potions are only converted to a limit order, when ...

The limit order can be removed by three different ways:

remedycoin commented 4 years ago

In the notes below there is the question about "...the best way to handle debt" - I'd like to address this.

I hadn't thought of forgiving quite at this level. As some of you know I'm working on a concept of creating a new form of asset. A forgiveness contract. A brotherhood of forgiveness establishes that they will financially participate in markets of forgiveness based tokens to establish their value in a fractional support methodology. Forgiveness contracts offer forgiveness as long as the party being forgiven has opportunity to object and does not object. In this way the forgiven party becomes a sort of counterparty to the instrument. Rather than simply extinguishing the debt, the brotherhood amplifies the importance of forgiveness by asserting that the forgiven instrument has just as much value as the original debt was worth.

In this way we are using the human heart to pull the world out of the debt slavery. But here it opens up the possibility if "high frequency forgiveness trading".

Sorry if I'm blowing your minds. If you're interested in helping with the projects I'm at [ https://forgivenesscapital.com/ | ForgivenessCapital.com ] and [ https://remedycoin.com/prospectus | RemedyCoin.com/prospectus ] . Some of you may have met me at the Bitshares event in Amsterdam in 2018 where I was introducing the concept of forgiveness based money. Think about it. It has no counterparty risk. It's not a debt instrument. It has intrinsic worth. Your computer programs can move it around, measure it, trade it, etc...

The core provable truth is that we each have infinite personal value. And as long as there is the ability to forgive money into existance for a purpose well then there is less reason to not trust people. Increasing trust, awareness, freedom and creativity in the world for all and less for none is a win, win, win, win proposition!

From: "froooze" notifications@github.com To: "bitshares/bsips" bsips@noreply.github.com Cc: "Subscribed" subscribed@noreply.github.com Sent: Thursday, July 18, 2019 7:43:15 AM Subject: Re: [bitshares/bsips] New BSIP: Global Settlement Protection via core code (#179)

[ https://github.com/Inmortak | @Inmortak ] : We are talking here, what is the best way to handle debt, when every thing else failed before. This should be part of the core, because it is a fundamental security risk and should not relay on other parties.

Debt potions are only converted to a limit order, when ...

* no margin call happened 
* settlement protection fund is empty [ https://github.com/bitshares/bsips/issues/182 | #182 ] 

The limit order can be removed by four different ways:

* market buys the limit order 
* settlement protection fund buys the limit order, when balance is bigger than 0 
* when debt holder adds enough BTS to reach a CR of 1.1 

— You are receiving this because you are subscribed to this thread. Reply to this email directly, [ https://github.com/bitshares/bsips/issues/179?email_source=notifications&email_token=AKNQYWTDAQVJM622LATJL4DQABQOHA5CNFSM4H446YY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2ILBFQ#issuecomment-512798870 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AKNQYWQDS5AK4T2KMBEPYZLQABQOHANCNFSM4H446YYQ | mute the thread ] .

bangzi1001 commented 4 years ago

@abitmore Does add the option for Global Settlement Protection via core code required a hard fork? If no hard fork required, then make this as feature release for asset owners to decide whether want to enable Global Settlement Protection (Once BSIP Pass).

abitmore commented 4 years ago

@bangzi1001 Yes it requires a hard fork.

sschiessl-bcp commented 4 years ago

@abitmore I liked your overview and picked up on it. Here are my thoughts, and another possibily

Questions for rules that handle CR < 1:

  1. Does it punish positions that maintain CR > MCR?
  2. Does the blockchain take over positions that failed to maintain their CR up to a level?
  3. Does it protect BitAsset holders?
  4. Does it protect bad margin position holders?
  5. Does it directly influence the peg?
  6. Does it avoid the undercollaterization?
  7. Is collaterization transparency maintained?
  8. Can the bad position holder recover?
  9. Is there incentive for the community to remove all CR < 1 positions?

1. Global settlement occurs

  1. Yes
  2. Yes, even the ones with CR > 1
  3. Low: See 2., switches to global settlement mode with fixed settlement price for all, and big gab from CR < 1 to revival (CR >= MCR)
  4. No: All positions are confiscated, leverage for the user is lost
  5. Yes, instant force settlement allows arbitrage and margin position creation is not possible to react to demand
  6. No, it gets distributed among all positions (one pool is created)
  7. Yes
  8. No, only through collateral bidding
  9. No (collateral bidding only gives incentive after CR >= 1 and before CR < MCR)

2. GS protection rule through price feed adjustment (currently active)

Answers:

  1. No, only through margin call and force settlement like before
  2. No
  3. Low-Medium:
    • Force settlement gives you less value due to manipulated price feed while there are positions with CR < 1
    • Normal usage instantly after price feed normalizes after CR >= 1
  4. High: Only margin call and force settlement can affect
  5. No
  6. No
  7. Hidden through manipulated price feed (hidden in the sense of not visible on the blockchain)
  8. Yes, still owns the positon and can replenish collateral
  9. No, but possible through margin call and force settlement

3. The "convert bad debt positions to limit orders" rule

The mechanism is proposed in forum https://bitsharestalk.org/index.php?topic=27273.0.

  1. Party. Margin call and force settlement like before, on top of that the CR<1 can't be affected by force settlement and thus CR >= 1 are being force settled instead
  2. Yes
  3. Medium-High: Normal usage through the whole incident
    • Force settlement still takes from a CR >= 1 position because the ones with CR < 1 are a converted to constant sell order
    • Last people that want to settle must instead sell to the converted limit order
  4. No: Positions are confiscated
  5. Minimal, order wall when price rises
  6. No, because not all bitassets could be force settled anymore. Essentially, the "last" to settle would be punished
  7. Yes, but holders need to know how to look for the converted sell order
  8. No, position is converted and lost
  9. No, and removal also not possible

4. The "take over under-collateralized debt positions and prevent GS" rule

Answers by this rule:

  1. No
  2. Yes
  3. Medium:
    • Force settlement may give you less value due to fixed settlement price
  4. No: Position is confiscated, leverage for the user is lost
  5. No
  6. No
  7. Yes
  8. No
  9. No, and removal also not possible

5. Global Settlement Protection via Core Code(aka simple GSP)

Same like 2.

6. Prevent GS rule through flag with force settle incentive

Add bitasset flags "prevent global settlement" and "reverse force settlement offset during margin call". Both flags would be turned on for bitCNY and bitUSD after upgrade. First flag is obvious, simply don't globally settle. Second flag add incentive to maintain CR by switching the behavior of the force settlement offset: If CR >= MCR, use offset as is now. If CR < MCR, offset benefits the bitasset holder and not the margin position holder. This reversal may or may not be used, but it provides incentive to the community to deal with bad margin positions.

EDIT: Forgot one aspect. If "prevent global settlement" is turned on, a margin call of a position with CR < 1 would still seek to buy exactly the debt, and not at current feedprice.

Answers by this rule:

  1. No
  2. No
  3. Medium:
    • Force settlement applies to undercollaterized position
  4. Medium: Margin call and force settlement affect, if CR<MCR force settlement includes a penalty
  5. No
  6. No
  7. Yes
  8. Yes, still owns the positon and can replenish collateral
  9. Yes, incentive is present to force settle when positions are being called and CR between 1 and MCR

What do you think about my idea?

sschiessl-bcp commented 4 years ago

@bitcrab thanks for the update on the text! I adjusted my numbering to match yours.

Is there any difference in 2. and 5. (minus witness-fed vs. core-enforced)?

abitmore commented 4 years ago

@sschiessl-bcp

5.7: if it's me to implement the 2nd mechanism into core, I won't adjust price feed, instead, I'll add a flag and another price field, just like your 6th option. So collateral transparency can be kept.

3.1: it does punish good debt position holders to an extent, because they can no longer hide behind the bad debt position holders, thus expose to force-settlements and margin calls.

4.9: no incentive (so far) but it's able to remove via force-settlements and margin calls.

abitmore commented 4 years ago

The text @bitcrab added is mostly copied from BSIP58. If to implement into core, some can be different.

bitcrab commented 4 years ago

@bitcrab thanks for the update on the text! I adjusted my numbering to match yours.

Is there any difference in 2. and 5. (minus witness-fed vs. core-enforced)?

poll worker or smartcoin tag to enable the feature.

I found European people like "political correctness" so much? you insist to feed market price, but if the margin call or/and force settlement will not refer the feed price, what sense does it make?

sschiessl-bcp commented 4 years ago

@bitcrab thanks for the update on the text! I adjusted my numbering to match yours. Is there any difference in 2. and 5. (minus witness-fed vs. core-enforced)?

poll worker or smartcoin tag to enable the feature.

I found European people like "political correctness" so much? you insist to feed market price, but if the margin call or/and force settlement will not refer the feed price, what sense does it make?

Feed price is something everyone sees (passively) and uses as the everyday reference. The most critic I heard from reports is that the everyday traders are misled with an adjusted price feed. It is also very hard to sell price feed manipulation, and this is where all the resistance come from (independent what their reason for it is).

Currently we have one price feed coming from the witnesses and is put on-chain, and the force settlement price and margin call price are derived from it. My suggestion would alter how the force settlement and margin call price are derived. Your suggestion already alters the price feed that is put on-chain, and the "truth" is only known to witnesses. It must be clear for traders to know what's the feed price (produced by witnesses) and what's the settlement/margin call price of positions with CR < 1 (decided by the blockchain).

Questions:

  1. Can we agree that in the outcome both our approaches produce the same effect? Or do you see any problems with keeping the natural price on-chain?

  2. Like abit said in the forum, the main question remains if the blockchain should take over margin positions with CR < 1, which I agree with you that it shouldn't (https://bitsharestalk.org/index.php?topic=28681.msg332599#msg332599)

  3. I'm also wondering what you think about using the force settle offset as incentive when margin position has bad CR?

bitcrab commented 4 years ago

@sschiessl-bcp please check the updated text, I think you can find some answers, and I don't support to add incentive to force settlement to remove bad debt.

sschiessl-bcp commented 4 years ago

Thanks @bitcrab .

For the new title, I find it misleading

I found the previous one more accurate. The on-chain flag could be called "Prevent Global Settlement", or in a more positive wording "Alleviate Global Settlement".

Thoughts?

bitcrab commented 4 years ago

@sschiessl-bcp in my idea, there will be no GS any more in smartcoin after the implementation of this BSIP, no need to add one flag for smartcoin.

Yes, seems it's really a little misleading

bitcrab commented 4 years ago

if there is no further comments, I feel it's time to complete this BSIP and push it forward.

sschiessl-bcp commented 4 years ago

When doing the PR, I would still suggest to remove any wording of devaluation. It only is devalued (IMO) if trades happen below the peg. This BSIP does not touch market trading at all.

If we are running in a CR < 1 state, what happens with the Force Settlement Offset (FSO)? Will it be applied on top of it, or do we redefine that FSO reduces until CR = 1 - FSO and then we have no FSO anymore (because there is already the implicit punishment through the adjusted price)?

bitcrab commented 4 years ago

When doing the PR, I would still suggest to remove any wording of devaluation. It only is devalued (IMO) if trades happen below the peg. This BSIP does not touch market trading at all.

If we are running in a CR < 1 state, what happens with the Force Settlement Offset (FSO)? Will it be applied on top of it, or do we redefine that FSO reduces until CR = 1 - FSO and then we have no FSO anymore (because there is already the implicit punishment through the adjusted price)?

devaluation of smartcoin is possible while bad debt happens, any solution, either GS, partial settlement, or Prevent GS cannot avoid this completely. so I don't think we cannot use "devaluation" in the proposal, we need tell the truth to public.

no need to do any change to FSO.

sschiessl-bcp commented 4 years ago

You are right, having re read it now I think it's acceptable.

My motivation was that it should not sound like this BSIP introduces active devaluation, as this is something that may occur with and without GS. What it certainly does is it introduces transparency compared to current price feed tactic. Thanks.

froooze commented 4 years ago

Does the UI show a CR under 1 or only values over 1?

bitcrab commented 4 years ago

Does the UI show a CR under 1 or only values over 1?

in UI,there will be only CR>1, however there will be "feed price" and "settlement price", if settlement price>feed price, than feed price/settlement price can tell the actual lowest CR of the bad debt positions, which is less than 1.

sschiessl-bcp commented 4 years ago

Does the UI show a CR under 1 or only values over 1?

in UI,there will be only CR>1, however there will be "feed price" and "settlement price", if settlement price>feed price, than feed price/settlement price can tell the actual lowest CR of the bad debt positions, which is less than 1.

What the UI exactly shows is to be defined. It will likely make a differentiation between execution price and feed price and indicate to the user what factor of undercollaterization the position currently has.

We already have a definition of settlement price towards the end users (force settlement price (includes offset) and global settlement price). The new implicit price derived when CR<1 for margin calls and force settlements should probably have a new name to avoid confusion. How about operational price, execution price, exposing price, or maybe protective price to match the flag name? I like execution price because of the double meaning :)

bitcrab commented 4 years ago

I feel maybe "settlement reference price" is better, "protective price" may trigger association with market manipulation,"execution price" sounds match margin call price or force settlement price.

pmconrad commented 4 years ago

We already have a definition of settlement price towards the end users (force settlement price (includes offset) and global settlement price). The new implicit price derived when CR<1 for margin calls and force settlements should probably have a new name to avoid confusion.

I like the terms used by @bitcrab above:

sschiessl-bcp commented 4 years ago

This will certainly cause a bit more discussion especially when implemented into the UI. The wording should not delay the advancement of this BSIP, its more a sidenote.

The blockchain will still only persist feed price as the real price fed from witnesses, the rest are derived calculated prices, and the backend could simply provide an endpoint with something like margin call price, force settlement price and margin position creation price. The display name can then be discussed in UI issues.

ryanRfox commented 4 years ago

Good final discussions here. Anything to add @abitmore ?

abitmore commented 4 years ago

So, the asset owners (issuers) will be able to change the new "prevent_gs" flag? I guess we'll add a permission for it as well, just like other asset options, so the owners can give up the ability to change the flag.

When can the flag be changed? I guess we can only change the flag of assets not in GS state, in other words, we can't set the flag for bitGOLD right now.

And the asset owner can trigger a GS by changing the flag from "disallow GS" to "allow GS" when undercollateralization is happening.

@pmconrad when undercollateralization happens, I think margin calls would also fill at GS price, at least for the debt position with lowest CR since it can not pay more. After filled, we may need to update the "fair price" for next margin call and force settlement. IMHO this logic should be in the specification.

sschiessl-bcp commented 4 years ago

This flag is meant for protection of holders and borrowers. Thus it should only be changeable while CR>MSSR, otherwise the asset owner can pressure margin position holders.

For the logic of the fair price, on a high abstract level, I understood: The "fair price" is the feed price times a factor that is chosen such that all CR are >= 1 and abs(factor - 1) is minimized.

shulthz commented 4 years ago

The debter whose CR < 1, the blockchain should take over his margin positions!!!

abitmore commented 4 years ago

@shulthz

The debter whose CR < 1, the blockchain should take over his margin positions!!!

Please explain why it's better to take over rather than not take over.

abitmore commented 4 years ago

@sschiessl-bcp

This flag is meant for protection of holders and borrowers. Thus it should only be changeable while CR>MSSR, otherwise the asset owner can pressure margin position holders.

This makes sense. We need to write it in the specification.

Inmortak commented 4 years ago

Hey guys, I wrote the following analysis regarding the issue. GS is only the manifestation of some more profound structural flaws in the Bitshares protocol. It's a pretty long read but, nonetheless worth the time.

Eliminating the negative impact of Global Settlement events (GS) is certainly a priority for the Bitshares ecosystem. Currently, GS is widely regarded by the Bitshares community as a natural consequence of harsh market conditions, bad debtors and poor marketing strategy. Contrary to this perspective, I maintain here, that GS might be the consequence of some other more fundamental factors in the dynamics of the whole Bitshares protocol. I postulate that if these factors are modified, the probability of a GS or a similar event is drastically reduced almost immediately and may even tend to disappear in the long term. These factors include, but may not be limited to, two feedback loops currently present in the dynamics of workers’ financing and Margin calls. This work attempts to elucidate the architectural nature of the problem, out of which GS is only an inevitable result. Also, a new mechanism is proposed.

https://steemit.com/bitshares/@aguerrido/feedback-loops-and-analysis-of-bitshares-architecture-in-relation-to-smart-assets-sustainability

Inmortak commented 4 years ago

@shulthz

The debter whose CR < 1, the blockchain should take over his margin positions!!!

Please explain why it's better to take over rather than not take over.

It is all well presented in this analysis:

https://steemit.com/bitshares/@aguerrido/feedback-loops-and-analysis-of-bitshares-architecture-in-relation-to-smart-assets-sustainability

shulthz commented 4 years ago

@shulthz

The debter whose CR < 1, the blockchain should take over his margin positions!!!

Please explain why it's better to take over rather than not take over.

YOU CAN'T PROTECT EVERYTHING LIKE YOUR WISH, THIS IS VERY STUPID AND FOOLISH!

If the bad debtor was protected by the FLAG, nobody will care their debt just like the bitusd now.

If you want to protect the bitasset, let the system to take over the bad debt, then use a funds and the power of the market to solve it.

People will have the chance to bid these bad debt.

FLAG will give owner the chance to destroy all the debtor.

abitmore commented 4 years ago

@shulthz

The debter whose CR < 1, the blockchain should take over his margin positions!!!

Please explain why it's better to take over rather than not take over.

YOU CAN'T PROTECT EVERYTHING LIKE YOUR WISH, THIS IS VERY STUPID AND FOOLISH!

If the bad debtor was protected by the FLAG, nobody will care their debt just like the bitusd now.

If you want to protect the bitasset, let the system to take over the bad debt, then use a funds and the power of the market to solve it.

People will have the chance to bid these bad debt.

FLAG will give owner the chance to destroy all the debtor.

This is debatable. I am still not sure whether a fund will do good as some people wish.

I'm not trying to protect someone. I still think every punishment on debt position holders will lead to fewer people to borrow, thus will harm liquidity.

Inmortak commented 4 years ago

This is debatable. I am still not sure whether a fund will do good as some people wish.

* When the system takes over a bad debt and let people to buy it, it's no different for the buyers in comparison to leaving the debt in the original owner's account and let people buy it;

The system must take over the debt and NOT put it for sale. That's one of the main points of the analysis I posted above. Whenever a debt position is taken over and its collateral offered for sale, the net effect is downward pressure in the BTS price, which at its turn stimulates more margin calls.

* if the system add collateral asset to the fund via whatever income, it means giving free money to buyers, this actually possibly encourage bad behaviors, e.g. "bad" whales can dump BTS to lower price to get more free BTS; if the system don't add money to the fund, then no such incentive;

Provided that the fund doesn't sale the collateral after it takes over a position, what buyers are you referring to? The following is an description of the take over process, as I see it, taken from my analysis:

First, the Settlement fund takes over the bad position, both the debt and the collateral. The choice of words here is important. The fund doesn’t buy the position, it takes over it. The former holder doesn’t own the position any more, nor he has any debt to pay. Also, the position doesn’t disappear, it still exist with a new owner: the fund. Because the fund doesn’t buy the position, it needs no initial funding. Also, because the fund is taking over positions whose CR is around 1.10, the collateral of the fund would tend to be at least that value. I say ‘at least’ because given that the fund is receiving a fraction of the network fees, this collateral should tend to increase, except in cases of harsh decreases in BTS price. Of course, the big advantage of having the fund taking over instead of dumping the position in the market is eliminating the MFL cited above.

* if the debt is kept in the original debt holders' account, it's possible that they will increase the position's CR by adding collateral or reduce debt; if the system takes over the position, the position's CR can only be increased with a part of system's income.

The empirical evidence that people will not always be willing/capable of replenish their collateral is the current situation. Isn't this lack of refilling their collateral by low collateralized positions what triggered the whole discussion? Also, the second part of your affirmation is not necessarily true. If someone wants to recover his position from the fund, he could do it, under the condition that the collateral is first replenished. Couldn't that be implemented?

I'm not trying to protect someone. I still think every punishment on debt position holders will lead to fewer people to borrow, thus will harm liquidity.

It could be called a punishment only if people were not informed of the conditions before opening their margin positions and warned in advance when their collateral is getting too low. Also, take into consideration that either those positions are taken over by the fund and the peg is maintained, or the peg is lost, the smart-asset becomes undercollateralized and the whole Bitshares ecosystem suffers. You are right in foreseeing a smaller number of borrowers. Yet, that's fine. As of this moment, the guy in Nigeria who goes into his browser an creates an account can borrow BitUSD into existence. He may later default in keeping his position healthy for whatever reason, would you sacrifice the welfare of the network for him? Don't you know that the stability and survival of this platform is tremendously important for the crypto-space, for we are the only long standing DEX? What are the implications of this fact for the greater part of mankind?

I impel everyone to take a look at my analysis, which I posted here:

https://steemit.com/bitshares/@aguerrido/feedback-loops-and-analysis-of-bitshares-architecture-in-relation-to-smart-assets-sustainability

Although a long read, it is worth the time.

abitmore commented 4 years ago

One mechanism @Inmortak proposed in the post is interesting:

  1. the system takes over debt positions whose CR are below 1.1;
  2. if the system's position's CR is below 1, it starts to takes over the debt positions which CR is above 1.1 and below MCR, to try to keep its CR above 1 (named "second-level take over").

So there would be a bigger buffer for the whole bitAsset to stay fully-collateralized.

Essentially, this mechanism is highly in favor of debt asset holders, even higher than the "convert to limit order" option which I proposed. On the other hand, it means higher risks for debt position holders.

shulthz commented 4 years ago

@shulthz

The debter whose CR < 1, the blockchain should take over his margin positions!!!

Please explain why it's better to take over rather than not take over.

YOU CAN'T PROTECT EVERYTHING LIKE YOUR WISH, THIS IS VERY STUPID AND FOOLISH! If the bad debtor was protected by the FLAG, nobody will care their debt just like the bitusd now. If you want to protect the bitasset, let the system to take over the bad debt, then use a funds and the power of the market to solve it. People will have the chance to bid these bad debt. FLAG will give owner the chance to destroy all the debtor.

This is debatable. I am still not sure whether a fund will do good as some people wish.

* When the system takes over a bad debt and let people to buy it, it's no different for the buyers in comparison to leaving the debt in the original owner's account and let people buy it;

* if the system add collateral asset to the fund via whatever income, it means giving free money to buyers, this actually possibly encourage bad behaviors, e.g. "bad" whales can dump BTS to lower price to get more free BTS; if the system don't add money to the fund, then no such incentive;

* if the debt is kept in the original debt holders' account, it's possible that they will increase the position's CR by adding collateral or reduce debt; if the system takes over the position, the position's CR can only be increased with a part of system's income.

I'm not trying to protect someone. I still think every punishment on debt position holders will lead to fewer people to borrow, thus will harm liquidity.

That's mean people still didn't understand the fond and why the system should take over the bad debt.

  1. The people only can buy the bad debt from the system, it's very defferent for the buyers to buy it from the original owner's account, if the owner can't hold his positions why let he still keep it?

  2. The system take over the bad debt, add collateral asset and buy the bad debt to maintain it; people still can bid the bad debt, but can't bid the collateral asset which was added by the system;

  3. if the debt is kept in the original debt holders' account, it's possible that they will increase the position's CR by adding collateral or reduce debt; We can't put the hope on the "possible", the debtor must increase the position's CR to keep it or he will lose it. Let we see what's happening in the bitusd, most debtor can increased their CR, but they didn't, just want the GS protection to portect them, then they can buy more cheapper bts.

if the system takes over the position, the position's CR can only be increased with a part of system's income. Yes, the found will become more and more powerful over time.

abitmore commented 4 years ago

The system must take over the debt and NOT put it for sale.

The system now force-sells collateral when a position's CR<MCR, in your proposal the first-level take-over only starts when CR<1.1, so the take-over doesn't solve the MFL issue you described. Actually CR<1.1 is already extreme condition.

abitmore commented 4 years ago

@shulthz

people still can bid the bad debt, but can't bid the collateral asset which was added by the system

If the added collateral can't be bought, if all other collateral has been bought, how would the people who still hold the last bitUSD convert their bitUSD to BTS?

Let we see what's happening in the bitusd, most debtor can increased their CR, but they didn't, just want the GS protection to portect them, then they can buy more cheapper bts.

I didn't see how they are "buying" BTS, on the opposite, they have positions in margin call status, means they're selling BTS at cheap price. Although whether there are buyers is another question.

If they have fiat or BTC, they can buy cheap BTS no matter whether their positions got taken over, however, it doesn't mean they must put the new bought BTS into the position for sale, because they can buy with another account.

People invented "limited liability" for a reason.

shulthz commented 4 years ago

If the added collateral can't be bought, if all other collateral has been bought, how would the people who still hold the last bitUSD convert their bitUSD to BTS?

The fund will solve this problem and the last bitUSD want to convert their bitUSD to BTS, just sell it in the market. Extreme extreme case, Global settlement "bitusd" as the TCR. Why this should be a problem? just see the last bitGOLD and bitBTC.

I didn't see how they are "buying" BTS, on the opposite, they have positions in margin call status, means they're selling BTS at cheap price. Although whether there are buyers is another question.

We don't guess the market, they just waiting something and someone was taking advantage of this situation.

If they have fiat or BTC, they can buy cheap BTS no matter whether their positions got taken over, however, it doesn't mean they must put the new bought BTS into the position for sale, because they can buy with another account.

It doesn't matter, this is the market , we can't prevent the people not to do something.