How A Uniswap v4 beforeSwap hook just cost Goldpesatoken about $115K USDC.
GPXHooks rebalances protocol-owned GPX/USDC liquidity inside beforeSwap. Once an hour has passed, any swap can trigger it.
The attacker minted a position through the shared PositionManager and never settled it, so the USDC delta was not zero when the hook ran.
reBalance burned the hook’s real position and TAKE_PAIR’d the credit but that credit was netted against the open debt.
The hook kept about $34K. The attacker cleared the debt and took about $115K USDC from the PoolManager.