From ffe29eb9f1a987a94830b6fa96c5359c8952f5e6 Mon Sep 17 00:00:00 2001 From: Nope X Date: Thu, 26 May 2022 22:05:56 -0700 Subject: [PATCH] adding more high rate cases --- token-lending/program/src/state/reserve.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/token-lending/program/src/state/reserve.rs b/token-lending/program/src/state/reserve.rs index 34a8e6315bb..f5ba8410453 100644 --- a/token-lending/program/src/state/reserve.rs +++ b/token-lending/program/src/state/reserve.rs @@ -107,6 +107,10 @@ impl Reserve { 253u8 => rate.try_mul(8)?, //400% 254u8 => rate.try_mul(10)?, //500% 255u8 => rate.try_mul(12)?, //600% + 250u8 => rate.try_mul(20)?, //1000% + 249u8 => rate.try_mul(30)?, //1500% + 248u8 => rate.try_mul(40)?, //2000% + 247u8 => rate.try_mul(50)?, //2500% _ => Rate::from_percent(self.config.max_borrow_rate), }); } @@ -1070,7 +1074,7 @@ mod test { ..Reserve::default() }; - if !(optimal_borrow_rate >250 && optimal_borrow_rate == max_borrow_rate) { + if !(optimal_borrow_rate > 246 && optimal_borrow_rate == max_borrow_rate) { let current_borrow_rate = reserve.current_borrow_rate()?; assert!(current_borrow_rate >= Rate::from_percent(min_borrow_rate)); assert!(current_borrow_rate <= Rate::from_percent(max_borrow_rate));