Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rate_model): increase MAX jump rate and full rate #1233

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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