Performance fee calculation
Fee is collected to fee_vault every time the operator sends a rebalance crank. We are currently charging 5% of profit as the performance fee. Before jumping into the formula, we define some variables:
Before rebalance:
- vault.total_amount : t1
- lp_mint.total_supply: p1
- virtual_price (value of lp token): v1 =t1/p1
After rebalance:
- vault.total_amount : t2
- lp_mint.total_supply: p1
- virtual_price: v2 =t2/p1
We charge performance fee:
Virtual price after fee:
Vault doesn't send the token directly to the treasury token account (because vault may not have enough liquidity), so vault mint more lp tokens for fee_vault. Assuming vault mints more delta lp tokens, then the new virtual price:
We still ensure the virtual price in (1) and (2) are the same v21=v22, so
Then we can calculate how many lp tokens is minted more for each rebalance crank:
Or
Last modified 1mo ago