# If any stable depegs, oracle will fail, disabling swaps

Unitas swap path reverts when oracle price falls outside hardcoded min/max bounds, so any stablecoin depeg halts swaps and freezes user collateral.

- Payout: Contest reward
- Severity: medium
- Program: Unitasprotocol
- Credited: Ruhum
- Disclosed: 2023-04-19
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-04-unitasprotocol-judging/issues/145
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-04-unitasprotocol%3AM-5
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity vuln:dos vuln:oracle-manipulation

**Target:** Unitas.sol swap price validation via OracleX
**Root cause:** `_checkPrice` enforces `minPrice <= price <= maxPrice` with bounds only updatable through a timelock; a real depeg pushes price outside bounds and every swap reverts with PRICE_INVALID.
**Steps:**
1. Call swap on Unitas.sol which fetches price from OracleX
2. `_checkPrice` runs `_require(minPrice <= price && price <= maxPrice, Errors.PRICE_INVALID)`
3. If stable depegs below minPrice (e.g. USDC < $0.90), require fails and swap reverts
4. Users cannot repay loans or withdraw collateral; bounds cannot be updated quickly due to timelock
**How found:** Code review of swap price validation; wardens reasoned that oracle bounds assume stablecoins never depeg, contradicting real events like USDC's March 2023 drop below $0.90.
**Insight:** When an oracle has hard min/max sanity bounds, check who can update them and how fast; if bounds require timelock changes, a legitimate market move becomes a liveness/freeze bug rather than just stale pricing.
