dYdX liquidations reduce perpetual positions after a maintenance margin breach
Updated:dYdX liquidations reduce or close perpetual positions when a subaccount's equity falls below its maintenance margin requirement. On dYdX Chain, the protocol values exposure using oracle prices and generates liquidation orders against the order book. A breach makes the subaccount eligible for forced reduction; the actual fills determine how much exposure closes. Partial closure leaves exposure open, while an account with negative equity can enter deleveraging. The trigger, the execution price, and the final balance describe different parts of the event. Collateral credits and executed exits change the margin calculation; an unfilled exit leaves position size unchanged.
Key takeaway: A partial liquidation leaves exposure that still needs maintenance margin, so reduced position size alone does not establish a restored buffer.
Maintenance breaches and forced reductions
A maintenance breach makes a perpetual subaccount liquidatable even when its equity remains positive, so forced reduction can precede a zero balance. Equity combines the USDC quote balance with signed, oracle-valued positions. Maintenance margin for each position equals absolute position size multiplied by oracle price and the applicable maintenance margin fraction, and the account compares equity against the combined requirement for all its positions. Price movements can change both sides of that comparison, while funding deductions can reduce equity without reducing exposure.
Initial margin governs opening or increasing exposure. Maintenance margin governs liquidation eligibility. A restriction on increasing a position therefore does not establish that liquidation has begun. A breach exposes the position to partial or full forced closure. Configured position and subaccount limits bound the quantity liquidated within a block.
Order-book depth and the execution boundary
The liquidation engine needs executable order-book liquidity within its calculated price limit to reduce a position through ordinary liquidation matches. Selling reduces a long position; buying reduces a short position. The engine derives its fillable price from oracle valuation, maintenance requirements, account collateralization, and configured spread controls. That price limits the liquidation order. Resting maker orders determine the actual close prices, which can differ from both the oracle price and the displayed liquidation threshold.
Protocol-generated liquidation orders use immediate-or-cancel execution. They can fill partially, while unmatched quantity does not become a resting liquidation order. Preliminary matching information also differs from a committed fill: constructing or attempting an order alone does not prove that the account's exposure changed.
Remaining collateral and the liquidation penalty
Liquidation can leave residual collateral or consume the remaining account value, depending on execution and the applicable penalty calculation. Governance controls the maximum liquidation fee, which the engine reads from the on-chain liquidation configuration. The liquidation fee cap uses the quote value of the executed reduction as its calculation base. The software also limits the positive insurance-fund payment using the collateral remaining from that reduction. Residual collateral depends on execution losses and the penalty charged, so a fee cap cannot promise a returned deposit.
Liquidation penalties go to the insurance fund. The fund can absorb a shortfall associated with liquidation execution within the protocol's constraints. The trader still realizes the position's loss when the insurance fund covers an execution shortfall. Actual fill prices and charged amounts explain the event's cost more directly than a projected threshold price.
A credited deposit and an unfilled reduction
Can a submitted risk-reduction action keep the account above maintenance margin? Consider a hypothetical subaccount holding one long perpetual position. All amounts, exposure quantities, and price-driven changes in this example are hypothetical. Starting equity is 476 quote-currency units, and maintenance margin is 456 units, leaving a 20-unit buffer. Compare adding collateral with submitting a position reduction from that same starting state. Either action avoids a maintenance breach only if the subaccount's resulting equity is at least its resulting maintenance requirement.
The collateral action credits 26 units to the exposed subaccount before another price change. Equity becomes 502 units, while maintenance margin remains 456 units because exposure and oracle price stay unchanged. The buffer becomes 46 units. The credited balance establishes this change; no position-reduction fill is necessary. A submission response without the credit would not establish that increased equity.
The alternative action submits a reduction order, but no quantity fills before an adverse oracle update. Equity falls to 446 units, and the recalculated maintenance requirement becomes 452 units. The account is now 6 units below maintenance margin and liquidatable. A subsequent protocol liquidation sell fill reduces long exposure by quantity L, leaving S minus L from starting quantity S. The forced fill explains that reduction; the unfilled manual order explains none of it. Comparing the fill quantity with the updated position confirms the exposure change. Whether the remaining account meets maintenance margin requires its post-fill equity and requirement.
Cross and isolated collateral boundaries
Cross margin evaluates shared exposure and collateral within one subaccount, while isolated margin separates a position into its own collateralized subaccount on the frontend. An address-wide balance can therefore conceal a shortage in the specific subaccount holding the exposed position.
Shared margin
Cross-margin positions contribute to one equity calculation and one combined maintenance requirement, so a displayed liquidation price for one market depends on the account's other positions and their valuations. Changes elsewhere in that subaccount can move the projected threshold without a new trade in the selected market. Single-market liquidation estimates hold other position values and the quote balance fixed while varying that market's price.
Separated positions and isolated markets
Frontend isolated positions use separate subaccounts, so collateral elsewhere does not automatically support their margin. Isolated markets additionally have segregated collateral pools and their own insurance funds. Choosing isolated margin and trading an isolated market describe different features. An isolated position's projected liquidation price uses its own subaccount's equity and maintenance requirement.
Liquidation records and the resulting subaccount
Liquidation reconciliation connects the recorded forced fill to the same market and subaccount's reduced exposure, collateral movements, and remaining margin requirement. Keep the account address and subaccount number consistent across those records.
Recorded execution
Fill history identifies an account's own forced liquidation with the LIQUIDATED type. The fill's side, size, price, fee, and block height describe executed exposure and cost. Several fills can contribute to one reduction. Their total executed quantity establishes the position change, while an attempted order size cannot substitute for those quantities.
Resulting account state
Exposure and timing
A sell liquidation reduces the signed long position, and a buy liquidation moves a short position toward zero. Compare the position with fills covering the same period. The account snapshot's latest processed block must include those fills before it can corroborate their effects.
Equity and remaining requirements
Post-liquidation equity includes the remaining quote balance and oracle-valued exposure. Funding, transfers, and other executions can also change that balance during the comparison period. Separate those movements from the liquidation's contribution. A smaller position still requires maintenance margin, and later price changes can make the residual exposure liquidatable again.
Bankruptcy, deleveraging, and final settlement
Negative equity can make an account eligible for deleveraging, which offsets its exposure against positions on the opposite side at the distressed account's bankruptcy price. That mechanism differs from matching a liquidation order against resting order-book liquidity. Offsetting positions can lose expected profit through the forced reduction. A sufficiently large oracle change can move an account from adequately collateralized to negative equity before ordinary liquidation completes. Final settlement can also close positions through deleveraging when governance winds down a market, even without that account's maintenance breach. The event type therefore matters when explaining a forced closure; a closed position alone does not identify its cause.
Everyday questions about dYdX liquidations
Do stop-loss orders guarantee an exit before dYdX liquidation?
A stop-loss order does not guarantee that exposure closes before the account becomes liquidatable. A triggered stop-limit order can remain unfilled when available prices do not satisfy its limit. Stop-market execution also relies on order-book liquidity. The stop trigger and maintenance breach are separate conditions, and a trigger alone does not establish a completed exit.
Is a dYdX subaccount liquidatable when equity exactly equals maintenance margin?
The liquidation eligibility test requires maintenance margin to exceed the subaccount's equity. Equality alone does not satisfy that test, although it leaves no buffer above the threshold. An adverse oracle update or a funding deduction can change the comparison. Use values from the same account state rather than rounded display figures.
Does a negative quote balance prove that a dYdX subaccount is bankrupt?
A negative quote balance does not by itself mean that total equity is negative. The equity calculation includes signed position values at oracle prices alongside the quote balance. Quote-balance accounting can therefore show a negative value while the complete account remains adequately collateralized. Bankruptcy concerns the combined equity calculation, not that balance field alone.
Can lowering target leverage protect an existing isolated position from liquidation?
Lowering target leverage alone does not transfer additional collateral into an existing isolated position. On the frontend, target leverage determines collateral allocation for a subsequent order. Actual credited collateral and existing exposure determine the margin comparison. The setting itself does not change those balances, and position-reduction orders do not automatically add collateral.
What does a LIQUIDATED fill mean in dYdX liquidation history?
A LIQUIDATED fill identifies the forced reduction of that account's own position. The maker counterparty's fill uses the LIQUIDATION type. Confusing those labels can lead to a mistaken explanation of a position change. Read the event type together with the fill's side, quantity, and subaccount before attributing the reduction to an account's margin breach.
Will an unrealized profit prevent a cross-margin position from being liquidated?
An unrealized profit on one cross-margin position does not shield it from an account-level maintenance breach. Other positions can reduce shared equity enough to make the subaccount liquidatable. The trigger concerns combined equity and maintenance requirements. A profitable position can therefore be among the exposure that the protocol reduces when the shared account falls below maintenance margin.