Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Fee Growth

Fee growth is a per-liquidity-unit accumulator that tracks the total fees earned by liquidity in an AMM pool since inception, used to calculate a specific position's unclaimed fees.
Chainscore © 2026
definition
DEFINITION

What is Fee Growth?

Fee Growth is a core metric in Automated Market Maker (AMM) liquidity pools that tracks the cumulative fees earned per unit of liquidity over time.

Fee Growth is a precise, per-liquidity-unit accounting mechanism used in concentrated liquidity AMMs like Uniswap V3. It represents the total amount of trading fees that have accrued to a single unit of virtual liquidity (L) within a specific price range since the pool's inception. This value is stored as two global state variables: feeGrowthGlobal0X128 and feeGrowthGlobal1X128, which track fees in each of the pool's two tokens. The "X128" suffix indicates these values are stored as fixed-point numbers with 128 bits of fractional precision, allowing for extremely fine-grained accumulation without rounding errors.

The primary function of fee growth is to enable fair and gas-efficient fee distribution to individual liquidity providers (LPs). When an LP adds liquidity at a specific tick range, the contract snapshots the current global fee growth values. Later, when the LP removes their liquidity or collects fees, the contract calculates the difference between the current global fee growth and the snapshotted values. This difference, multiplied by the amount of liquidity (L) the LP provided, determines the exact fee amount owed to that position, irrespective of when other LPs entered or exited.

Fee growth is updated during every swap that crosses a populated tick. The fees paid by the trader are converted into additional liquidity and are used to increment the global feeGrowthGlobal variables. This design ensures fees are continuously compounded back into the pool and allocated proportionally to in-range liquidity. Crucially, fees are only earned by liquidity positioned within the current market price tick; liquidity outside the active price range has its fee growth snapshots updated but does not accrue new fees until the price moves back into its range.

Understanding fee growth is essential for analyzing LP profitability and pool dynamics. Key derived metrics include Fee Growth Inside, which calculates the fee growth specific to a position's price range, accounting for periods when the price was outside that range. This system eliminates the need for frequent, costly transactions to harvest or reinvest fees, as they are accounted for continuously in the pool's state. It represents a significant evolution from the simpler, pro-rata fee distribution model used in constant product AMMs like Uniswap V2.

key-features
FEE GROWTH

Key Features

Fee growth is a core DeFi mechanism that tracks the accumulation of trading fees within a concentrated liquidity position over time, enabling precise reward calculations for liquidity providers.

01

Per-Liquidity Accumulation

Fee growth is tracked as a global accumulator for each pool, measured in fees per unit of virtual liquidity (feeGrowthGlobal). When a position is active, it captures the difference in this accumulator between entry and exit. This method ensures fees are allocated proportionally to the amount and duration of liquidity supplied, without requiring constant on-chain updates.

02

Tick-Based Accounting

In concentrated liquidity AMMs like Uniswap V3, fee growth is tracked at the tick level. Each tick maintains its own feeGrowthOutside value. A position's earned fees are calculated by summing the fee growth inside its specific price range (tickLower to tickUpper), isolating rewards to the exact price interval where capital was at risk.

03

Out-of-Range Liquidity

A key feature is that liquidity outside a position's active range does not earn fees. The fee growth accumulator for those ticks is stored but not credited to the inactive position. This creates a direct, granular link between capital efficiency and fee generation, incentivizing LPs to place liquidity where trading activity is highest.

04

Claimable Fees Calculation

The total claimable fees for a position are calculated using the formula: fees = liquidity * (feeGrowthInside - feeGrowthInsideLast) Where:

  • liquidity: The amount of liquidity in the position.
  • feeGrowthInside: Current cumulative fees per liquidity unit inside the range.
  • feeGrowthInsideLast: The value recorded when liquidity was last added/removed or fees were last collected.
05

Gas Efficiency via Deferral

The system is gas-efficient because fees accumulate passively without writing to storage on every trade. Updates occur only during state-changing actions for a position: minting, burning, adding liquidity, or collecting fees. This defers computation and cost until the LP actively interacts with their position.

06

Comparison to v2 Fee Model

Contrasts with the Uniswap V2 model, where fees automatically compound back into the pool's liquidity, increasing all LP's share value proportionally. Fee growth enables active management: fees are stored as separate tokens (e.g., USDC, ETH) and must be manually collected, allowing LPs to decide how to reinvest or use their earnings.

how-it-works
UNISWAP V3 MECHANICS

How Fee Growth Works

Fee growth is a core accounting mechanism in concentrated liquidity Automated Market Makers (AMMs) like Uniswap V3, which tracks the accumulation of trading fees for each individual liquidity position.

Fee growth is a per-liquidity-unit accumulator that records the total amount of fees earned by all liquidity within a specific price range over time. It is represented by two global state variables, feeGrowthGlobal0X128 and feeGrowthGlobal1X128, which store the total fees accrued per unit of virtual liquidity (L) for each token in the pool, scaled by 2¹²⁸ for precision. When a trade occurs, the fee paid by the trader is divided by the current active liquidity (L) at the tick and added to these global accumulators. This creates a continuously increasing benchmark that individual positions reference to calculate their share.

