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 25b818a commit e530b52Copy full SHA for e530b52
programs/drift/src/controller/insurance.rs
@@ -1098,6 +1098,14 @@ pub fn handle_if_end_swap(
1098
if_rebalance_config.epoch_max_in_amount
1099
)?;
1100
1101
+ validate!(
1102
+ if_rebalance_config.current_in_amount <= if_rebalance_config.total_in_amount,
1103
+ ErrorCode::InvalidIfRebalanceSwap,
1104
+ "current_in_amount={} > total_in_amount={}",
1105
+ if_rebalance_config.current_in_amount,
1106
+ if_rebalance_config.total_in_amount
1107
+ )?;
1108
+
1109
let oracle_twap = out_spot_market
1110
.historical_oracle_data
1111
.last_oracle_price_twap;
0 commit comments