Skip to content

program: multi-piecewise-interest-rate-curve #1560

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

Merged
merged 13 commits into from
May 28, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- program: multi piecewise interest rate curve ([#1560](https://github.com/drift-labs/protocol-v2/pull/1560))
- sdk: fees and max perp trade size calculation functions allow an optional parameter for a user using bitFlags to enter high leverage mode

### Fixes
Expand Down
6 changes: 3 additions & 3 deletions programs/drift/src/controller/amm/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ fn update_pool_balances_test() {
market.pnl_pool.balance_type(),
)
.unwrap();
assert_eq!(pnl_pool_token_amount, 1_650_000_000 + 3);
assert_eq!(amm_fee_pool_token_amount, 16_666_666);
assert_eq!(pnl_pool_token_amount, 3_300_000_000 + 3);
assert_eq!(amm_fee_pool_token_amount, 33333333);

// negative fee pool
market.amm.total_fee_minus_distributions = -8_008_123_456;
Expand All @@ -539,7 +539,7 @@ fn update_pool_balances_test() {
market.pnl_pool.balance_type(),
)
.unwrap();
assert_eq!(pnl_pool_token_amount, 665678880);
assert_eq!(pnl_pool_token_amount, 2332345547);
assert_eq!(amm_fee_pool_token_amount, 0);
}

Expand Down
8 changes: 4 additions & 4 deletions programs/drift/src/controller/orders/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8056,7 +8056,7 @@ pub mod fulfill_spot_order_with_match {
)
.unwrap();

assert_eq!(base_filled, 166666666);
assert_eq!(base_filled, 333333333);
}

#[test]
Expand Down Expand Up @@ -8252,7 +8252,7 @@ pub mod fulfill_spot_order_with_match {
)
.unwrap();

assert_eq!(base_filled, 166666660);
assert_eq!(base_filled, 333333330);
}

#[test]
Expand Down Expand Up @@ -8450,7 +8450,7 @@ pub mod fulfill_spot_order_with_match {
)
.unwrap();

assert_eq!(base_filled, 166666660);
assert_eq!(base_filled, 333333330);
}

#[test]
Expand Down Expand Up @@ -8646,7 +8646,7 @@ pub mod fulfill_spot_order_with_match {
)
.unwrap();

assert_eq!(base_filled, 166666666);
assert_eq!(base_filled, 333333333);
}

#[test]
Expand Down
Loading
Loading