Skip to content

Commit

Permalink
Merge pull request #1233 from spazcoin/fix/expandMaxJumpModelRates
Browse files Browse the repository at this point in the history
fix(rate_model): increase MAX jump rate and full rate
  • Loading branch information
sander2 authored Sep 3, 2024
2 parents 3388c26 + adbb2c5 commit b34a447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/loans/src/rate_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ pub struct JumpModel {

impl JumpModel {
pub const MAX_BASE_RATE: Rate = Rate::from_inner(100_000_000_000_000_000); // 10%
pub const MAX_JUMP_RATE: Rate = Rate::from_inner(300_000_000_000_000_000); // 30%
pub const MAX_FULL_RATE: Rate = Rate::from_inner(500_000_000_000_000_000); // 50%
pub const MAX_JUMP_RATE: Rate = Rate::from_inner(1_000_000_000_000_000_000); // 100%
pub const MAX_FULL_RATE: Rate = Rate::from_inner(5_000_000_000_000_000_000); // 500%

/// Create a new rate model
pub fn new_model(base_rate: Rate, jump_rate: Rate, full_rate: Rate, jump_utilization: Ratio) -> JumpModel {
Expand Down
8 changes: 4 additions & 4 deletions crates/loans/src/tests/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ macro_rules! rate_model_sanity_check {
let mut market = MARKET_MOCK;
market.rate_model = InterestRateModel::new_jump_model(
Rate::saturating_from_rational(5, 100),
Rate::saturating_from_rational(36, 100),
Rate::saturating_from_rational(101, 100),
Rate::saturating_from_rational(37, 100),
Ratio::from_percent(80),
);
Expand All @@ -53,7 +53,7 @@ macro_rules! rate_model_sanity_check {
market.rate_model = InterestRateModel::new_jump_model(
Rate::saturating_from_rational(5, 100),
Rate::saturating_from_rational(15, 100),
Rate::saturating_from_rational(57, 100),
Rate::saturating_from_rational(501, 100),
Ratio::from_percent(80),
);
market
Expand Down Expand Up @@ -365,7 +365,7 @@ fn update_rate_model_works() {
FOREIGN_ASSET,
InterestRateModel::new_jump_model(
Rate::saturating_from_rational(5, 100),
Rate::saturating_from_rational(36, 100),
Rate::saturating_from_rational(101, 100),
Rate::saturating_from_rational(37, 100),
Ratio::from_percent(80),
)
Expand All @@ -379,7 +379,7 @@ fn update_rate_model_works() {
FOREIGN_ASSET,
InterestRateModel::new_jump_model(
Rate::saturating_from_rational(5, 100),
Rate::saturating_from_rational(15, 100),
Rate::saturating_from_rational(501, 100),
Rate::saturating_from_rational(57, 100),
Ratio::from_percent(80),
)
Expand Down

0 comments on commit b34a447

Please sign in to comment.