Skip to content

Commit

Permalink
skip logging 0 balances
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Dec 9, 2024
1 parent f51bbfa commit 32ed674
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions programs/drift/src/instructions/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ pub fn handle_log_user_balances<'c: 'info, 'info>(
msg!("Equity {}", equity);

for spot_position in user.spot_positions.iter() {
if spot_position.scale_balance == 0 {
continue;
}

let spot_market = spot_market_map.get_ref(&spot_position.market_index)?;
let token_amount = spot_position.get_signed_token_amount(&spot_market)?;
msg!("Spot position {} {}", spot_position.market_index, token_amount);
Expand Down

0 comments on commit 32ed674

Please sign in to comment.