We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61a5657 commit bcb5dedCopy full SHA for bcb5ded
programs/drift/src/state/lp_pool.rs
@@ -270,11 +270,11 @@ impl LPPool {
270
.price
271
.cast::<u128>()?
272
.safe_mul(in_amount_less_fees)?;
273
- let lp_amount = if self.last_aum == 0 {
+ let lp_amount = if dlp_total_supply == 0 {
274
token_amount_usd.safe_div(token_precision_denominator)?
275
} else {
276
token_amount_usd
277
- .safe_mul(dlp_total_supply.max(1) as u128)?
+ .safe_mul(dlp_total_supply as u128)?
278
.safe_div(self.last_aum)?
279
.safe_div(token_precision_denominator)?
280
};
0 commit comments