Butter.xyz Docs
  • Welcome
  • Butter Swap
    • Introduction
    • Getting Started
    • Swapping Tokens
    • Providing Liquidity
    • Fee Structure
    • Security Best Practices
    • Contract Addresses
    • Audits
  • Rewards
    • Overview
    • Points
    • Fishing
      • Fishing Staking
  • Bakery on Blast
    • The Bakery
    • Contract Addresses
  • Butter Perps
    • Introduction
    • Disclaimer
    • Getting Access
    • How To Trade
      • Deposit & Withdrawal
      • Perpetuals
        • Timed Perpetuals
          • Community Timed Perpetuals
      • Spot Trading
      • Liquidity Pool
    • Learn more
      • Cross-margin leverage
      • Security
    • Perpetuals Deep Dive
      • vAMM
      • Index price
      • Price limits
      • Fees
      • Funding
        • Timed Perps
      • Risk
        • Position limits
        • Margin and collateral
        • Liquidations
        • Auto deleveraging
      • AMM pool adjustments
      • Insurance fund
      • Collateral NFTs
  • Governance and Tokenomics
  • About Butter.xyz
  • API
    • Private Beta
  • Official links
    • Website
    • Twitter
    • Discord
    • Telegram
Powered by GitBook
On this page
  1. Butter Perps
  2. Perpetuals Deep Dive
  3. Risk

Auto deleveraging

PreviousLiquidationsNextAMM pool adjustments

Last updated 1 year ago

Auto-deleveraging is a type of last-resort liquidation in which a bankrupt trader's positions are closed directly against opposing traders' positions instead of the vAMM. Auto-deleveraging matches a bankrupt account's position against the opposing traders' position at the current mark price.

The liquidation engine maintains an ordered list of accounts that are candidates for deleveraging. The list is ordered by each trader's profitability and leverage; highly profitable and highly leveraged traders are deleveraged first.

Specifically,

profitability=unrealized PnLcollateral, margin ratio=maintenance marginaccount value\text{profitability} = \frac{\text{unrealized PnL}}{\text{collateral}},\ \text{margin ratio} = \frac{\text{maintenance margin}}{\text{account value}}profitability=collateralunrealized PnL​, margin ratio=account valuemaintenance margin​.

Accounts are ordered by profitability∗margin ratio\text{profitability} * \text{margin ratio}profitability∗margin ratio in descending order.