Skip to content

Commit

Permalink
program: add more logging for invalid margin ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Dec 9, 2024
1 parent e442d3f commit 2992c6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion programs/drift/src/math/margin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@ pub fn calculate_margin_requirement_and_total_collateral_and_liability_info(
validate!(
spot_position.scaled_balance == 0,
ErrorCode::InvalidMarginRatio,
"spot_position.scaled_balance={} when worst_case_token_amount={}",
"spot_position.scaled_balance={} when worst_case_token_amount={} market_index={}",
spot_position.scaled_balance,
worst_case_token_amount,
spot_market.market_index,
)?;
}

Expand Down

0 comments on commit 2992c6c

Please sign in to comment.