Fees
Protocol fees are collected when add
and addLeverage
are called on a Position
contract.
How are fees calculated when add
is called?
When add
is called on a Position
contract, a small amount of the collateral token supplied is taken as a fee.
Quantity | Description |
---|---|
The amount of collateral token supplied when calling add . | |
The maximum fee the user could pay, as a percentage of . To get the current fee rate, call protocol fee rate on the FeeCollector contract. | |
The maximum fee the user could pay, in terms of the position's collateral token. | |
The percentage of that clients can keep. | |
The percentage of that the utilized client keeps. | |
The amount the utilized client keeps in terms of the position's collateral token. | |
The amount the protocol keeps. | |
The amount that users of the utilized client save. |
The following is an example calculation for a transaction where a user calls add
using a client that has set their take rate to 90%, the current client rate is 30%, and the protocol fee rate is 0.3%.
Instead of paying the maximum fee of $3.00, the user only paid $2.91.
How are fees calculated when addLeverage
is called?
When addLeverage
is called on a Position
contract, its base token is used to borrow more debt token. A small amount of the debt token borrowed is taken as a fee.
Quantity | Description |
---|---|
The total amount of collateral backing the position's loan on Aave (collaterall token + base token). Obtained by calling getUserAccountData on Aave's Pool contract (opens in a new tab). | |
The total amount of debt the position has on Aave. Obtained by calling getUserAccountData on Aave's Pool contract (opens in a new tab). | |
The maximum loan-to-value ratio the position can have, given all of its current collateral on Aave. Obtained by calling getUserAccountData on Aave's Pool contract (opens in a new tab). | |
The amount of debt token borrowed when calling addLeverage . To minimize the risk of liquidation, should be less than . | |
The maximum fee the user could pay, as a percentage of . To get the current fee rate, call protocol fee rate on the FeeCollector contract. | |
The maximum fee the user could pay, in terms of the position's debt token. | |
The percentage of that clients can keep. | |
The percentage of that the utilized client keeps. | |
The amount the utilized client keeps in terms of the position's debt token. | |
The amount the protocol keeps. | |
The amount that users of the utilized client save. |
The following is an example calculation for a transaction where a user calls addLeverage
using a client that has set their take rate to 90%, the current client rate is 30%, and the protocol fee rate is 0.3%.
Instead of paying the maximum fee of $3.00, the user only paid $2.91.