From dd027e27554b2390b8cbb7ab187e7c6e8b274325 Mon Sep 17 00:00:00 2001
From: candida-d <62548908+candida-d@users.noreply.github.com>
Date: Tue, 30 Jan 2024 16:40:20 +0000
Subject: [PATCH 1/2] position resolution update
---
.../trading-on-vega/market-protections.md | 22 +++++++++----------
.../proposals/new-market-proposal.md | 10 +++++++++
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/docs/concepts/trading-on-vega/market-protections.md b/docs/concepts/trading-on-vega/market-protections.md
index 91b2039ff..27a9cb2c0 100644
--- a/docs/concepts/trading-on-vega/market-protections.md
+++ b/docs/concepts/trading-on-vega/market-protections.md
@@ -112,27 +112,27 @@ If a market enters into a liquidity auction and never again attracts enough liqu
## Distressed traders
If a trader's available margin on a market is below the closeout level and cannot be replenished, that trader is considered to be distressed.
-A distressed trader has all their open orders on that market cancelled. The network will then recalculate the margin requirement on the trader's remaining open position. If they then have sufficient collateral, they are no longer considered a distressed trader.
+A distressed trader using cross-margining has all their open orders on that market cancelled. The network will then recalculate the margin requirement on the trader's remaining open position. If they then have enough collateral, they are no longer considered a distressed trader.
-However, if the trader does not have sufficient collateral, they are added to a list of traders that will then undergo position resolution to close out their positions.
+However, if the trader does not have sufficient collateral, their position is closed out.
### Closeouts
-When a participant does not have enough collateral to hold their open positions, the protocol will automatically trigger a closeout.
+When a participant does not have enough collateral to hold their open positions, the protocol will automatically trigger a closeout. The closeout process is a last resort for a position.
-The closeout process is a last resort for a position. If a trader's deployed margin on the market is insufficient to cover a mark to market settlement liability, first Vega will search the trader's available balance of the settlement asset. If this search is unable to cover the full liability, the trader will be considered distressed and undergo position resolution. Any margin balance remaining after closeout is transferred to the market's insurance pool.
+If a trader's deployed margin on the market is insufficient to cover their mark to market settlement liability, first Vega will search the trader's available balance of the settlement asset. If the trader's full liability still can't be covered, their position is transferred to the network. Any margin balance remaining after their closeout is transferred to the market's insurance pool.
The insurance pool is drawn from to make up the difference required to cover the mark to market loss amount. Should the funds in the insurance pool be insufficient for that, loss socialisation will be applied.
### Position resolution
-Position resolution is executed simultaneously, during a single event, for all traders on a market that have been determined to require it. Distressed trader(s) are ‘batched up’, and position resolution is run once the full set of traders is known for this event.
+Once a trader is closed out, their position is taken over by the network. The network's open volume for the market is increased, and the market's insurance pool acts as the network's margin account.
-The network calculates the overall net long or short positions in the batch that requires position resolution, which tells the network how much volume (either long or short) needs to be sourced from the order book. For example, if there are 3 distressed traders with +5, -4 and +2 positions respectively, then the net outstanding liability is +3.
+The network party then submits an IOC limit order to unload the position - selling for a long position or buying for a short position. This type of order is described as a 'network order'. Network orders do not affect the market's mark price.
-The outstanding liability is sourced from the market's order book via a single market order executed by the network as a counterparty. In this example, a market order to sell 3 would be placed on the order book. This order is described as a 'network order'.
-
-The network generates a set of trades with all the distressed traders, all at the volume weighted average price of the network's (new) open position. At this point, neither the distressed traders nor the network will have any open positions. Note, network orders do not affect the market's mark price.
-
-All of the remaining collateral in each distressed trader's margin account for that market is confiscated to the market's insurance pool.
+How much of the position the network party tries to offload depends on the liquidation parameters for disposal, set per market:
+* Disposal time step: How often the network attempts to unload its position, as long as the market isn't in auction
+* Disposal fraction: What fraction of network's current open volume it will try to reduce in one attempt
+* Full disposal size: The lowest position size before the network will attempt to dispose the remaining amount in one order
+* Max fraction of order book side that can be consumed: The max amount of the order book's total volume, within the liquidity bounds, that the network can use to close its position, as a fraction
### Loss socialisation
Loss socialisation occurs when there are traders that don't have sufficient collateral to handle the price moves of their open position(s), and the market's insurance pool cannot cover their shortfall.
diff --git a/docs/tutorials/proposals/new-market-proposal.md b/docs/tutorials/proposals/new-market-proposal.md
index a22e5f6c6..791189f52 100644
--- a/docs/tutorials/proposals/new-market-proposal.md
+++ b/docs/tutorials/proposals/new-market-proposal.md
@@ -168,6 +168,16 @@ The risk model uses the following properties:
| `param: r` | Annualised growth rate of the risk-free asset, it's used for discounting of future cash flows. Use 0.0 unless otherwise required.
Accepted values: any real number | 0.0 |
| `param: sigma` | Annualised historic volatility of the underlying asset.
Accepted values: any strictly non-negative real number; suggested value: asset dependent, should be derived from the historical time-series of prices. | 0.8 (converts to 80%) |
+### Liquidation strategy
+Set up the liquidation strategy to minimise the impact of distressed traders on the market. These parameters can balance between minimising the market impact of disposing of distressed positions and not holding a large open volume for a long time.
+
+| Field | Description | Suggested value |
+| ----------- | ----------- | ----------- |
+| `disposalTimeStep` | Interval, in seconds, at which the network will attempt to close a position it's acquired from distressed traders. | 30 |
+| `disposalFraction` | Fraction of the open position the market will try to close in a single attempt. Range 0 through 1 | 0.1 |
+| `fullDisposalSize` | Size of the position that the network will try to close in a single attempt | 0 |
+| `maxFractionConsumed` | Maximum fraction of the order book's total volume, within the liquidity bounds, that the network can use to close its position. Range 0 through 1 | 0.1 |
+
## Templates and submitting
In the tabs below you'll see:
From 832bb4b4af9d53b1a2ecf6af3c21045fe966d7ba Mon Sep 17 00:00:00 2001
From: candida-d <62548908+candida-d@users.noreply.github.com>
Date: Tue, 30 Jan 2024 21:12:28 +0000
Subject: [PATCH 2/2] liq strategy suggested values
---
docs/tutorials/proposals/new-market-proposal.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/tutorials/proposals/new-market-proposal.md b/docs/tutorials/proposals/new-market-proposal.md
index 9f1c0ac6d..70037553e 100644
--- a/docs/tutorials/proposals/new-market-proposal.md
+++ b/docs/tutorials/proposals/new-market-proposal.md
@@ -178,8 +178,8 @@ Set up the liquidation strategy to minimise the impact of distressed traders on
| ----------- | ----------- | ----------- |
| `disposalTimeStep` | Interval, in seconds, at which the network will attempt to close a position it's acquired from distressed traders. | 30 |
| `disposalFraction` | Fraction of the open position the market will try to close in a single attempt. Range 0 through 1 | 0.1 |
-| `fullDisposalSize` | Size of the position that the network will try to close in a single attempt | 0 |
-| `maxFractionConsumed` | Maximum fraction of the order book's total volume, within the liquidity bounds, that the network can use to close its position. Range 0 through 1 | 0.1 |
+| `fullDisposalSize` | Size of the position that the network will try to close in a single attempt | 1 |
+| `maxFractionConsumed` | Maximum fraction of the order book's total volume, within the liquidity bounds, that the network can use to close its position. Range 0 through 1 | 0.05 |
## Templates and submitting
In the tabs below you'll see: