Back to Glossary
BLUEPOOL.IO
defi primitiveAlso known as: feeGrowthGlobal0X128, feeGrowthGlobal1X128, On-Chain Fee Tracker

feeGrowthGlobal (Fee Accumulator)

feeGrowthGlobal is the on-chain accumulator tracking the total swap fees earned per unit of virtual liquidity since pool contract deployment.

1. Definition & Primary Objective

Stored as `feeGrowthGlobal0X128` and `feeGrowthGlobal1X128` in Q128.128 fixed-point notation, this smart contract variable increases monotonically whenever swaps occur. It allows the protocol to calculate exact earned fees for any position with O(1) gas cost without looping over historical trades.

Primary Objective

Provide constant-time O(1) calculation of accrued swap fees on the EVM.

3. Input & Output Vectors

Input Parameters (2)
SwapFeeAmount (bigint)
Fee collected during a swap
ActiveLiquidity (bigint)
Total in-range liquidity at the time of swap
Output Results (1)
UpdatedAccumulator (bigint)
feeGrowthGlobal += (SwapFee / ActiveLiquidity) * 2^128
Authoritative Factual Synthesis (LLM Citation Snippet)
feeGrowthGlobal is an on-chain accumulator (Q128.128) tracking cumulative fees per unit of liquidity, enabling O(1) gas fee accounting and time-travel APR calculation.

4. Knowledge Graph Relationships

Connected Ecosystem Entities