From a2154ff63cd79dd20ae0e506236969d045ebf50a Mon Sep 17 00:00:00 2001 From: bartosz-lipinski <264380+bartosz-lipinski@users.noreply.github.com> Date: Tue, 5 Jan 2021 23:36:35 -0600 Subject: [PATCH] feat: add fees to layout --- src/models/lending/reserve.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/models/lending/reserve.ts b/src/models/lending/reserve.ts index 8f8542d..3c654ab 100644 --- a/src/models/lending/reserve.ts +++ b/src/models/lending/reserve.ts @@ -40,6 +40,17 @@ export const LendingReserveLayout: typeof BufferLayout.Structure = BufferLayout. BufferLayout.u8('optimalBorrowRate'), /// Max borrow APY BufferLayout.u8('maxBorrowRate'), + + /// Fee assessed on `BorrowReserveLiquidity`, 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 + BufferLayout.uint64('borrowFeeWad'), + + /// Amount of fee going to host account, if provided in liquidate and repay + BufferLayout.u8('hostFeePercentage'), ], 'config' ), @@ -75,6 +86,9 @@ export interface LendingReserve { minBorrowRate: number; optimalBorrowRate: number; maxBorrowRate: number; + + borrowFeeWad: BN; + hostFeePercentage: number; }; cumulativeBorrowRateWad: BN;