Mechanic
How TRACE works
Every swap leaves a TRACE. The contract remembers whether the previous trade was a BUY or a SELL, and that state decides the fee applied to the next trader. After every swap the state updates automatically — the rule highlighted below is the one the market is standing on right now.
BUY→BUY
0.5%
Buy fee
SELL→BUY
1%
Buy fee
BUY→SELL
3%
Sell fee
SELL→SELL
1%
Sell fee
Trace chain · last six swaps
Newest BUY
01 · Swap
A trader hits the TRACE / ETH pool. The v4 hook intercepts the swap before it settles.
02 · Read memory
The hook reads the stored side of the previous swap and picks the fee from the matrix above.
03 · Write memory
The swap executes, the fee is routed to holders, and the state is overwritten for the next trader.