Crypto Newbie

Crypto Newbie / Simulators / Lending Liquidation

Lending Liquidation Simulator (Aave / Compound / Spark)

Aave, Compound, Spark, MakerDAO — all major crypto lending protocols share the same liquidation mechanic. You deposit collateral, borrow against it, and if the collateral price drops too far the protocol auto-liquidates a portion of your position. A liquidator bot calls liquidate(), repays part of your debt, and receives your collateral at a 5-10% discount as their bonus. This simulator runs the exact health-factor + bonus math so you can see where the trigger is and what the liquidator actually makes.

Borrowing position

Position health

Collateral value

$35.0k

Borrow value

$20.0k

Current LTV

57.14%

Health factor

1.45

Liquidation price (collateral)

$2.4k

Status

⚠ Risky

Run liquidation

Health factor — the single most important number

Health factor = (collateral value × liquidation threshold) / borrow value. Above 1.0 = safe. Below 1.0 = liquidatable by anyone. A safe HF for active users is > 1.5 (gives buffer for normal volatility); long-term hold positions should target HF > 3.0 (survives a 50%+ collateral crash). Aave's UI shows this number prominently and turns it red as it approaches 1.0. Most users learn the hard way after their first liquidation; the math is mechanical and there's no appeal.

Liquidation price — the trigger you can compute in advance

For a single-collateral position: liquidation price = (borrow value) / (collateral amount × LT). Memorize this number when you open the position. As long as the collateral price stays above this level, you're safe. Add a 20% buffer and that's your 'I should add collateral' threshold. The simulator above computes this live as you adjust position parameters.

Liquidator economics — why bots watch every position

Liquidation bonus = 5-10% of the debt repaid. For a $10k liquidation, that's $500-1000 of bonus. Liquidator pays gas (~$5-50 on Ethereum) + flash-loan fees if borrowing the repay amount (~0.05-0.30%). Net profit per liquidation: typically $200-800 USD. Bots monitor hundreds of positions in parallel and execute within seconds of HF dropping. The competition is fierce — being first to liquidate a position requires sub-second response time + competitive gas bidding.

Defending against liquidation — the four tools

(1) Repay debt — reduces the borrow amount, raises HF instantly. (2) Add collateral — raises the collateral side. (3) Borrow stable assets (USDC/DAI) instead of volatile (ETH) — debt value doesn't move when collateral drops. (4) Use auto-rebalancing strategies like Instadapp or DeFiSaver that auto-deleverage when HF approaches 1.2. Manual defence requires watching prices; auto-defence requires paying ~$5-20/month in service fees. For positions > $50k, auto-defence pays for itself in one avoided liquidation.

Frequently asked questions

+Why doesn't Aave let me get to HF = 0.99 safely?

Because by the time the on-chain HF drops to 0.99, a liquidator bot has already submitted the liquidation transaction. There's no 'pause' — the protocol responds to whatever the current price feed says. The HF buffer exists because price feeds update every block (12 seconds on Ethereum); a flash crash in a single block can drop your HF from 1.05 to 0.85 instantly.

+Can I get partially liquidated multiple times?

Yes. The 'close factor' caps how much of your debt can be liquidated in one call (Aave V3: 50%). After the first liquidation, your HF should improve to safe territory — but if the price keeps dropping, you can be liquidated AGAIN. During the March 12 2020 crash, some Aave positions were liquidated 3-4 times sequentially, paying the bonus to liquidators each time.

+What's the difference between liquidation threshold (LT) and loan-to-value (LTV)?

LTV is the MAX you can borrow at position open (Aave ETH: 80%). LT is when you get liquidated (Aave ETH: 83%). The 3% gap is a safety buffer — even if you borrow the max, you have 3% room before triggering liquidation. Most users don't borrow max; experienced users open at 50-65% LTV to give themselves much more buffer.

+Do liquidations happen on stablecoin collateral?

Theoretically yes — USDC/DAI can depeg (USDC depegged to $0.87 in March 2023). If your collateral is USDC and USDC drops 13%, your HF drops 13%. Practically rare because stablecoin volatility is much lower than ETH/BTC. But it's not zero — positions opened with stablecoin collateral got liquidated during the March 2023 USDC depeg.

+Why doesn't Aave have an insurance fund like perpetual exchanges?

It does — the Safety Module, staked AAVE tokens that backstop the protocol against bad debt. If liquidations don't fully cover a position (rare — only happens during extreme price moves where liquidators can't act fast enough), the Safety Module covers the shortfall. Stakers earn a yield but bear the bad-debt risk. Aave has used this several times in its history, most notably during the March 2020 crash.