Skip to content

Commit

Permalink
refactor: network trade as mark price
Browse files Browse the repository at this point in the history
  • Loading branch information
witgaw authored and Witold committed Nov 14, 2023
1 parent 691fc89 commit c313fc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion protocol/0012-POSR-position_resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- All orders of "distressed traders" in cross-margin mode are cancelled (<a name="0012-POSR-001" href="#0012-POSR-001">0012-POSR-001</a>)
- Open positions of distressed traders are closed immediately (<a name="0012-POSR-002" href="#0012-POSR-002">0012-POSR-002</a>)
- Mark Price is never updated during position resolution (<a name="0012-POSR-004" href="#0012-POSR-004">0012-POSR-004</a>)
- Non-distressed traders who trade with the network because their open orders are hit during the networks' trade have their positions settled correctly. (<a name="0012-POSR-005" href="#0012-POSR-005">0012-POSR-005</a>)
- When a distressed party has a [staking account](./0013-ACCT-accounts.md) with the same currency as the settlement currency of the market where it's distressed the staking account is NOT used in margin search and liquidation. (<a name="0012-POSR-006" href="#0012-POSR-006">0012-POSR-006</a>)
- When a party is distressed and gets closed out the network's position gets modified to reflect that it's now the network party that holds that volume. (<a name="0012-POSR-009" href="#0012-POSR-009">0012-POSR-009</a>)
Expand All @@ -27,6 +26,10 @@

- It is possible to check the time of the next liquidation trade attempt in any market via the API. (<a name="0012-POSR-015" href="#0012-POSR-015">0012-POSR-015</a>)

- When the network places an order to reduce its position such that resulting trades would activate the price monitoring trigger the order gets cancelled, network's position remains unchanged and no further orders get placed by the network in this time instance. (<a name="0012-POSR-016" href="#0012-POSR-016">0012-POSR-016</a>)

- When the network places an order which trades successfully and there are no other trades within the mark-to-market window then then when the window elapses the price from network's last trade is used as the mark price (<a name="0012-POSR-017" href="#0012-POSR-017">0012-POSR-017</a>)

## Summary

Position resolution is the mechanism which deals with closing out distressed positions on a given market. It is instigated when one or more participant's margin account balance falls below their latest maintenance margin level.
Expand Down Expand Up @@ -85,6 +88,8 @@ is closest to reproducing the legacy setup where party would get liquidated imme

Different liquidation strategies with different parameters might be proposed in the future, hence implementation should allow for easy substitution of strategies.

Note that network's trade is treated as any other trade in a sense that its price can be used as the mark price.

API requirements:

- create an endpoint to easily identify network's position in any given market,
Expand Down
4 changes: 3 additions & 1 deletion protocol/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
"0012-POSR-012",
"0012-POSR-013",
"0012-POSR-014",
"0012-POSR-015"
"0012-POSR-015",
"0012-POSR-016",
"0012-POSR-017"
]
},
"Passive liquidity": {
Expand Down

0 comments on commit c313fc3

Please sign in to comment.