diff --git a/programs/drift/src/instructions/keeper.rs b/programs/drift/src/instructions/keeper.rs index b79d8b6ed..d87f3c39c 100644 --- a/programs/drift/src/instructions/keeper.rs +++ b/programs/drift/src/instructions/keeper.rs @@ -2,7 +2,7 @@ use std::cell::RefMut; use std::convert::{TryFrom, TryInto}; use anchor_lang::prelude::*; -use anchor_spl::associated_token::get_associated_token_address; +use anchor_spl::associated_token::{get_associated_token_address, get_associated_token_address_with_program_id}; use anchor_spl::token::spl_token; use anchor_spl::token_2022::spl_token_2022; use anchor_spl::token_interface::{TokenAccount, TokenInterface}; @@ -2245,7 +2245,7 @@ pub fn handle_force_delete_user<'c: 'info, 'info>( .find(|acc| acc.key() == spot_market_mint.key()) .map(|acc| InterfaceAccount::try_from(acc).unwrap()); - let keeper_vault = get_associated_token_address(&keeper_key, spot_market_mint); + let keeper_vault = get_associated_token_address_with_program_id(&keeper_key, spot_market_mint, &token_program_pubkey); let keeper_vault_account_info = ctx .remaining_accounts .iter() diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index fb1305992..69a7519fd 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -1658,16 +1658,17 @@ export class DriftClient { isWritable: true, pubkey: spotMarket.vault, }); + const tokenProgram = this.getTokenProgramForSpotMarket(spotMarket); const keeperVault = await this.getAssociatedTokenAccount( spotPosition.marketIndex, - false + false, + tokenProgram ); remainingAccounts.push({ isSigner: false, isWritable: true, pubkey: keeperVault, }); - const tokenProgram = this.getTokenProgramForSpotMarket(spotMarket); tokenPrograms.add(tokenProgram.toBase58()); }