feat(pumpswap): align pool account and events with cashback IDL

- Extend on-chain Pool layout (is_cashback_coin, 7-byte reserved, 244 bytes)
  with backward-compatible decode for 236-byte legacy accounts
- Decode Buy/Sell program logs manually: min_base_amount_out, ix_name,
  cashback fields; optional sell cashback when payload >= 368 bytes
- Set ix_name on buy / buy_exact_quote_in instructions; merge new fields
  in CPI log merger
- Add read_i64_le helper and pool layout unit test

Made-with: Cursor
This commit is contained in:
0xfnzero
2026-04-03 14:38:06 +08:00
parent b593605dbd
commit 7f505f0da5
5 changed files with 281 additions and 12 deletions
@@ -200,6 +200,11 @@ pub fn merge(instruction_event: &mut DexEvent, cpi_log_event: DexEvent) {
e.total_claimed_tokens = cpie.total_claimed_tokens;
e.current_sol_volume = cpie.current_sol_volume;
e.last_update_timestamp = cpie.last_update_timestamp;
e.min_base_amount_out = cpie.min_base_amount_out;
e.ix_name = cpie.ix_name.clone();
e.cashback_fee_basis_points = cpie.cashback_fee_basis_points;
e.cashback = cpie.cashback;
e.is_pump_pool = cpie.is_pump_pool;
}
_ => {}
},
@@ -228,6 +233,9 @@ pub fn merge(instruction_event: &mut DexEvent, cpi_log_event: DexEvent) {
e.coin_creator = cpie.coin_creator;
e.coin_creator_fee_basis_points = cpie.coin_creator_fee_basis_points;
e.coin_creator_fee = cpie.coin_creator_fee;
e.cashback_fee_basis_points = cpie.cashback_fee_basis_points;
e.cashback = cpie.cashback;
e.is_pump_pool = cpie.is_pump_pool;
}
_ => {}
},