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

[Liquidation improvements] Completely decouple MTM, margin checks and closeout trades #9945

Closed
gordsport opened this issue Oct 31, 2023 · 0 comments · Fixed by #10006 or #10066
Closed

Comments

@gordsport
Copy link
Contributor

Issue:

This issue is to implement liquidation improvements noted having seen markets working in mainnet since Alpha mainnet was deployed by the validators.

The current design around margins means that:

  • closeout trades happen (or are attempted) when a party is in breach of margin requirement and when there is enough volume and when we're not in an auction.
  • we cannot handle (future) frequent batch auctions
  • we may reward a party that has a big position (MTM move against them, we want to close out but can't, MTM move for them they're OK again - the network was at risk but party kept profit).
  • the logic in core is tightly coupled in places making moves towards WASM based smart products harder.
    The aim here is:

Separate margin checks, mark-to-market and closeout trades into three separate streams that can run at arbitrary frequencies,

  1. Accommodate closeout trades during auctions,
  2. Avoid allowing parties with huge position breaching margin level hanging around.
  3. Do this without changing any existing margin calculations.
  4. Do this without changing how loss socialisation works.

Specs:

@gordsport gordsport added this to the 🏰 Palazzo Mistero milestone Oct 31, 2023
@gordsport gordsport moved this to Todo in Core Kanban Oct 31, 2023
@gordsport gordsport moved this from Todo to In Progress in Core Kanban Nov 3, 2023
@gordsport gordsport linked a pull request Nov 7, 2023 that will close this issue
@vega-issues vega-issues moved this from In Progress to Waiting Review in Core Kanban Nov 14, 2023
@vega-issues vega-issues moved this from Waiting Review to Approved in Core Kanban Nov 15, 2023
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Nov 15, 2023
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Nov 16, 2023
@gordsport gordsport moved this from Approved to In Progress in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from In Progress to In Review in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from Approved to In Review in Core Kanban Nov 17, 2023
@vega-issues vega-issues moved this from In Review to Approved in Core Kanban Nov 17, 2023
@github-project-automation github-project-automation bot moved this from Approved to Merged in Core Kanban Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants