# Mark Price Cap

# Overview

The Mark Price Cap feature is a risk management mechanism that controls how mark price updates are applied when an instrument is Fair Price Marked (marked to a model). This feature ensures exchange solvency by preventing negative account balances through intelligent price capping and ADL (Automated DeLeveraging) mechanisms.

# Mark Update Behaviors

Mark updates can be configured with one of two behaviors:

# 1. NoCap

  • Mark updates are applied immediately as specified
  • No price restrictions are enforced
  • May result in account bankruptcies (negative balances)

# 2. CapToFirstBankruptcyPrice

  • Engine calculates the "first bankruptcy price"
  • Marks are capped at this threshold
  • Prevents negative equity scenarios
  • Liquidation proceeds at the "first bankruptcy price"

# First Bankruptcy Price Calculation

The first bankruptcy price is determined by:

  1. Simulating the mark update across all accounts
  2. Finding the price point where any account first reaches zero equity
  3. This calculation considers:
    • All margin currencies and instruments
    • Total account equity across the entire exchange
    • Position sizes and directions
    • Current margin balances

# Implementation Flow

graph TD
    A[Mark Update Received] --> B{Check Cap Type}
    B -->|NoCap| C[Apply Mark Immediately]
    B -->|CapToFirstBankruptcyPrice| D[Calculate First Bankruptcy Price]
    D --> E[Apply Capped Price]
    E --> F{Check Insurance Fund}
    F -->|Solvent| G[Complete Update]
    F -->|Insolvent| H[Trigger ADL]

# Automatic Deleveraging (ADL)

ADL is triggered when the insurance fund itself would become bankrupt at the first bankruptcy price.

# ADL Process

  1. Account Selection

    • Identifies accounts with highest PnL positions
    • Prioritizes largest gainers for deleveraging
  2. Position Netting

    • Matches selected positions against insurance fund positions
    • Reduces position sizes proportionally
    • Effectively caps PnL for selected accounts
  3. Risk Mitigation

    • Ensures insurance fund maintains positive equity
    • Distributes losses fairly among highest-gaining positions
    • Preserves overall exchange solvency

# Example Scenarios

# Scenario 1: Normal Price Cap

  1. Mark update attempts to move price from 100 to 120
  2. First bankruptcy price calculated at 115
  3. Mark update capped at 115
  4. Insurance fund solvent, update completes

# Scenario 2: ADL Trigger

  1. Mark update attempts to move price from 100 to 150
  2. First bankruptcy price calculated at 125
  3. Insurance fund would be bankrupt at 125
  4. ADL triggered
  5. Highest PnL positions reduced
  6. Final mark price set at 125