# Vault_Synths.sol code does not consider protocol exchange fee when evaluating the Collateral worth

Vault_Synths.sol valued Synth collateral without subtracting Synthetix exchange fees, overvaluing collateral and risking bad debt on liquidation.

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

**Target:** Vault_Synths.sol collateral valuation logic
**Root cause:** priceCollateralToUSD in Vault_Synths.sol computes collateral USD value from token price without deducting the Synthetix exchange fee that would be paid when selling the Synth, unlike Vault_Lyra.sol which subtracts the LP withdrawal fee.
**Steps:**
1. Read Vault_Lyra.sol priceCollateralToUSD: it fetches withdrawalFee via _getWithdrawalFee and returns USDValue*(LOAN_SCALE-withdrawalFee)/LOAN_SCALE.
2. Compare Vault_Synths.sol priceCollateralToUSD: it returns USDValue without any fee deduction.
3. Note Synthetix exchange fees (e.g. 0.25% for sETH/sBTC) are charged when converting Synth collateral to sUSD during liquidation.
4. Conclude collateral is overvalued by the fee amount, so a liquidation may not cover debt, producing bad debt.
**How found:** Cross-referenced the documented design intent (Vault_Lyra.md getWithdrawalFee: fees must be factored into collateral valuation) against Vault_Synths.sol and noticed the fee subtraction present in Vault_Lyra was missing in Vault_Synths.
**Insight:** When a protocol has multiple collateral vault implementations, diff their valuation functions against each other and against the docs; a fee/penalty applied in one vault but omitted in a sibling is a reliable overvaluation bug.
