# Price of sfrxEth derivative is calculated incorrectly

SfrxEth.ethPerDerivative inverted the oracle multiply/divide, mispricing sfrxEth and skewing safEth mint amounts and withdraw slippage.

- Payout: Contest reward
- Severity: high
- Program: Asymmetry Finance
- Credited: lukris02
- Disclosed: 2023-07-28
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-03-asymmetry-findings/issues/641
- Library page: https://bugbountylibrary.com/r/c4%3A2023-03-asymmetry%3AH-04
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:oracle-manipulation

**Target:** SfrxEth derivative ethPerDerivative() price calculation
**Root cause:** ethPerDerivative multiplies frxAmount by 1e18 and divides by the Curve frxEth/ETH price_oracle, but the oracle is already scaled to 1e18, so the correct formula is frxAmount * price_oracle / 1e18.
**Steps:**
1. Read SfrxEth.ethPerDerivative(): `return (10**18 * frxAmount) / price_oracle()`
2. Note price_oracle returns ~1e18-scaled ETH-per-frxEth, so it should multiply, not divide
3. Compute convertToAssets(1e18)=1031226769652703996, price_oracle=998827832404234820
4. Correct: frxAmount*price_oracle/1e18 = 1030017999049431492; contract returns 1032436958800480269 (~0.23% off)
5. Observe this feeds mintAmount in stake() and minOut in withdraw()
**How found:** Code review of the price formula: noticed the oracle value is 1e18-scaled yet the code divides by it instead of multiplying, then verified numerically with sample convertToAssets and price_oracle values.
**Exploitation:** No direct attack described; mispricing skews safEth minted on stake() and minOut slippage on withdraw(), potentially over/under-minting safEth or causing withdraw() reverts that lock funds by blocking unstake().
**Insight:** When a derivative price helper mixes a 1e18-scaled oracle with a share-to-asset conversion, check the scaling direction of each term; a divide-vs-multiply inversion yields only a small % error that still corrupts mint/slippage math and can brick withdrawals.
