# Market coordinator can steal all market collateral by changing adiabatic fees

Perennial market coordinator sets adiabatic fees to 0, opens maker/taker positions, then maxes fees and closes to drain all market collateral via owner exposure.

- Payout: Audit contest
- Severity: high
- Program: Perennial
- Found by: panprog
- Disclosed: 2024-08-17
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2024-08-perennial-v2-update-3-judging/issues/27
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-perennial-v2-update-3%3AH-1
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:governance

**Target:** Perennial V2 Market contract / risk parameter update
**Root cause:** Adiabatic fee changes alter global exposure which is owed by the market owner; coordinator controls these fees and can shift exposure to drain collateral.
**Steps:**
1. Coordinator calls `updateRiskParameter` setting adiabaticFee=0, other fees=0, large makerLimit
2. Open large maker position (user) and large taker position (userB) paying 0 adiabatic fees
3. Wait one oracle version to settle positions
4. Coordinator calls `updateRiskParameter` setting adiabaticFee to max (e.g. 1%)
5. Close taker position and settle, then close maker position and settle
6. Withdraw all collateral from both accounts; global exposure becomes negative owed by owner
**How found:** Researcher read README's stated acceptable-risk question about coordinator parameter control and reasoned that adiabatic fee changes shift owner exposure, then built a PoC test demonstrating the drain.
**Exploitation:** Malicious coordinator zeroes adiabatic fees, opens matched maker/taker positions, then raises adiabatic fee to max and closes the taker to collect the fee, pushing a large negative exposure onto the owner and withdrawing more collateral than deposited, draining the market.
**Escalation:** Repeat the cycle until all market collateral is stolen; alternative front-run by user anticipating fee increase.
**Insight:** When a privileged role can change fee/risk parameters that feed into a global exposure or PnL accumulator settled against the protocol owner, check whether toggling parameters between open and close lets the role extract value from the owner's balance.

