Manipulation analysis

How we judge whether a TWAP market can be profitably manipulated: the cost of holding the pool off its fair price for the window, against the most the manipulator can win.

Move the poolPush the v4 pool X% away from fair value. The clamp limits each sample to 2%, so a large move takes several samples to show.
Hold it 30 minutesThe TWAP only follows a move held over its window. Arbitrage trades against the manipulator the whole time.
Profit is cappedThe manipulator wins at most what positions in that market can pay, bounded by the open-interest and depth caps.
Attack cost grows with depth and with time held. The gain is capped by open interest.

Method

For a pool with in-range depth D, moving the price by X% costs roughly the swap needed to cross that liquidity, and every arbitrageur who trades it back adds to the cost while the move is held. The TWAP is averaged over 30 minutes, so the manipulator pays that cost for the whole window, not for one block.

The gain side is bounded by the market itself. Long open interest notional is capped at a share of D (1% to 20%, the deployer's choice) and by the open-interest cap. A manipulator who moves the mark by X% can extract at most about X% of the open interest on the other side.

A market is sound when, for every X the clamp allows over the window, the cost of holding the move exceeds the maximum gain. The table below applies this to live pools.

Numbers

PoolDepthMove heldCost for 30 minMax gain (OI cap)
USDC/WHYPE v4$1502%$1$1
USDC/WHYPE v4$1505%$5$2
USDC/WHYPE v4$15010%$21$3