Skip to main content

How Does a Smart Contract Perform a Margin Call and Liquidation?

The smart contract constantly monitors the collateralization ratio of a user's position using a real-time price feed from an oracle. If the ratio drops below a pre-set maintenance margin threshold, the contract automatically triggers a "margin call" and allows a liquidator (often a bot) to repay the debt.

The contract then sells the collateral at a discount to cover the debt, often imposing a penalty fee on the borrower.

How Is Collateral Managed and Liquidated in a DeFi Smart Lending Contract?
How Do Oracles Trigger the Liquidation of a Leveraged Perpetual Futures Position?
How Can Smart Contracts Manage Margin Calls for Leveraged Derivatives?
How Does Collateralization in DeFi Minimize Default Risk?