Read the active fee of a dynamic Uniswap v4 pool

For a dynamic-fee pool the fee field in the pool key is a mode flag. Dividing that raw field by a fee denominator produces a misleading dashboard percentage.

Separate pool identity from current pricing

Check whether the key fee equals the dynamic-fee flag defined by LPFeeLibrary. For a dynamic pool, read its current LP fee from pool state at the desired block. Fee amounts are expressed in hundredths of a basis point.

pool key fee = 0x800000
current LP fee = 3000 → 0.30%

In the example the key remains 0x800000 while the stored current fee is 3000, or 0.30 percent. Updating the stored fee does not create a new pool ID because the key still carries the same mode flag.

Inspect swap-specific overrides

A permitted hook can supply a fee override for a particular swap under the protocol rules. The stored fee at the end of the block is therefore insufficient to explain every earlier swap in that block. Inspect the actual swap event and hook behavior when reconciling a transaction. github.com LPFeeLibrary.sol