diff --git a/programs/drift/src/math/margin.rs b/programs/drift/src/math/margin.rs index 580f82679..110ce000d 100644 --- a/programs/drift/src/math/margin.rs +++ b/programs/drift/src/math/margin.rs @@ -270,18 +270,13 @@ pub fn calculate_margin_requirement_and_total_collateral_and_liability_info( spot_market.get_max_confidence_interval_multiplier()?, )?; - let mut skip_token_value = false; - if !(user_pool_id == 1 && spot_market.market_index == 0 && !spot_position.is_borrow()) { - validate!( - user_pool_id == spot_market.pool_id, - ErrorCode::InvalidPoolId, - "user pool id ({}) == spot market pool id ({})", - user_pool_id, - spot_market.pool_id, - )?; - } else { - skip_token_value = true; - } + validate!( + user_pool_id == spot_market.pool_id, + ErrorCode::InvalidPoolId, + "user pool id ({}) == spot market pool id ({})", + user_pool_id, + spot_market.pool_id, + )?; let oracle_valid = is_oracle_valid_for_action(oracle_validity, Some(DriftAction::MarginCalc))?; @@ -322,10 +317,6 @@ pub fn calculate_margin_requirement_and_total_collateral_and_liability_info( token_value = 0; } - if skip_token_value { - token_value = 0; - } - calculation.add_total_collateral(token_value)?; calculation.update_all_deposit_oracles_valid(oracle_valid);