# Fee receiver does not get paid when collateral is enough to cover the funding fee, during liquidation

In GMX Synthetics liquidation, when collateral covers the funding fee, getLiquidationValues returns empty fees and skips paying the fee receiver its share.

- Payout: Contest reward
- Severity: medium
- Program: Gmx
- Credited: IllIllI
- Disclosed: 2022-09-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-02-gmx-judging/issues/146
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-02-gmx%3AM-26
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** DecreasePositionCollateralUtils.getLiquidationValues in gmx-synthetics
**Root cause:** The liquidation branch assigns all remaining collateral to the pool and returns an uninitialized PositionFees struct, so the fee receiver's portion of position fees is never paid.
**Steps:**
1. Read `DecreasePositionCollateralUtils.getLiquidationValues()` around L342-L372.
2. Observe the else branch sets `values.pnlAmountForPool = collateralAmount - fundingFeeAmount` and returns `_fees` uninitialized.
3. Caller exits early after getLiquidationValues, skipping the fee-receiver payment logic at L216-L258.
4. Liquidate a position whose collateral covers the funding fee and confirm fee receiver receives nothing.
**How found:** Code review of the liquidation branch: noticed `_fees` declared but never populated and an early return bypassing the fee-receiver payout path.
**Insight:** When auditing liquidation/fee-splitting code, check every early-return branch for structs declared but never initialized; an empty fees struct silently zeroes out fee-receiver accounting.
