Operation Fee Calculation
When an operator submits a deposit_strategy
or withdraw_strategy
transaction (i.e., when assets are rebalanced between lending protocols), we call this the rebalance crank.
A fee is collected to the fee_vault every time the operator sends a rebalance crank. This fee is paid in vault LP SPL tokens and can be seen at the fee_vault address.
Currently, we charge 5% of profit as the operation (performance) fee.
Variables
Before rebalance:
vault.total_amount
:lp_mint.total_supply
:- Virtual price (value of LP token):
After rebalance:
vault.total_amount
:lp_mint.total_supply
:- Virtual price:
Fee Calculation
We charge an operation fee:
Adjusting Virtual Price After Fee
After deducting the fee, the virtual price becomes:
However, the vault does not send tokens directly to the treasury token account (since it may not have enough liquidity). Instead, the vault mints additional LP tokens for the fee_vault.
Let be the number of new LP tokens minted for the fee. The new virtual price is:
We want the virtual price after fee to remain the same, so set :
Solving for
Rearranging the equation above, we get:
Or, substituting :
Which simplifies to:
Summary:
- The operation fee is 5% of the profit from each rebalance crank.
- The fee is paid by minting new LP tokens to the fee_vault, not by transferring underlying assets.
- The number of LP tokens minted is calculated to ensure the virtual price for LP holders remains consistent after the fee is taken.