# Boost can be sold under peg despite comments and code attempting to prevent it

Axion's SolidlyV2AMO minUsdAmountOut guard fails to stop admin mintAndSellBoost from selling BOOST below peg, leaking protocol funds on large depegs.

- Payout: Audit contest
- Severity: medium
- Program: Axion
- Found by: spark1
- Disclosed: 2024-10-07
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-10-axion-judging/issues/36
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-10-axion%3AM-1
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** SolidlyV2AMO / MasterAMO stablecoin AMO contract
**Root cause:** The only below-peg guard sets minUsdAmountOut to the average toUsdAmount(boostAmount) rather than enforcing the 1:1 sqrt(K) balanced price, so a large sell crosses the peg and dumps BOOST below it.
**Steps:**
1. Pool holds 90 BOOST and 110 USDC (1 BOOST > 1 USDC).
2. Admin calls `mintAndSellBoost(20e18)` on MasterAMO -> SolidlyV2AMO.
3. `minUsdAmountOut` is set to `toUsdAmount(boostAmount)` (average), which passes.
4. Sell executes; pool ends at 110 BOOST / 90 USDC, with the tail of the sale below peg.
5. Protocol loses the area under the curve below peg (~1.004 USDC in example, ~5% of funds used).
**How found:** Read the docstring/readme invariant that admins can only sell BOOST above peg, then traced the single `if (minUsdAmountOut < toUsdAmount(boostAmount))` guard and reasoned through AMM curve math to show the average-price check does not bound the marginal price.
**Exploitation:** Admin-privileged call to mintAndSellBoost (or mintSellFarm) with a large boostAmount; the average-price check passes while the marginal price crosses below peg, realizing loss on the protocol.
**Insight:** When a protocol claims an invariant like 'never sell below peg', check whether the guard uses average execution price instead of marginal/spot price; AMM sells always cross the peg mid-trade, so average-price checks are insufficient.

