Skip to content

Commit bcb5ded

Browse files
committed
bug fixes
1 parent 61a5657 commit bcb5ded

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

programs/drift/src/state/lp_pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ impl LPPool {
270270
.price
271271
.cast::<u128>()?
272272
.safe_mul(in_amount_less_fees)?;
273-
let lp_amount = if self.last_aum == 0 {
273+
let lp_amount = if dlp_total_supply == 0 {
274274
token_amount_usd.safe_div(token_precision_denominator)?
275275
} else {
276276
token_amount_usd
277-
.safe_mul(dlp_total_supply.max(1) as u128)?
277+
.safe_mul(dlp_total_supply as u128)?
278278
.safe_div(self.last_aum)?
279279
.safe_div(token_precision_denominator)?
280280
};

0 commit comments

Comments
 (0)