Skip to main content

Liquidation Engine

The risk engine protects the protocol from bad debt by closing underwater positions before they become insolvent. It is designed specifically for FX markets and that specificity is what allows Ollo to offer meaningfully better trading parameters than generic perpetual protocols.

Designed for FX, Not Crypto

Most onchain perpetual protocols are built for crypto assets (BTC, ETH, altcoins) where daily moves of 5-15% are routine and flash crashes of 30%+ happen multiple times a year. Their risk parameters reflect this: conservative maintenance margins, aggressive liquidation thresholds, and limited leverage.

FX markets behave differently. Major currency pairs like EUR/USD or USD/JPY typically move 0.3-0.8% per day. Even during extreme events (central bank surprises, geopolitical shocks), moves rarely exceed 3-5% intraday. This lower volatility profile means the risk engine can be calibrated much more tightly.

The result is that Ollo can offer higher leverage with tighter margins not by taking more risk, but by accurately reflecting the risk profile of the underlying asset class.

How Liquidation Works

Liquidation on Ollo is permissionless. Anyone can liquidate an underwater position and earn a reward for doing so. There is no privileged liquidator role.

When Is a Position Liquidatable?

A position becomes eligible for liquidation when its margin ratio falls below the market's maintenance margin requirement (MMR). The margin ratio is calculated using the mark price from the funding rate oracle:

effectiveMargin = positionMargin + unrealizedPnL
marginRatio = effectiveMargin / positionSize

If marginRatio < MMR, the position is liquidatable.

Before checking, the protocol settles any pending funding payments on the position. This ensures the margin ratio reflects the true state of the account. A position that has accumulated unpaid funding debt may be liquidatable even if the price hasn't moved significantly.

Liquidation Price

Every open position has a deterministic liquidation price, the mark price at which the margin ratio hits the MMR:

  • LONG: liquidationPrice = entryPrice × (1 - marginRatio + MMR)
  • SHORT: liquidationPrice = entryPrice × (1 + marginRatio - MMR)

Beyond the liquidation price lies the insolvency price, the point where the position's margin is fully consumed. Any movement past insolvency creates bad debt for the protocol.

Reward Distribution

Successful liquidators earn a reward funded by the liquidated position's remaining margin:

  • Liquidator reward: a percentage of the liquidated notional value, capped by the market's liquidationFeeBps (default: 0.5%).
  • Insurance fund: any remaining freed margin after the liquidator reward goes to the protocol's insurance fund.

If the position is already insolvent at the time of liquidation (margin fully consumed by losses), there is no reward to distribute and the shortfall is recorded as bad debt.

Bad Debt

Bad debt occurs when a position's losses exceed its margin resulting in a shortfall where the protocol cannot recover the full amount from the liquidated account. This can happen when:

  • The position was already insolvent before anyone liquidated it (delayed liquidation).
  • Slippage during the market close order pushed the execution price beyond the insolvency threshold.
  • Insufficient order book liquidity caused the position to remain open while losses accumulated.

Bad debt is tracked per market. The insurance fund absorbs it where possible. Future protocol versions may introduce additional backstop mechanisms such as socialized loss distribution or insurance fund market-making during illiquid periods.

Per-Market Calibration

Risk parameters are configurable per market, allowing the protocol to reflect each pair's volatility profile:

ParameterDescriptionDefault
Maintenance margin (MMR)Minimum margin ratio before liquidation1% (100 bps)
Liquidation feeReward to liquidator as % of notional0.5% (50 bps)
Max leverageMaximum allowed leverage on new positionsPer-market

A low-volatility pair like EUR/USD can safely support higher leverage and tighter margins than a more volatile pair like USD/ZAR. This per-market calibration is a direct advantage of building for FX rather than applying a one-size-fits-all crypto risk model.