Skip to content
L

Liquidation Shield

Closed-loop liquidation protection for DeFi

Created on 29th August 2026

•

L

Liquidation Shield

Closed-loop liquidation protection for DeFi

The problem Liquidation Shield solves

Your Liquidation Shield / Flash-Repayment Vault project (Problem Statement 11, CSI ORIGIN 2026) is solving the classic DeFi liquidation problem:

In lending protocols like Aave or Compound, if you borrow against collateral (e.g., ETH) and the collateral's value drops, your position becomes "unhealthy" (health factor < 1).
Once that happens, liquidator bots swoop in, seize part of your collateral, and sell it at a discount to repay your debt — you lose money to a liquidation penalty, often within seconds, even if you would have topped up your position if you'd noticed in time.
This is especially brutal during flash crashes, when liquidations cascade and users get wiped out before they can react.

Challenges we ran into

Aave — e-mode and isolation mode. Aave doesn't use one flat liquidation threshold per user — if a position is in E-Mode or isolation mode, the effective LT/LTV comes from the e-mode category or the isolation debt ceiling instead of each reserve's own config. Computing that correctly was out of scope for the time we had, and silently using the wrong LT would mean mis-sizing every intervention for those users. Rather than guess, our position reader explicitly detects both cases and refuses the position with a clear reason instead of quietly producing a wrong Health Factor.

Alchemy — rate limits and pinned-block reads. Reading a full position means a lot of calls — reserve list, per-reserve user data, config, token addresses, oracle prices, debt ceilings — and running them one at a time against our Alchemy RPC was both slow and easy to rate-limit. We batched everything into multicalls, split into two rounds: one to find which reserves the user actually touches, and one for full detail on just those. We also pinned every call to the same block number, so a slow second request couldn't land on a different block and silently disagree with the first.

Deriving the formulas, not just implementing them. The math itself — the reflection-principle liquidation probability, the dynamic target Health Factor, and the minimum-intervention-size equation — took real derivation, not just translating a spec into code. The sizing formula in particular comes from solving the post-intervention Health Factor equation for the release amount, and the execution friction inside that formula depends on the release amount itself (a bigger release means more slippage) — a circular relationship we resolved with a bounded fixed-point iteration rather than a closed form. We validated the probability formula against a published reflection-principle fixture table and the sizing formula against a canonical worked example, both matching to the cent, before trusting either in the live pipeline.

Discussion

Builders also viewed

See more projects on Devfolio