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

Changes to liquidation & margin relationships #812

Closed
candida-d opened this issue Nov 3, 2023 · 0 comments · Fixed by #900
Closed

Changes to liquidation & margin relationships #812

candida-d opened this issue Nov 3, 2023 · 0 comments · Fixed by #900
Labels
documentation Improvements or additions to documentation

Comments

@candida-d
Copy link
Member

candida-d commented Nov 3, 2023

New market proposal fields

Describe the new fields in a market proposal for liquidation changes:

  • disposal time step - "Specifies the interval, in seconds, at which point the network will try to unload its position."
  • disposal fraction - "Specifies the fraction of its position the network will try to reduce its position by in a single disposal attempt."
  • full disposal size - "Specifies the size of the position held by the network that it will try to dispose of in one attempt."
  • max fraction [of book side within liquidity bounds] consumed - "Specifies the maximum size by which the network can reduce its position as a fraction of the volume on the book."

Feature overview

The aim here is:

  • Separate margin checks, mark-to-market and closeout trades into three separate streams that can run at arbitrary frequencies,
  • Accommodate closeout trades during auctions,
  • Avoid allowing parties with huge position breaching margin level hanging around.
  • Do this without changing any existing margin calculations.
  • Do this without changing how loss socialisation works.

Roughly how:

  • The insurance pool will become "margin account" for a "network party" (think of the network party as a "bad bank").
  • Network will regularly check whether a party is distressed (but doesn't need to be tied to orders / trades etc. only at desired frequency e.g. every block or every 5s). If a party is in breach of margin level their margin is transferred to insurance pool and their position to the "network party". (*)
  • Network does mark-to-market as usual. If the network party has a position the insurance pool is used for MTM flows. If insurance pool is empty network loss socialises as before
  • The network party (insurance pool party) will employ a simple heuristic according to which it will attempt, at a desired intensity, to reduce it's position.

Insurance party position reduction heuristic:

  • if market in continuous trading, place market orders once every desired number of seconds with size the smaller of "half available book volume", "half the position to close out" (unless the position is exactly 1 in which case close out all.
  • if market is in an auction, place a limit order - more thinking needed about the size / price; e.g., don't want to trigger price monitoring or move price too much.

(*) An added benefit of this is that the network may avoid a bunch of close-out trades - imagine network party is long 10 but now it is assigned a position of a party that was short 8; its new position is 2 ... and a bunch of network trades didn't need to happen.

Specs

@vega-issues vega-issues added the documentation Improvements or additions to documentation label Nov 3, 2023
@candida-d candida-d linked a pull request Jan 30, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from NEW to DONE in Frontend Engineering Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants