Liquidation Procedures

Liquidations follow a waterfall process:

If the account equity falls below maintenance margin an account becomes liquidatable.

  • Liquidations will first go through force matching, where orders are placed on the orderbook to attempt to close positions on behalf of the user.

  • If the above fails, the account will go through hard liquidation which will be taken by the insurance fund or vault.

  • If all else fails, accounts will be auto-deleveraged, in this scenario the underwater account is matched with the most profitable account on the given product and matched at a price which would ensure no negative equity exists in the system.

Force Matching

This feature is a risk management measure that allows the off-chain engine to close positions on a sub-account's behalf in order to protect the protocol and limit loss to unhealthy sub-accounts. It can only be invoked if one of the two following invariants are true:

  1. Sub-account Core Collateral Debt < 0

  2. Sub-account Maintenance Health < 0

In the event that one of these invariants is true for a given sub-account the off-chain engine will create a market order on a certain position (the position selection criteria are provided in the sections below). This will then be matched on the Order book and settled on-chain as a regular swap, this allows the user to avoid costly liquidation fees.

Sub-account Core Collateral Debt

This will occur if the sub-account being force matched has accrued a negative core collateral debt but are still healthy from a margin perspective. If this is the case then the offchain engine will swap one of their other positions into core collateral in order to reduce their core collateral debt to 0 or a threshold above 0.

Sub-account Maintenance Health

This will occur if the sub-account is below maintenance health and are deemed unhealthy. If this is the case then the offchain engine will swap one of their positions to improve their health so that it is above maintenance but below initial margin.

Hard Liquidations

Liquidations occur when a sub-account's Maintenance Health falls below 0. They are necessary to ensure that a user does not go into negative equity, thereby causing the 100x protocol to inherit bad debt. The Rysk health system uses health risk weights for each product to ensure that there is a buffer between a sub-account becoming liquidatable, and that same sub-account going into debt.

Liquidations are done on a per-position basis in the following order:

  • Naked Perp positions

  • Spreads

  • Spot assets

Within this order, positions are liquidated in order of their risk parameters, with the most risky positions within a given product class being liquidated first.

A liquidator can liquidate positions up to the point that the liquidatee's Initial Health = 0. This stops the liquidatee from being "over-liquidated".

Liquidation Price

When liquidators attempt to liquidate a subaccount, they specify the product and the amount they want to liquidate. The liquidation price for assets is set between the mark price and the price determined by the maintenance weight.

The net price at which the product is liquidated is calculated as follows:

  • Long: mark_price * (maintenanceLongWeight + 4) / 5

  • Short: mark_price * (maintenanceShortWeight + 4) / 5

The gross profit of liquidators equals:

  • Long: mark_price * (1 - maintenanceLongWeight) / 5

  • Short: mark_price * (maintenanceShortWeight - 1) / 5

However, the insurance fund receives 25% of the profit that liquidators generate to protect protocol health moving forward. Thus, the net profit of liquidators equals:

  • Long: oracle_price * ((1 - maintenanceLongWeight) / 5 )* 0.75

  • Short: oracle_price * ((maintenanceShortWeight - 1) / 5 )* 0.75

Last updated