# Market Price Lower Than Expected

BondBaseSDA._currentMarketPrice rounds down instead of up, so makers sell tokens below the whitepaper-specified market price, causing maker losses.

- Payout: Contest reward
- Severity: medium
- Program: Bond
- Credited: xiaoming90
- Disclosed: 2022-11-05
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2022-11-bond-judging/issues/20
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-11-bond%3AM-5
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:precision-loss

**Target:** BondBaseSDA.sol market price calculation
**Root cause:** _currentMarketPrice uses mulDiv (round down) instead of mulDivUp, violating the whitepaper's requirement that the integer market price round up to protect makers.
**Steps:**
1. Read whitepaper Definition 25: integer market price must round up.
2. Compare marketPrice() which uses mulDivUp (correct) vs _currentMarketPrice() which uses mulDiv (incorrect).
3. Observe _currentMarketPrice feeds _decayAndGetPrice, yielding lower price and higher payout tokens.
4. Fix: change mulDiv to mulDivUp in _currentMarketPrice.
**How found:** Code-reading against the whitepaper spec: noticed rounding direction inconsistency between the public marketPrice() (mulDivUp) and internal _currentMarketPrice() (mulDiv).
**Escalation:** Lower price raises payout tokens, increasing lastDecayIncrement, lowering totalDebt, further lowering future market price.
**Insight:** When a spec mandates rounding direction, grep every mulDiv/mulDivUp variant of the same formula—public and internal helpers often diverge, and the internal one may feed state updates.
