# If long and short products has different maker fees, vault rebalance can be spammed to eat vaults balance

BalancedVault rebalance loop pays maker fees on each sync when long/short products have asymmetric maker fees, slowly draining vault collateral.

- Payout: Contest reward
- Severity: medium
- Program: Perennial
- Credited: mstpr-brainbot
- Disclosed: 2023-05-05
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-05-perennial-judging/issues/41
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-05-perennial%3AM-5
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:fee-bypass

**Target:** BalancedVault.sol sync/rebalance and Product openMake/closeMake fee accounting
**Root cause:** Vault rebalance logic does not account for position/maker fees when equalizing collateral across long and short products, so each sync leaves an imbalance that triggers another sync, each paying a fee.
**Steps:**
1. Configure a market where long product makerFee=0% and short product makerFee=10%.
2. Vault holds 50 long / 50 short positions with 50-50 collateral.
3. Deposit 100 assets: vault adds 50 to each product collateral and opens to 1x leverage.
4. Long matches at 100; short openMake charges 5 fee leaving short collateral 95 vs long 100.
5. Imbalance triggers `sync()`; positions reduced to 97.5 each, but short closeMake charges 0.25 leaving 97.25 vs 97.5.
6. Repeat sync() calls; each cycle pays redundant maker fees, converging slowly while draining vault collateral.
**How found:** Code review of BalancedVault sync/rebalance and Product openMake/closeMake fee logic; noticed fee is charged on each rebalance and not accounted for, causing persistent imbalance and repeated syncs.
**Exploitation:** Attacker (or any maker) repeatedly calls sync()/rebalance on the vault when long/short maker fees differ, forcing the vault to pay maker fees on each open/close; fees accrue to makers who share in them, extracting value from vault depositors.
**Escalation:** Larger collateral imbalance (directional exposure or high makerFee) increases fee paid per rebalance; multiple markets compound losses.
**Insight:** When auditing vault/rebalancer logic, check whether per-action fees (maker/taker) are modeled in the equalization math; any fee not subtracted from target collateral creates a residual imbalance that re-triggers rebalancing and leaks funds each cycle.
