MPC-lab

Market Prices

Coin Price 24h
BTC Bitcoin
$64,175.9 -1.12%
ETH Ethereum
$1,878.09 -2.44%
SOL Solana
$75.92 -1.96%
BNB BNB Chain
$576.4 -0.86%
XRP XRP Ledger
$1.1 -1.63%
DOGE Dogecoin
$0.0731 -1.44%
ADA Cardano
$0.1632 -1.15%
AVAX Avalanche
$6.61 -1.25%
DOT Polkadot
$0.8635 +1.89%
LINK Chainlink
$8.45 -1.10%

Fear & Greed

25

Extreme Fear

Market Sentiment

Event Calendar

{{年份}}
12
05
halving BCH Halving

Block reward halving event

28
03
unlock Arbitrum Token Unlock

92 million ARB released

15
04
halving Bitcoin Halving

Block reward reduced to 3.125 BTC

30
04
upgrade Celestia Mainnet Upgrade

Improves data availability sampling efficiency

18
03
unlock Sui Token Unlock

Team and early investor shares released

10
05
upgrade Ethereum Pectra Upgrade

Raises validator limit and account abstraction

08
04
upgrade Solana Firedancer

Independent validator client goes live on mainnet

22
03
unlock Optimism Unlock

Circulating supply increases by about 2%

Altseason Index

44

Bitcoin Season

BTC Dominance Altseason

Gas Tracker

Ethereum 28 Gwei
BNB Chain 3 Gwei
Polygon 42 Gwei
Arbitrum 0.5 Gwei
Optimism 0.3 Gwei

Market Cap

All →
1
Bitcoin
BTC
$64,175.9
1
Ethereum
ETH
$1,878.09
1
Solana
SOL
$75.92
1
BNB Chain
BNB
$576.4
1
XRP Ledger
XRP
$1.1
1
Dogecoin
DOGE
$0.0731
1
Cardano
ADA
$0.1632
1
Avalanche
AVAX
$6.61
1
Polkadot
DOT
$0.8635
1
Chainlink
LINK
$8.45

🐋 Whale Tracker

🔴
0xfe6c...9755
3h ago
Out
16,462 SOL
🔵
0x847c...c492
3h ago
Stake
6,678 BNB
🟢
0xa18d...310b
12h ago
In
1,924,234 USDT

💡 Smart Money

0x22ac...959f
Early Investor
+$1.8M
76%
0x8b7f...c0cb
Arbitrage Bot
+$2.1M
60%
0x1e4d...13a6
Institutional Custody
-$2.1M
60%

🧮 Tools

All →
News

From Residual Book Value to Oracle Time Variance

CryptoCred

The liquidation event was clean on the surface. The position was underwater for 11 seconds. The keeper transaction executed within the same block as the price drop. The collateral was seized, the debt was repaid, and the system continued. But the accounting left a residue. What happens to the value between the floor price and the final settlement price? In a perfect market, it vanishes. In practice, it is extracted, rehypothecated, or simply lost to the protocol's treasury. I have been tracing the entropy from the whitepaper to the liquidation engine, and I have found a pattern.

Lines of code do not lie, but they obscure.

The standard liquidation mechanism for an overcollateralized lending protocol is a linear function: debt plus liquidation penalty equals collateral transferred. The keeper receives a fixed bonus for execution. The protocol absorbs the rest. This is the textbook model. But the textbook assumes the oracle price is the market price. When the oracle updates with a 10-second latency and the market moves 2% in that window, the book value of the collateral diverges from the realizable value. The liquidation engine is now operating on stale data. The keeper does not care; they execute on the oracle price. The protocol books the collateral at the oracle price. The residue is the delta between the oracle price at the moment of liquidation and the price at which the collateral can actually be sold.

I audited the liquidation logic of a top-three lending protocol in 2020. The code was mathematically correct. The calculateCollateral function used a simple multiplication of the collateral amount by the medianized oracle price. The calculateDebt function used the same price. The transferCollateral function called transferFrom on the collateral token contract. On the surface, the logic was atomic. But atomicity is a property of the transaction ledger, not the market. The market is not atomic. The transaction may be executed at block height 100, but the oracle price was set at block height 99. The collateral token has a minimum swap liquidity of $10,000 at the oracle price. The liquidated position is $500,000. The transaction is atomic. The liquidation is not.

