Skip to Content
Velocity ProtocolTradingLiquidationsLiquidations

Liquidations

Trading on leverage can be risky. Make sure you are aware of the liquidation rules outlined below before applying margin.

What is Liquidation?

Liquidations are a part of leveraged trading. Traders that elect to use leverage are using the collateral they deposited as margin to borrow money from the protocol. Traders may choose to do this in order to open a larger position and have more exposure to a particular asset, i.e. leveraged exposure.

When this occurs, the protocol must protect itself by ensuring that there is enough margin for the position to settle any losses that occur. There is a prescribed minimum ratio between a position’s value and its margin for each asset (Minimum Maintenance Margin).

If a position drops below its Minimum Maintenance Margin, liquidators are incentivized by the protocol to take over positions so a user’s remaining collateral may settle the losses that have occurred. Read Insurance Fund for what happens when prices move rapidly and/or liquidations don’t happen in time.

How do Liquidations work?

By default, all positions within a subaccount (deposits, borrows, and perpetuals positions) are cross-margined — liquidations are calculated based on your account level leverage rather than isolated to the leverage present in your perpetuals and/or borrow account.

Velocity also supports isolated positions — a perp position funded and margined independently of the rest of the subaccount. Isolated positions are liquidated on their own, without touching the account’s cross-margin collateral or other positions, and (unlike cross-margin) close 100% in a single liquidation rather than unwinding gradually — see below.

You can be liquidated when your totalCollateral becomes less than yourmaintenanceMarginRequirement. Your total collateral is the weighted value of your deposits and perp pnl. Your margin requirement is the weighted value of your borrows and perp positions.

Once your total collateral value falls below your margin requirement, liquidations will first cancel any open orders + LP positions. After this, until your account’s total collateral is above the maintenanceMarginRequirement + liqBufferRatio liquidators can iteratively liquidate any portion of assets and liabilities over a throttled time window (to avoid single price instance from a heavily deleveraging account). The liqBufferRatio is set on the Velocity State Account and is meant to sufficiently bring an account away from the liquidation boundary but not heavily punish users.

The Health measure on the user page can help visualise how close a user is to liquidation territory. At 0 Health, a user can get liquidated.

Health = 100% - maint. margin / total collateral

The user’s trade price at liquidation for a perpetual position will be based on the oracle price. The penalty / fee that is set per market, likely above the normal taker fee, in order to give the liquidator a rebate.

Liquidations triggered and positions will be liquidated using margin engine prices.

In the case of an extreme oracle error: the market will pause most fills, liquidations, and funding rate updates.

Example:

You deposit 500 USDC and you long 200 SOL-PERP at $25.

  • Your position value is 5000USDCandyourmargin/collateralis5000 USDC and your margin/collateral is 500 USDC, you have 10x leverage.
  • Note that the Minimum Maintenance Margin for a SOL-PERP is 3% (see Minimum Maintenance Margin for assets here: Margin).

Calculations:

  • Total collateral = 500 * 1.00 = 500
  • Margin requirement = 5000 * .05 = 250

You are liquidated if the price of SOL decreases by 5.28% to $23.6825. This is because:

  • Perp PnL = 200 * $25 * -0.0527 = -263.5
  • New total collateral = 500 - 263.5 = 236.5
  • New margin requirement = 23.6825 * 200 * .05 = 236.825

At that point your total collateral is less than your margin requirement and liquidation is triggered.

Isolated Position Liquidations

Cross-margin liquidations unwind gradually — a throttled percentage per slot window that accelerates or slows based on how the price moves after liquidation begins (see Liquidation Engine). Isolated positions skip this ramp entirely: once an isolated position is under-margined, it is liquidated 100% in one shot, since its collateral and risk can’t spill over into the rest of the account the way a cross-margined position’s can.

Liquidation Fees

Per-market liquidation fee rates are split three ways when a position is liquidated:

  • liquidator_fee — paid to the liquidator, unchanged from a standard liquidation reward.
  • if_liquidation_fee — the insurance fund’s cut.
  • protocol_liquidation_fee — a protocol cut, introduced alongside the fee redesign. The combined insurance-side budget (if_liquidation_fee + protocol_liquidation_fee) is computed once against the user’s margin shortfall, then split IF-first: the insurance fund receives exactly what it would have received without the protocol fee, and the protocol only captures margin headroom beyond that. This means adding a protocol cut can never push a liquidation into bankruptcy that wouldn’t otherwise have happened — it only reduces the excess margin the liquidatee would have kept.

Perp liquidations accrue the IF and protocol cuts as pending fee-ledger counters (materialized by the fee sweep); spot liquidations credit the liability market’s revenue_pool and protocol_fee_pool directly.

Bankruptcy and Solvency Status

If a liquidation leaves a user with an outstanding liability and no further assets, the account becomes bankrupt and is resolved via resolve_perp_bankruptcy / resolve_spot_bankruptcy (or resolve_perp_pnl_deficit for a market-wide PnL deficit short of full bankruptcy). These solvency-repair instructions are gated by a dedicated State.solvencyStatus bitflag (SolvencyStatus.SOLVENCY_REPAIR_PAUSED) rather than the general withdraw-pause flag — an admin can pause deposits/withdrawals without also blocking bad-debt resolution, or pause solvency repair independently via AdminClient.updateSolvencyStatus (cold-admin only). See Insurance Fund for the backstop waterfall itself.

Being a Liquidator

Read Liquidators if you want to learn more about being a liquidator on the platform. Liquidators earn a fee for their services.

Last updated on