diff --git a/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs b/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs index cd04dec11..430b3b0d4 100644 --- a/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs +++ b/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs @@ -28,6 +28,7 @@ pub fn token_liq_bankruptcy( // find the insurance bank token index let insurance_mint = ctx.accounts.insurance_vault.mint; + require_keys_eq!(insurance_mint, group.insurance_mint); let insurance_token_index = health_ais .iter() .find_map(|ai| { diff --git a/programs/mango-v4/src/state/group.rs b/programs/mango-v4/src/state/group.rs index 665f67b5d..f4b4c8bed 100644 --- a/programs/mango-v4/src/state/group.rs +++ b/programs/mango-v4/src/state/group.rs @@ -12,11 +12,6 @@ pub type TokenIndex = u16; /// incorrect assumption. pub const QUOTE_TOKEN_INDEX: TokenIndex = 0; -/// The token index used for the insurance fund. -/// -/// We should eventually generalize insurance funds. -pub const INSURANCE_TOKEN_INDEX: TokenIndex = 0; - /// The token index used for settling perp markets. /// /// We should eventually generalize to make the whole perp quote (and settle) token