fix(meteora-damm-v2): use correct token program for output ATA creation
- Pass token_a/token_b program based on swap direction (is_a_in) when creating the output mint ATA in buy flow, matching ATA address derivation for SPL Token vs Token-2022 mints. - Resolve token_a_program and token_b_program from on-chain mint account owners in MeteoraDammV2Params::from_pool_address_by_rpc instead of hardcoding the classic SPL Token program. Fixes incorrect ATA creation for Token-2022 output mints (issue #99). Made-with: Cursor
This commit is contained in:
@@ -87,7 +87,11 @@ impl InstructionBuilder for MeteoraDammV2InstructionBuilder {
|
||||
¶ms.payer.pubkey(),
|
||||
¶ms.payer.pubkey(),
|
||||
¶ms.output_mint,
|
||||
&crate::constants::TOKEN_PROGRAM,
|
||||
if is_a_in {
|
||||
&protocol_params.token_b_program
|
||||
} else {
|
||||
&protocol_params.token_a_program
|
||||
},
|
||||
params.open_seed_optimize,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user