# Value of kerosene can be manipulated to force liquidate users

Kerosene spot price derived from TVL minus DYAD supply lets a whale withdraw collateral to crash Kerosene price and force other users' positions into liquidation.

- Payout: Audit contest
- Severity: medium
- Program: DYAD
- Found by: carrotsmuggler
- Disclosed: 2024-06-17
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-04-dyad-findings/issues/67
- Library page: https://bugbountylibrary.com/r/c4%3A2024-04-dyad%3AM-09
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:liquidation vuln:oracle-manipulation

**Target:** Kerosene oracle / getKeroseneValue collateralization logic
**Root cause:** Kerosene price is computed as (exo TVL - DYAD supply)/kerosene supply using instantaneous vault balances, so any user's deposit/withdraw instantly moves the price used in every position's collateralization ratio.
**Steps:**
1. Alice deposits large exo collateral (e.g. 1M USDC) into her vault, raising TVL and propping up kerosenePrice = (TVL - dyadSupply)/keroseneSupply.
2. Bob opens a position with 1000 USDC + 20 kerosene and mints 1150 DYAD; CR = (1000 + 45*20)/1150 = 1.65.
3. Alice withdraws her 1M USDC in one tx, dropping TVL to 9M and kerosenePrice to (9M-5.5M)/100k = 35 USD.
4. Bob's CR recomputes to (1000 + 35*20)/1150 = 1.48, below liquidation threshold.
5. Alice (or anyone) calls liquidate on Bob's position.
**How found:** Reading getKeroseneValue/getTotalUsdValue showed the collateral ratio depends on a spot kerosene price derived from live vault TVL; noting that TVL changes instantly on deposit/withdraw led to the hypothesis that a large holder could move the price in one block.
**Exploitation:** Whale seeds TVL to inflate kerosene price, waits for users to open positions near the liquidation threshold, then withdraws liquidity in a single block to crash the price and liquidate those users at no loss.
**Insight:** When a protocol prices an asset as (aggregate TVL - stablecoin supply)/token supply, any single depositor's withdraw is an oracle write; check whether liquidation thresholds can be crossed within one block by the largest TVL contributor.

