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

Tighter peg when collateral price rises and settlement fund is not empty or settlement order exists #2721

Merged
merged 13 commits into from
Mar 5, 2023

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Jan 30, 2023

PR for #2591.

Changes:

  • When BSRM is global_settlement
    • when paying a forced-settlement from the global settlement fund, pay at margin call order price when applicable
  • When BSRM is individual_settlement_to_fund
    • when paying a forced-settlement from an individual settlement fund, pay at margin call order price when applicable
  • When BSRM is individual_settlement_to_order
    • store total collateral amount and debt amount in the settled-debt order (updated in Settlement code refactory #2748) individual_settlement_debt and individual_settlement_fund fields in bitasset object
      NOTE:
      This may break client applications which rely on the old logic "individual_settlement_debt and individual_settlement_fund are always zero when BSRM is individual_settlement_to_order".
    • update order price on new feed / expired feed / updated price feed producer list / updated asset or bit-asset parameters, then check whether the order can be matched as taker after finished processing margin calls, if yes, process funds.
      Note: no action is done on hard-fork time.
    • when the settled-debt order is matched as maker, process funds

@abitmore abitmore changed the title PR for #2591 Tighter peg when collateral price rises and settlement fund is not empty or settlement order exists Feb 25, 2023
@abitmore abitmore marked this pull request as ready for review February 25, 2023 23:30
@abitmore abitmore force-pushed the pr-2591-force-settle-price branch from c35ef8b to 2b2ca4b Compare February 26, 2023 12:56
@sonarcloud
Copy link

sonarcloud bot commented Feb 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

91.2% 91.2% Coverage
0.0% 0.0% Duplication

@abitmore abitmore merged commit a6dcc1a into hardfork Mar 5, 2023
@abitmore abitmore deleted the pr-2591-force-settle-price branch March 5, 2023 11:19
abitmore added a commit that referenced this pull request Mar 13, 2023
Fix issues related to global settlement introduced in PR #2721
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tighter peg when collateral price rises and settlement fund is not empty or settlement order exists
1 participant