-
Notifications
You must be signed in to change notification settings - Fork 647
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
Match force-settlements with margin calls at normal margin call fill price #2489
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abitmore
force-pushed
the
pr-2481-settle-order-margin-call-match
branch
from
July 13, 2021 10:02
8be1044
to
2045d7c
Compare
abitmore
force-pushed
the
pr-2481-settle-order-margin-call-match
branch
3 times, most recently
from
July 17, 2021 18:52
4323dd8
to
1cd3f9e
Compare
- scenario 1: there is at least a settle order, but no limit order that could be matched with a call order, the settle order should get matched - scenario 2: when creating a new call order, if it would trigger a margin call but the call order is not fully filled, should throw - scenario 3: when reducing CR of an existing call order, if it would trigger a margin call but the call order is not fully filled, should throw
abitmore
force-pushed
the
pr-2481-settle-order-margin-call-match
branch
2 times, most recently
from
July 18, 2021 12:32
920e1ab
to
2024368
Compare
abitmore
force-pushed
the
pr-2481-settle-order-margin-call-match
branch
3 times, most recently
from
July 19, 2021 15:12
0ac45cb
to
e1d4f8d
Compare
abitmore
force-pushed
the
pr-2481-settle-order-margin-call-match
branch
from
July 19, 2021 19:46
a7468b4
to
7a2afc7
Compare
Kudos, SonarCloud Quality Gate passed! |
17 tasks
17 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR for #2481.
1. Force-settlements are matched with margin calls with conditions:
current_feed_price.settlement_price / (MSSR-MCFR)
2. When a global settlement occurs:
they are closed at the same price;
price too.
but would close other positions with some collateral left (if any) for their owners.
difference in settlement prices, so traders are incentivized to create new debt in the last minute
then settle after GS to earn free money;
settle for less after GS, so they are incentivized to settle before GS which helps avoid GS.
3. API changes
extensions
field is removed fromasset_settle_cancel_operation
Tasks:
round up to 1cancel it (updated in Implement alternative black swan response methods #2499)