5/5
### When is `claim_admin_fees` Called? The internal function `claim_admin_fees` is called when the functions `add_liquidity`, `remove_liquidity` or `remove_liquidity_one_coin` are called. This function claims the fees that have been collected, and mints LP shares based on the amount of fees claimed. Because it mints LP shares, this increases the total supply, which will affect the virtual price. Claiming admin fees will also affect the state variable D and the state variables that are used to track the growth of the pool. These two state variables are `xcp_profit` and `xcp_profit_a`. The variable `xcp_profit_a` stores the `xcp_profit` value after the last time `claim_admin_fees` was called. These are the external functions that call the internal function `claim_admin_fees` and some of the state variables that are updated when this function is called.
claim_admin_fees
Called?The internal function claim_admin_fees
is called when the functions add_liquidity
, remove_liquidity
or remove_liquidity_one_coin
are called. This function claims the fees that have been collected, and mints LP shares based on the amount of fees claimed. Because it mints LP shares, this increases the total supply, which will affect the virtual price.
Claiming admin fees will also affect the state variable D and the state variables that are used to track the growth of the pool. These two state variables are xcp_profit
and xcp_profit_a
. The variable xcp_profit_a
stores the xcp_profit
value after the last time claim_admin_fees
was called.
These are the external functions that call the internal function claim_admin_fees
and some of the state variables that are updated when this function is called.
Learn when claim_admin_fees is triggered and how it impacts LP supply, virtual price, D, and xcp-based growth tracking.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
AMM math for Curve Cryptoswap
How liquidity is concentrated
Price-repegging
How function calls interact with the AMM
Curve Cryptoswap state variables
How the function exchange works
How to swap tokens
How to add and remove liquidity
Math for Curve Cryptoswap’s internal price oracle
Implicit differentiation
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 August 11, 2025
Duration: 4min
Duration: 1h 21min
Duration: 28min
Duration: 26min
Duration: 14min
Duration: 24min
Duration: 59min
Duration: 5min
Course Overview
About the course
AMM math for Curve Cryptoswap
How liquidity is concentrated
Price-repegging
How function calls interact with the AMM
Curve Cryptoswap state variables
How the function exchange works
How to swap tokens
How to add and remove liquidity
Math for Curve Cryptoswap’s internal price oracle
Implicit differentiation
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 August 11, 2025