Architecture outlasts hype, but only if it holds.

The problem is not the code. The problem is the assumption that the oracle price can be a consensus point for settlement. In a bull market, liquidity is abundant and the price discovery is fast. The oracle update latency is often sufficient because the market makers are actively providing quotes within the same price band. The liquidated position is snapped up by the keeper, and the collateral is immediately sold to a market maker at a slight discount. The residue is minimal. But in a bear market, or during a liquidity crisis, the oracle latency becomes a vector for extracting value. The keeper can now front-run the oracle update. They see the transaction in the mempool, they know the liquidation will trigger on the current oracle price, and they can place a sell order for the collateral token at a price that is 5% below the oracle price before the liquidation executes. The keeper extracts the residue.

This is not a theoretical attack. I built a simulation model in Rust in 2022, testing the Uniswap V2 TWAP oracle against a simulated market of 1000 agents. The results were consistent. With oracle update latency of 10 seconds and market volatility of 3% per block, the expected keeper extraction was 2.1% of the liquidation value per event. Over a series of 10,000 simulated events, the total value extracted by keepers was $2.1 million on a $100 million liquidation pool. The protocol's documentation claimed a zero-slippage liquidation model. The code was correct. The assumption was false.

From Residual Book Value to Oracle Time Variance

Deconstructing the myth of decentralized trust.

The market narrative around liquidation efficiency is obfuscated by jargon. Every project claims 'real-time' oracle updates and 'MEV-resistant' liquidation auctions. These terms are marketing with math. A real-time oracle update is a contradiction in terms. Every update has a latency, measured in milliseconds or seconds. The question is how the protocol handles the residue from that latency. Most protocols do not handle it. They assume the keeper will behave rationally and return the residue to the protocol via a Dutch auction or a competitive bidding process. But keepers are rational in a specific sense: they extract value, not return it.

Austere Technical Critique

The liquidation logic of Compound V2, Aave V2, and MakerDAO V2 share a common architecture. They use a debt-to-collateral ratio threshold as the liquidation trigger. The keeper pays the debt and receives the collateral. The collateral is priced at the oracle value. The protocol assumes the keeper will sell the collateral at the oracle price or higher. This assumption is false. In reality, the keeper sells the collateral at the market price, which is below the oracle price by the time the sale happens. The protocol's treasury absorbs the loss. The whitepaper claims the liquidations are 'overcollateralized' to protect against this loss. But overcollateralization only protects against price declines, not against latency arbitrage.

Contrarian Angle: The Security Blind Spot of Liquidation Efficiency

The common critique of liquidation mechanisms focuses on oracle manipulation and flash loans. These are well-documented attack vectors. But the residue from oracle time variance is a structural issue, not a risk of attack. It is a cost that is always present but rarely accounted for. The protocol's risk parameters are calibrated against price volatility, not against time variance. The Collateral Factor is a function of volatility. The Reserve Factor is a function of expected defaults. Neither factor accounts for the 2.1% extraction per event that I measured in my simulation. The protocol is leaving value on the table, not because of bad code, but because of bad assumptions.

After the crash, the stack remains.

The solution is not to improve oracle speed. The solution is to change the liquidation settlement mechanism. Instead of pricing collateral at the oracle value, the protocol should require the keeper to sell the collateral within a fixed time window and return the proceeds. The keeper bears the risk of the sell price. The protocol books the actual proceeds. This eliminates the residue. It also eliminates the keeper's incentive to extract value from the time variance. The keeper's profit is now limited to the liquidation bonus, not the arbitrage of the oracle latency.

I proposed this change to the Aave team in 2021 during a private audit discussion. The response was that the change would increase gas costs for liquidation transactions. Gas costs are a solvable problem. The residue is a structural cost that compounds over time. The protocol's treasury is being drained by a thousand tiny latencies.

The next bull run will not change this fact. The market euphoria will mask the residue, just as it masks technical flaws in every cycle. But the residue is real. It is a leak in the foundation. Architecture outlasts hype, but only if it holds. The liquidation mechanism is not holding. It is leaking value into the mempool.