Each liquidity position stores its own snapshot of the global fee growth values at the time of deposit or last interaction, known as feeGrowthInside0LastX128 and feeGrowthInside1LastX128. To calculate the uncollected fees for a position, the protocol subtracts the position's stored snapshot from the current global fee growth inside its specific price range. This difference, multiplied by the position's amount of liquidity (l), yields the total fees earned. The formula is: feesEarned = (feeGrowthInside_now - feeGrowthInside_last) * liquidity_position.

The key innovation is that fee accrual is passive and gas-efficient. Fees are not automatically sent to liquidity providers (LPs) with each trade; instead, the feeGrowth variables are updated, and the owed amount is calculated on-chain only when an LP calls collect(). This deferred settlement minimizes gas costs for traders. The system ensures precise, pro-rata distribution based on the amount and concentration of liquidity provided, rewarding LPs in direct proportion to their contribution to swap execution within the active price range.

ecosystem-usage
FEE GROWTH

Ecosystem Usage

Fee growth is a core DeFi mechanism for tracking accumulated fees within a liquidity pool, enabling precise calculation of a liquidity provider's share of earnings. It is a foundational concept for automated market makers (AMMs) like Uniswap V3.

01

Core Calculation: Fees per Liquidity Unit

Fee growth is measured as the amount of fees (in token units) earned per unit of virtual liquidity (L) since the pool's inception. It is stored as two global state variables: feeGrowthGlobal0X128 and feeGrowthGlobal1X128. These values accumulate independently for each token in the pair, scaled by 2¹²⁸ for precision. When a swap generates a fee, it is divided by the current total liquidity L and added to these global accumulators.

02

Tracking Individual LP Positions

To determine a specific liquidity provider's (LP) earnings, the protocol tracks fee growth outside and inside each position. When liquidity is deposited or withdrawn, the contract snapshots the current global fee growth. The fees owed to an LP are calculated as: Fees_owed = (feeGrowth_global - feeGrowth_outside) * position_liquidity This design ensures fees are accurately attributed even as liquidity is added or removed by others.

03

Concentrated Liquidity & Tick Accounting

In concentrated liquidity AMMs (e.g., Uniswap V3), fee growth is tracked per tick. Each tick boundary stores feeGrowthOutside0X128 and feeGrowthOutside1X128. This granular accounting is essential because liquidity (and thus fee accumulation) is not uniform across the entire price curve. To calculate fees for a position spanning multiple ticks, the protocol sums the fee growth inside its price range, excluding growth that occurred outside of it.

04

Claiming Accumulated Fees

Fees are not automatically distributed; they compound within the pool as increased fee growth values. An LP must initiate a transaction to claim their fees, which triggers the fee calculation and mints the corresponding token amounts. Common claiming actions include:

  • Collecting fees while keeping the position open.
  • Withdrawing liquidity, which automatically claims any accrued fees.
  • Adjusting a position's range or liquidity amount.
06

Analytics & Fee Yield Metrics

Fee growth data is critical for on-chain analytics to calculate Annual Percentage Yield (APY) and compare pool profitability. Analysts monitor:

  • Fee Growth Rate: The increase in feeGrowthGlobal over time, indicating pool activity.
  • Fee APR: (Δ feeGrowth / L) * 365 * 100.
  • Position-Level ROI: Fees earned relative to the capital deposited. This data drives liquidity provider strategies and capital allocation decisions across different pools and price ranges.
security-considerations
FEE GROWTH

Security & Design Considerations

Fee growth is a critical mechanism in concentrated liquidity protocols like Uniswap V3. It tracks the accumulation of fees per unit of liquidity over time, directly impacting capital efficiency and security.

01

Accumulation Mechanism

Fee growth is stored as two global, ever-increasing 128-bit values: feeGrowthGlobal0X128 and feeGrowthGlobal1X128. These values represent the total fees earned per unit of virtual liquidity (L) for each token since the pool's inception. When a position is active, it captures the difference in these global values between the time of deposit and withdrawal to calculate its earned fees. This design ensures fees are allocated pro-rata to liquidity providers based on their share and the duration their capital was at risk.

02

Arithmetic Precision & Overflow

The use of 128-bit fixed-point numbers for fee growth is a deliberate security and precision choice.

  • Precision: Multiplying by 2^128 allows for extremely fine-grained tracking of fees per liquidity unit without floating-point errors.
  • Overflow Safety: The values are designed to overflow only after millennia of continuous operation at maximum transaction volume, making the risk negligible. This is a classic example of safe smart contract arithmetic using checked math libraries to prevent exploits.
03

Position-Specific Accounting

