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 9175402 commit e682299Copy full SHA for e682299
programs/drift/src/state/lp_pool.rs
@@ -980,10 +980,10 @@ impl Constituent {
980
let token_amount = self.get_full_token_amount(spot_market)?;
981
let max_transfer = if token_amount < 0 {
982
self.max_borrow_token_amount
983
- .saturating_sub(token_amount.cast::<u64>()?)
+ .saturating_sub(token_amount.abs().cast::<u64>()?)
984
} else {
985
986
- .saturating_add(token_amount.cast::<u64>()?)
+ .saturating_add(token_amount.abs().cast::<u64>()?)
987
};
988
989
Ok(max_transfer)
0 commit comments