# SynthVault rewards can be gamed

SynthVault weights deposits using manipulable spot price, letting an attacker inflate weight with small deposits and claim outsized rewards.

- Payout: Audit contest
- Severity: high
- Program: Spartan Protocol
- Found by: cmichel
- Disclosed: 2021-09-16
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2021-07-spartan-findings/issues/166
- Library page: https://bugbountylibrary.com/r/c4%3A2021-07-spartan%3AH-06
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high technique:source-review vuln:business-logic vuln:oracle-manipulation vuln:reward-distribution

**Target:** SynthVault deposit/weight accounting
**Root cause:** _deposit computes user weight from the spot value of the synth in BASE via calcSpotValueInBase, which is manipulable, while rewards are paid in BASE unrelated to pool liquidity.
**Steps:**
1. Drip large amounts of `BASE` into the `iSYNTH(_synth).LayerONE()` pool repeatedly to raise BASE-per-token spot price (smaller trades cheaper due to path-independence).
2. Call `SynthVault.depositForMember` with a small synth amount; `calcSpotValueInBase(iSYNTH(_synth).LayerONE(), _amount)` returns inflated weight.
3. Optionally drip more BASE and repeat deposits.
4. Drip `token` back into pool to rebalance.
5. Claim large share of rewards based on inflated weight.
**How found:** Code review of _deposit weight calculation noticing it uses spot price (manipulable) while reward is denominated in BASE independent of pool liquidity, making manipulation cost/profit asymmetric.
**Exploitation:** Attacker manipulates pool spot price up, deposits minimal synth to record inflated weight, repeats, rebalances pool, then claims rewards disproportionate to locked amount. Profitable when pool liquidity is low and reward reserve high.
**Insight:** When reward weight is snapshotted from a spot price but rewards are paid in an asset unrelated to that pool, compare manipulation cost (pool liquidity) against reward reserve size to find profitable gaming; recommend TWAP or storing deposits and computing weight on the fly.

