diff --git a/packages/discovery-provider/src/solana/solana_helpers.py b/packages/discovery-provider/src/solana/solana_helpers.py index 0ccb0340e71..bf6d02a463a 100644 --- a/packages/discovery-provider/src/solana/solana_helpers.py +++ b/packages/discovery-provider/src/solana/solana_helpers.py @@ -38,3 +38,6 @@ def get_derived_address(base, hashed_eth_pk, spl_token_id): # Static Memo Program ID MEMO_PROGRAM_ID = "Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo" + +# Static Jupiter Swap Program ID +JUPITER_PROGRAM_ID = "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4" diff --git a/packages/discovery-provider/src/tasks/index_user_bank.py b/packages/discovery-provider/src/tasks/index_user_bank.py index 3e65aa237e9..2eabc8b506c 100644 --- a/packages/discovery-provider/src/tasks/index_user_bank.py +++ b/packages/discovery-provider/src/tasks/index_user_bank.py @@ -47,6 +47,7 @@ ) from src.solana.solana_client_manager import SolanaClientManager from src.solana.solana_helpers import ( + JUPITER_PROGRAM_ID, SPL_TOKEN_ID_PK, get_address_pair, get_base_address, @@ -96,6 +97,8 @@ Pubkey.from_string(PAYMENT_ROUTER_ADDRESS) if PAYMENT_ROUTER_ADDRESS else None ) +JUPITER_PROGRAM_ID_PUBKEY = Pubkey.from_string(JUPITER_PROGRAM_ID) + # Transfer instructions don't have a mint acc arg but do have userbank authority. # So re-derive the claimable token PDAs for each mint here to help us determine mint later. WAUDIO_PDA, _ = get_base_address(WAUDIO_MINT_PUBKEY, USER_BANK_KEY) @@ -665,6 +668,8 @@ def process_transfer_instruction( # not the claimable tokens program, so we will always have a sender_user_id if receiver_user_id is None: transaction_type = get_transfer_type_from_memo(memos=memos) + if JUPITER_PROGRAM_ID_PUBKEY in account_keys: + transaction_type = USDCTransactionType.prepare_withdrawal # Attempt to look up account owner, fallback to recipient address receiver_account_owner = (