Skip to content

Commit

Permalink
fix lp burn
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Jan 18, 2024
1 parent 3526c7c commit e60fa05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions programs/drift/src/controller/orders.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::cell::RefMut;
use std::collections::BTreeMap;
use std::ops::DerefMut;
use std::ops::{DerefMut, Div};
use std::u64;

use anchor_lang::prelude::*;
Expand Down Expand Up @@ -2892,7 +2892,7 @@ pub fn burn_user_lp_shares_for_risk_reduction(
let order_step_size = market.amm.order_step_size;

let lp_shares_to_burn =

Check warning on line 2894 in programs/drift/src/controller/orders.rs

View check run for this annotation

Codecov / codecov/patch

programs/drift/src/controller/orders.rs#L2894

Added line #L2894 was not covered by tests
standardize_base_asset_amount(lp_shares, order_step_size)?.max(lp_shares);
standardize_base_asset_amount(lp_shares.div(3), order_step_size)?.max(lp_shares);

let (position_delta, pnl) = burn_lp_shares(
&mut user.perp_positions[position_index],
Expand Down

0 comments on commit e60fa05

Please sign in to comment.