feat: pass is_cashback_coin from events; PumpFun examples use sol-parser-sdk only

- PumpFunParams/BondingCurve: from_trade/from_dev_trade take is_cashback_coin parameter
- pumpfun_copy_trading and pumpfun_sniper_trading use sol-parser-sdk for gRPC, pass e.is_cashback_coin
- address_lookup/nonce_cache call sites updated; README EN/CN Cashback and example notes

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Wood
2026-02-19 01:34:12 +08:00
co-authored by Cursor
parent 9a8e3ffb2d
commit c27e479659
10 changed files with 276 additions and 237 deletions
+8
View File
@@ -107,6 +107,8 @@ impl PumpFunParams {
}
}
/// When building from event/parser (e.g. sol-parser-sdk), pass `is_cashback_coin` from the event
/// so that sell instructions include the correct remaining accounts for cashback.
pub fn from_dev_trade(
mint: Pubkey,
token_amount: u64,
@@ -118,6 +120,7 @@ impl PumpFunParams {
close_token_account_when_sell: Option<bool>,
fee_recipient: Pubkey,
token_program: Pubkey,
is_cashback_coin: bool,
) -> Self {
let is_mayhem_mode = fee_recipient == MAYHEM_FEE_RECIPIENT;
let bonding_curve_account = BondingCurveAccount::from_dev_trade(
@@ -127,6 +130,7 @@ impl PumpFunParams {
max_sol_cost,
creator,
is_mayhem_mode,
is_cashback_coin,
);
Self {
bonding_curve: Arc::new(bonding_curve_account),
@@ -137,6 +141,8 @@ impl PumpFunParams {
}
}
/// When building from event/parser (e.g. sol-parser-sdk), pass `is_cashback_coin` from the event
/// so that sell instructions include the correct remaining accounts for cashback.
pub fn from_trade(
bonding_curve: Pubkey,
associated_bonding_curve: Pubkey,
@@ -150,6 +156,7 @@ impl PumpFunParams {
close_token_account_when_sell: Option<bool>,
fee_recipient: Pubkey,
token_program: Pubkey,
is_cashback_coin: bool,
) -> Self {
let is_mayhem_mode = fee_recipient == MAYHEM_FEE_RECIPIENT;
let bonding_curve = BondingCurveAccount::from_trade(
@@ -161,6 +168,7 @@ impl PumpFunParams {
real_token_reserves,
real_sol_reserves,
is_mayhem_mode,
is_cashback_coin,
);
Self {
bonding_curve: Arc::new(bonding_curve),