There's a separate APY value for lender and borrower:
struct ApyResponse {
/// If market conditions remain exactly the same for the next year, how much % interest will a borrower have to pay?
borrower: Decimal,
/// If market conditions remain exactly the same for the next year, how much % interest will a lender earn?
lender: Decimal,
}
They are different because of:
utilisation - a borrower pays interest for 100% of what they borrow, but a lender only earns interest for a part of their deposits that are actually lended out to someone
reserve factor - affects what a lender earns, but not what a borrower pays
Description
We want to provide a query for APY.
There's a separate APY value for lender and borrower:
They are different because of:
Math
We calculate the multipliers in
calculate_interest
in a similar way - we could probably just reuse that.Bonus points
Bonus points for verifying this math makes sense.