# Depeg event can happen at incorrect price

Y2k Finance Controller's isDisaster modifier used strict < instead of <=, letting anyone trigger a depeg swap when price equals strike, not below it.

- Payout: Contest reward
- Severity: high
- Program: Y2k Finance
- Credited: csanuragjain
- Disclosed: 2023-01-09
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-09-y2k-finance-findings/issues/69
- Library page: https://bugbountylibrary.com/r/c4%3A2022-09-y2k-finance%3AH-09
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** Controller.sol triggerDepeg / isDisaster modifier (EVM smart contract)
**Root cause:** The isDisaster modifier reverts only when strikePrice < latestPrice, so equality passes and a depeg event fires even though the asset price is not below the strike price as the docs require.
**Steps:**
1. Set vault strike price = 1 and pegged asset price = 1.
2. Ensure block.timestamp is between idEpochBegin(epochEnd) and epochEnd.
3. Call `triggerDepeg(marketIndex, epochEnd)` on Controller.
4. isDisaster check `vault.strikePrice() < getLatestPrice(tokenInsured)` is false (1 < 1 false), so no revert.
5. Depeg event executes and hedge/risk vaults swap total assets at a non-depegged price.
**How found:** Warden read the docs stating depeg requires price strictly below strike, then compared to the code's isDisaster modifier and noticed the strict `<` comparison admits the equality case.
**Exploitation:** Anyone (Keeper role is permissionless) calls triggerDepeg when the pegged asset price merely equals the strike price, forcing the hedge and risk vaults to swap their total assets prematurely at an incorrect price.
**Insight:** When a spec says 'below', audit the boundary: strict vs non-strict comparison in oracle-gated state transitions (depeg, liquidation, settlement) is a recurring high-severity off-by-one that lets permissionless keepers fire events at the wrong price.
