Defx Docs
Go to WebsiteTrade on Defx
  • About Defx
  • Defx Platform Overview
    • Self-Custodial
    • Central-Limit Order Book (CLOB)
    • APIs & Webhooks
  • Defx Product Docs
    • Orders
    • Margin
    • Liquidation
    • Insurance Fund
    • Auto-Deleveraging
    • Just-in-Time (JIT) Funding
    • Self Trade Prevention
    • Price Oracle
    • Fees
    • Multi-Asset Mode
      • Collateralization & Liquidation Ratios
      • Liquidation in Multi-Asset Mode
    • Glossary
  • Defx Smart Contracts
  • Contract Specifications
  • Defx Developer Hub
    • REST APIs Documentation
      • REST API Postman Collection
    • WebSocket Documentation
      • User Data Streams (Closed Socket)
      • MarketFeed Streams (Open Socket)
  • Referrals
  • Points
  • Using our Testnet
  • Audits
  • Risks
  • Restricted Territories
  • Terms & Conditions
  • Features
    • Trade Smarter: How Defx's Multi-Asset Collateral System Transforms Crypto Trading
    • sUSDe support
Powered by GitBook
On this page
  • Overview
  • Liquidation Price
  1. Defx Product Docs

Liquidation

Overview

Liquidations on Defx serve a crucial role in maintaining the stability and fairness of the trading environment. They prevent systemic risk by ensuring that all positions are adequately funded, thus safeguarding the exchange's solvency and protecting users from potential disruptions in volatile markets.

Defx's liquidation process automatically terminates leveraged positions if a trader's margin fails to meet the necessary maintenance margin, preventing their positions from reaching bankruptcy. The specific maintenance margins required are outlined in the "Maintenance Margin Requirements" section of our documentation. These requirements vary by contract, as detailed in the "Contract Specifications."

Liquidation is triggered when the mark price, as determined by the third-party oracle Stork, reaches the designated liquidation price for a position. Defx provides a visible liquidation price to traders at position initiation and throughout the duration of the position. As a position nears its liquidation price, Defx issues margin calls, advising traders to increase their margin by adding funds, thus avoiding liquidation.

Liquidation Price

In the event that a position's margin falls to the maintenance margin level, Defx's liquidation engine automatically intervenes to assume control of the loss-making position. The primary function of the liquidation engine is to try to close the position at a predetermined liquidation price, calculated according to the following formula:

((InitialMargin−MaintenanceMargin)−(Side∗Qty∗avgEntryPrice))/(Qty∗MMR+Side∗Qty)((InitialMargin - MaintenanceMargin) - (Side * Qty * avgEntryPrice)) / (Qty * MMR + Side * Qty)((InitialMargin−MaintenanceMargin)−(Side∗Qty∗avgEntryPrice))/(Qty∗MMR+Side∗Qty)

PreviousMarginNextInsurance Fund

Last updated 10 months ago

Page cover image