Skip to main content

How Does a Smart Contract Enforce the Margin Call Process for a Perpetual Futures Contract?

The smart contract continuously monitors the maintenance margin level of a user's position against the current mark price. If the margin ratio falls below a predefined threshold, the contract's liquidation function becomes callable.

A 'keeper' bot or another user can then call this function, which automatically liquidates a portion of the collateral to cover the deficit and bring the margin back to a safe level.

How Can Smart Contracts Manage Margin Calls for Leveraged Derivatives?
How Does a Smart Contract Perform a Margin Call and Liquidation?
What Is the Role of the ‘Liquidation Engine’ on a Crypto Derivatives Platform?
What Are the Differences between Single-Function and Cross-Function Reentrancy Attacks?