1/5
### Fee Growth Outside Inside of Uniswap V3's code, there is a state variable called `fee growth outside`, and it's used to calculate both the `fee growth above` and `fee growth below`. In the next few videos, we'll explain how this works. In this video, we'll start by explaining how `fee growth outside` is initialized and how it's updated. Let's first start by defining some variables: `f_g` = Fee growth `f_o,i` = Fee growth outside at tick i Next, let's take a look at the algorithm. The state variable `fee growth outside` is initialized as follows: ```javascript f_o,i = f_g if i <= current tick i_c = 0 otherwise ``` This may not be obvious right away why `fee growth outside` is initialized in this way. However, in the next couple of videos, when we look at an example of how `fee growth outside` is used to calculate `fee growth above` and `fee growth below`, this will become more clear. The way that `fee growth outside` is updated is as follows: When `f_g` crosses tick i, ```javascript f_o,i = f_g - f_o,i ``` So that's how `fee growth outside` is initialized and updated. In the next couple of videos, we will see how this algorithm correctly calculates `fee growth above` and `fee growth below`.
A detailed explanation of Uniswap V3's fee growth outside mechanism. The lesson covers how Uniswap V3's fee growth outside is initialized and how it is updated during each tick.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Concentrated liquidity and derive its equations
Uniswap V3 math
How to calculate the spot price of tokens
Single and multi position swapping
Factory contract architecture
How to calculate liquidity requirements
Uniswap V3 fee algorithm
Flash loans
TWAP price oracle
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on May 15, 2025
DeFi Developer
Uniswap V3Duration: 3min
Duration: 35min
Duration: 25min
Duration: 22min
Duration: 1h 43min
Duration: 11min
Duration: 1h 03min
Duration: 12min
Duration: 51min
Duration: 41min
Duration: 10min
Duration: 7min
Course Overview
About the course
Concentrated liquidity and derive its equations
Uniswap V3 math
How to calculate the spot price of tokens
Single and multi position swapping
Factory contract architecture
How to calculate liquidity requirements
Uniswap V3 fee algorithm
Flash loans
TWAP price oracle
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on May 15, 2025