Liquidation
Liquidation protects lenders when a borrower's position becomes unhealthy. When a position's health factor falls below 1.0, the protocol fully liquidates — seizing 100% of the collateral, selling it on Polymarket's CLOB, repaying the debt, paying a liquidator fee (see Protocol Constants), and retaining any residual USDC in the lending pool. This is a full-liquidation model similar to perpetual futures on centralized exchanges: a liquidated position does not return residual USDC to the borrower.
When Does Liquidation Trigger?
Health Factor Below 1.0
A position is eligible for liquidation when its health factor drops below 1.0:
Health Factor = (Collateral Amount × Price × Liquidation Threshold) / Debt
When Health Factor < 1.0, it means:
Debt > Collateral Amount × Price × Liquidation Threshold
In other words, the borrower's debt has exceeded what the protocol considers a safe level relative to their collateral's current value.
What Causes the Health Factor to Drop?
Three factors can push a health factor below 1.0:
-
Price decline (most common): When the Polymarket share price drops, the value of your collateral falls, pulling your health factor down toward the liquidation threshold (85%). A large enough drop brings the position to the point of liquidation.
-
Interest accrual (gradual): Over time, the borrower's debt increases due to interest. If the borrower doesn't repay or add collateral, the health factor slowly decreases even with a stable price.
-
Market resolution (instant): When a Polymarket market resolves against the borrower's position (the outcome doesn't happen), the shares become worthless ($0.00). This is an instantaneous health factor drop to zero. However, this is handled separately through the market resolution system rather than standard liquidation.
The Liquidation Process
PredMart's liquidation process differs from many DeFi protocols in that it is not open to arbitrary third-party liquidators. Instead, liquidation is executed exclusively by PredMart's relayer — the same backend service that processes borrows and withdrawals. This ensures liquidations are performed efficiently and with accurate, oracle-signed prices.
Detection: Real-Time Monitoring
PredMart's backend continuously monitors all active positions for health factor changes. When a collateral token's price drops, the system recalculates health factors and triggers liquidation for any position with health factor < 1.0. Multiple redundant monitoring paths ensure liquidations execute even if one system experiences an outage.
Execution: On-Chain Liquidation
Once the backend identifies a liquidatable position, it:
- Fetches fresh oracle price — the average price to sell $1,000 of shares into the order book (manipulation-resistant)
- Signs price data with the oracle key
- Submits
liquidate(borrower, tokenId, repayAmount, priceData)to Polygon via the relayer
Smart Contract Checks
The liquidate() function on the smart contract performs the following verifications:
- The caller is the authorized liquidator
- The oracle price signature is valid and recent
- Interest is accrued up to the current second
- The position's health factor is genuinely below 1.0 at the provided price
- The collateral seizure and sale calculations are correct
Liquidation During Pause
Liquidations are explicitly allowed even when the protocol is paused. This ensures that unhealthy positions can always be closed to protect lenders, regardless of protocol state.
Full Collateral Seizure Model
When health factor < 1.0, the liquidator seizes 100% of the borrower's collateral in a single transaction:
- All collateral is seized and sold on Polymarket's CLOB
- Debt is repaid (principal + accrued interest)
- Liquidator fee is paid (see Protocol Constants)
- Residual retained by the pool — flows into
totalAssets, raising thepUSDCexchange rate for lenders. The borrower receives $0.
This ensures clean, atomic liquidations with no partial positions left in limbo.
Liquidator Fee
The liquidator receives a fee calculated on the debt amount as compensation for executing the liquidation. This fee covers gas costs and operational overhead. For the current liquidator fee percentage, see Protocol Constants.
Example: - Borrower's position: 10,000 shares at $0.50, debt = $3,200 - Health factor < 1.0 - All 10,000 shares are seized and sold for $5,000 - Debt repaid + liquidator fee deducted from proceeds - Residual retained by pool - Borrower receives: $0
Had the borrower exited proactively (manual flash close, take-profit/stop-loss, or partial repay) before the health factor crossed 1.0, they would have received the surplus.
Underwater Positions: When Collateral < Debt
A position is underwater when the total value of the collateral is less than the outstanding debt:
Underwater: Collateral Amount × Price < Debt
This scenario can occur when: - A rapid, large price drop outpaces the liquidation engine - The price drops through an illiquid range where efficient liquidation is difficult - Multiple positions need liquidation simultaneously, creating a queue
Underwater Liquidation Mechanics
When a position is underwater, the liquidation follows the same seize-first model:
-
All collateral is seized: The liquidator takes all of the borrower's collateral for that position.
-
Collateral is sold on market: The seized shares are sold on Polymarket's CLOB at the current market price.
-
Debt repayment from proceeds: Whatever USDC is obtained from the sale is used to repay the debt.
-
Bad debt absorption: The shortfall (debt minus sale proceeds) becomes bad debt that is absorbed by the lending pool:
Bad Debt = Debt - Sale Proceeds
Bad Debt Socialization
When bad debt occurs, it is socialized across all lenders in the pool. In practical terms:
- The pool's totalBorrowAssets is reduced by the full debt amount
- But only the sale proceeds are actually added to the pool's USDC balance
- The difference (bad debt) effectively reduces totalAssets
- This means the pUSDC exchange rate decreases slightly
- All lenders share the loss proportionally to their pool ownership
Example: 5,000 shares at $0.30, debt = $2,000. Shares sell for $1,500. Bad debt = $500, absorbed by the pool.
What Happens to Seized Collateral
After a liquidation, the seized Polymarket shares are sent to PredMart's admin wallet. The protocol then automatically sells these shares on Polymarket's CLOB to convert them back to USDC.
Auto-Sell System
PredMart automatically sells seized collateral on Polymarket's CLOB using Fill-or-Kill (FOK) orders with no slippage cap — the order signs at the worst valid price, but FOK semantics mean it actually fills at the best available bid in a single atomic shot. This prioritizes execution certainty over price precision: in thin markets, the fill can be meaningfully below the displayed midpoint, and that loss is absorbed by the pool (raising bad-debt risk for lenders).
Other auto-sell behaviors:
- Dust filtering: Negligible-value positions are skipped — operational cost exceeds their value.
- Market-closed handling: If the market has stopped accepting orders, winning shares are redeemed directly through the CTF contract.
- Verification: Each sale is confirmed settled on-chain before being marked complete.
Liquidation Cooldown
To prevent redundant transactions for the same position, PredMart enforces a cooldown between liquidation attempts for each borrower-token pair. This prevents wasting gas on duplicate liquidation transactions during rapid price movements.
Liquidation Speed
The system monitors prices continuously and executes liquidations within seconds of detecting an unhealthy position. Redundant monitoring paths keep liquidations prompt even during outages.
How to Avoid Liquidation
- Don't borrow the maximum: keep health factor ≥ 1.5 (≥ 2.0 in volatile markets).
- Monitor health factor: check often during volatility; act if it drops below 1.3.
- Add collateral or partially repay: both push HF up. Repay is a direct on-chain transaction (no relay needed) so it's fast even if backend services are degraded.
- Remember the health factor moves faster than the price: when the share price falls, your collateral value drops while your debt stays fixed, so a leveraged position's health factor falls faster than the price itself — and reaches the threshold sooner than a naive read of the price suggests. (The threshold itself is a constant 85%; it doesn't move with price.)
Liquidation Event Data
On-Chain Events
Every liquidation emits events on the blockchain:
event Liquidated(
address indexed liquidator,
address indexed borrower,
uint256 indexed tokenId,
uint256 collateralSeized,
uint256 debtRepaid
);
// If bad debt occurs:
event BadDebtAbsorbed(
address indexed borrower,
uint256 indexed tokenId,
uint256 amount
);
API Access
You can query liquidation history through the API:
GET https://api.predmart.com/lending/liquidations/{wallet_address}
This returns all liquidation events for a specific wallet, including timestamps, amounts, and transaction details.
Next Steps
- Market Resolution — What happens when markets resolve (different from liquidation)
- Risk Parameters — Understand the health factor and LTV in detail
- Oracle Pricing & Borrow Caps — How borrow caps prevent hard-to-liquidate positions
- Protocol Constants — Full reference of liquidation parameters