Each liquidity position stores its own feeGrowthInside0LastX128 and feeGrowthInside1LastX128. These snapshots record the fee growth values specific to its price tick range at the time of the last interaction. To claim fees, the contract calculates: feesEarned = (feeGrowthInsideNow - feeGrowthInsideLast) * positionLiquidity / 2^128 This design ensures accurate and fair distribution even as liquidity moves in and out of different price ranges, preventing fee leakage or miscalculation.

04

Impact on Capital Efficiency

Fee growth is the metric that enables concentrated liquidity. By allowing LPs to target specific price ranges, the fee earnings per unit of capital (L) are amplified within that range compared to full-range liquidity. Higher fee growth in a range signals greater trading volume and competition for that price space. This creates a dynamic market for liquidity provision, aligning LP incentives with trader demand and optimizing overall capital efficiency in the Automated Market Maker (AMM).

05

Oracle Security Implications

The feeGrowthGlobal accumulators are manipulation-resistant data points that can be used by time-weighted average price (TWAP) oracles. While the current price is easy to manipulate in a single block, significantly altering the long-term fee growth rate requires sustained, economically irrational trading. This makes fee growth a potentially useful secondary signal for on-chain security and derivative protocols that need to assess genuine, long-term pool activity rather than transient price spikes.

06

Cross-Tick Complexity & Gas

Calculating feeGrowthInside for a position requires reading the fee growth accumulators at the lower tick, upper tick, and globally. This involves multiple storage reads and fixed-point arithmetic. While secure, this complexity contributes to higher gas costs for minting, modifying, or burning positions compared to simpler AMM designs. Protocol designers must balance this accounting overhead against the benefits of concentrated liquidity and precise fee distribution.

FEE GROWTH

Common Misconceptions

Fee growth is a core DeFi mechanism for tracking fees in liquidity pools, but its behavior is often misunderstood. This section clarifies how fees are calculated, accrued, and collected.

Fee growth is a cumulative, per-liquidity-unit counter that tracks the total fees earned by liquidity providers (LPs) in an Automated Market Maker (AMM) pool since its inception. It does not represent a direct token balance. When a swap occurs, a protocol fee (e.g., 0.3%) is added to the pool's reserves, and the corresponding fee growth global variables (feeGrowthGlobal0X128 and feeGrowthGlobal1X128 for a two-token pool) are incremented proportionally. Each liquidity position records the fee growth values at the time of deposit (feeGrowthInside0LastX128, feeGrowthInside1LastX128). The fees claimable by an LP are calculated by comparing the current global fee growth inside their position's price range to these stored values, multiplied by their share of liquidity.

solidity
// Simplified fee calculation for a position
uncollectedFees = liquidity * (feeGrowthNow - feeGrowthLast) / 2**128

This design allows fees to be tracked off-chain without constant on-chain updates, optimizing gas efficiency.

FEE GROWTH

Technical Deep Dive

Fee growth is a core DeFi primitive for tracking accumulated fees within concentrated liquidity positions. This section dissects its mechanics, calculation, and application across major protocols.

Fee growth is a cumulative, per-liquidity-unit counter that tracks the total amount of fees earned by liquidity in a specific price range over time. It is not a direct token balance but an accounting variable. The core calculation for a token (e.g., token0) is:

solidity
feeGrowthGlobal0X128 += (feeAmount * 2**128) / totalLiquidity

Where feeAmount is the total fees collected in that token, and totalLiquidity is the overall liquidity in the pool. The use of a 128.128 fixed-point number (2**128 multiplier) provides high precision without floating-point math. An individual position's uncollected fees are calculated by tracking the difference between the global feeGrowth when liquidity was deposited and the current global feeGrowth, multiplied by the position's liquidity share.

FEE GROWTH

Frequently Asked Questions

Fee growth is a core DeFi mechanism for tracking and distributing trading fees in automated market makers (AMMs). These questions address its calculation, purpose, and impact on liquidity providers.

Fee growth is a cumulative, per-liquidity-unit counter that tracks the total fees earned by a liquidity position within a specific price range in a concentrated liquidity AMM like Uniswap V3. It works by incrementing two global variables—feeGrowthGlobal0X128 and feeGrowthGlobal1X128—each time a swap occurs. These variables accumulate fees in a fixed-point format scaled by 2^128. When a liquidity provider (LP) deposits or modifies their position, the protocol snapshots the current global fee growth. The fees owed to that position are calculated later by comparing the difference between the global fee growth at withdrawal and the snapshot taken at deposit, multiplied by the amount of liquidity the position contributed.

Key Mechanism:

  • Global Trackers: Store total fees earned per unit of virtual liquidity.
  • Position Snapshots: Record the tracker values when liquidity is added (feeGrowthInside0LastX128, feeGrowthInside1LastX128).
  • Fee Calculation: Fees owed = (Current Growth - Snapshot Growth) * Position Liquidity.
ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Fee Growth: Definition & AMM Pool Mechanics | ChainScore Glossary