Struct port_variable_rate_lending_instructions::state::ReserveFees [−][src]
pub struct ReserveFees {
pub borrow_fee_wad: u64,
pub flash_loan_fee_wad: u64,
pub host_fee_percentage: u8,
}
Expand description
Additional fee information on a reserve
These exist separately from interest accrual fees, and are specifically for the program owner and frontend host. The fees are paid out as a percentage of liquidity token amounts during repayments and liquidations.
Fields
borrow_fee_wad: u64
Fee assessed on BorrowObligationLiquidity
, expressed as a Wad.
Must be between 0 and 10^18, such that 10^18 = 1. A few examples for
clarity:
1% = 10_000_000_000_000_000
0.01% (1 basis point) = 100_000_000_000_000
0.00001% (Aave borrow fee) = 100_000_000_000
flash_loan_fee_wad: u64
Fee for flash loan, expressed as a Wad.
host_fee_percentage: u8
Amount of fee going to host account, if provided in liquidate and repay
Implementations
pub fn calculate_borrow_fees(
&self,
borrow_amount: Decimal,
fee_calculation: FeeCalculation
) -> Result<(u64, u64), ProgramError>
pub fn calculate_borrow_fees(
&self,
borrow_amount: Decimal,
fee_calculation: FeeCalculation
) -> Result<(u64, u64), ProgramError>
Calculate the owner and host fees on borrow
pub fn calculate_flash_loan_fees(
&self,
flash_loan_amount: Decimal
) -> Result<(u64, u64), ProgramError>
pub fn calculate_flash_loan_fees(
&self,
flash_loan_amount: Decimal
) -> Result<(u64, u64), ProgramError>
Calculate the owner and host fees on flash loan
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ReserveFees
impl Send for ReserveFees
impl Sync for ReserveFees
impl Unpin for ReserveFees
impl UnwindSafe for ReserveFees
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more