# LTV equals liquidation threshold

Borrow cap and liquidation trigger sharing one rate, or two health checks valuing collateral differently

_Area: DeFi oracles, liquidations and flash loans. Seen in 6 disclosed reports; latest 2025-02-17. Updated 2026-10-23._

## How it works
A position is safe only while its borrow LTV sits strictly below the liquidation threshold. When the borrow-side cap and the liquidation-side trigger derive from the same number, a max borrow lands exactly on the boundary. Any interest tick, price nudge or config change then makes the position instantly liquidatable. The broken assumption is that "max borrow" leaves a safety margin; it does not unless a separate, higher liquidation threshold exists. A related shape: two health checks (withdraw vs liquidate) that value collateral differently, so one path accepts a position the other rejects.

## Where it shows up
- One `maxLTV`/`collateralizationRate` constant feeding both the borrow check and the liquidation check [E2](https://bugbountylibrary.com/r/c4%3A2022-12-backed%3AH-04.md)[E6](https://bugbountylibrary.com/r/c4%3A2023-07-tapioca%3AH-22.md).
- Borrow allowed up to current liquidity with no buffer, so next-block interest makes it underwater [E1](https://bugbountylibrary.com/r/c4%3A2023-04-rubicon%3AH-04.md).
- Health check comparing collateral value directly to debt with no gap below threshold [E3](https://bugbountylibrary.com/r/c4%3A2024-03-revert-lend%3AM-11.md).
- Two health checks using different collateral valuations, e.g. bare vs weighted collateral [E4](https://bugbountylibrary.com/r/c4%3A2024-02-wise-lending%3AM-04.md).
- Closing-factor denominator using a different rate than the solvency check [E5](https://bugbountylibrary.com/r/sherlock%3A2024-02-tapioca%3AH-5.md).

## How to review
Enumerate every ratio comparison and label which side it serves: borrow cap, health check, liquidation trigger, closing factor. Confirm the invariant: for any accepted borrow, borrow LTV < liquidation threshold by a real margin, and both sides use the same collateral valuation. The margin must exceed one block of interest accrual plus a small price move. Diff the borrow cap against the liquidation trigger; if they share a constant, flag it. For config setters, confirm changes cannot instantly flip healthy positions into liquidation. Where two health checks exist, diff their collateral valuation paths. For closing-factor math, confirm every rate in the formula matches the one used by the solvency check [E5](https://bugbountylibrary.com/r/sherlock%3A2024-02-tapioca%3AH-5.md).

## Variants seen
- Identical max LTV for borrow and liquidation [E2](https://bugbountylibrary.com/r/c4%3A2022-12-backed%3AH-04.md)[E6](https://bugbountylibrary.com/r/c4%3A2023-07-tapioca%3AH-22.md).
- Max borrow from liquidity with no buffer [E1](https://bugbountylibrary.com/r/c4%3A2023-04-rubicon%3AH-04.md).
- No buffer below threshold in health check [E3](https://bugbountylibrary.com/r/c4%3A2024-03-revert-lend%3AM-11.md).
- Mismatched valuation between withdraw and liquidation checks [E4](https://bugbountylibrary.com/r/c4%3A2024-02-wise-lending%3AM-04.md).
- Closing-factor denominator using the wrong rate [E5](https://bugbountylibrary.com/r/sherlock%3A2024-02-tapioca%3AH-5.md).

## Impact and severity
Instant or forced liquidation of healthy or maxed positions, MEV back-running, and protocol insolvency from bad debt [E1](https://bugbountylibrary.com/r/c4%3A2023-04-rubicon%3AH-04.md)[E2](https://bugbountylibrary.com/r/c4%3A2022-12-backed%3AH-04.md)[E3](https://bugbountylibrary.com/r/c4%3A2024-03-revert-lend%3AM-11.md). Severity is high when a single transaction or minor price move triggers it; worse when liquidation is permissionless and rewards front-running. Under-computed closing factors leave positions repeatedly liquidatable [E5](https://bugbountylibrary.com/r/sherlock%3A2024-02-tapioca%3AH-5.md). Note: E2's SPOT/TWAP price-kind detail is secondary to the shared-rate root cause.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2023-04-rubicon%3AH-04.md
- E2: https://bugbountylibrary.com/r/c4%3A2022-12-backed%3AH-04.md
- E3: https://bugbountylibrary.com/r/c4%3A2024-03-revert-lend%3AM-11.md
- E4: https://bugbountylibrary.com/r/c4%3A2024-02-wise-lending%3AM-04.md
- E5: https://bugbountylibrary.com/r/sherlock%3A2024-02-tapioca%3AH-5.md
- E6: https://bugbountylibrary.com/r/c4%3A2023-07-tapioca%3AH-22.md
