v4.0.11 switched the fast-submit (`wait_tx_confirmed = false`) result loop
from `wait_for_all_submitted` to `wait_for_first_submitted`. The new
function returns as soon as one SWQOS route's HTTP submit completes and
drains whatever signatures are in `ResultCollector.results` at that
moment — slower routes' signatures arrive after the caller has returned.
This is correct for fire-and-forget low-latency submits, but breaks
callers that do their own on-chain confirmation against a pinned durable
nonce. Only one of the submitted txs can land (nonce is consumed by
whichever lands first), but the caller has no way of knowing in advance
which route it will be. Their post-submit logic feeds every returned
signature to `getSignatureStatuses` to find the landed one — with only
the fastest HTTP responder returned (often not the one that lands), the
landed tx isn't in the polled set.
Adds an opt-in `SwapParams.wait_for_all_submits: bool` (default false,
plumbed through `TradeBuyParams` / `TradeSellParams`). When true and
`wait_tx_confirmed = false`, `execute_parallel` uses
`wait_for_all_submitted` (still in the codebase, was
`#[allow(dead_code)]`) so every submitted signature is returned. Zero
behaviour change for current users.
Sync supported DEX IDLs from bitquery/solana-idl-lib, upgrade protocol builders, and keep trade submission hot paths free of RPC query calls.
Include exact-output coverage, token-account setup fixes for WSOL and stable pairs, and low-latency transaction build improvements.
The patched solana-keypair in the main workspace adds try_from_base58_string,
but sol-safekey and other consumers use the standard crates.io version which
only provides from_base58_string (panics) and TryFrom<&[u8]> (fallible).
Use bs58::decode + Keypair::try_from to keep proper error handling while
remaining compatible with the standard solana-keypair crate.
BondingCurveAccount::try_from_slice requires the entire input slice to
be consumed, which fails with "Not all bytes read" when the on-chain
bonding curve account has been extended with new fields (e.g. after a
protocol upgrade). Switch to BorshDeserialize::deserialize which reads
the known fields and silently ignores any trailing bytes.
In build_sell_v1/v2, the creator_vault was previously derived via
effective_creator_for_trade() passed to resolve_creator_vault_for_ix_with_fee_sharing.
When observed_trade_creator differs from bonding_curve.creator (e.g. creator
updated post-deployment), the derived vault PDA mismatches the on-chain
seeds constraint, causing Anchor error 2006 (ConstraintSeeds) on sell.
The pump.fun sell instruction validates creator_vault seeds as
PDA("creator-vault", bonding_curve.creator), but buy does not check seeds,
so buy succeeds while sell fails with 2006.
Fix: when protocol_params.creator_vault is a valid non-default/non-phantom
value (observed from gRPC / update_fee_shares), use it directly without
re-derivation. Only fall back to resolve via bonding_curve.creator when
creator_vault is missing. This ensures the authoritative observed vault
is never overridden by a stale or mismatched creator.
The Pump.fun IDL explicitly states that user_volume_accumulator is
passed as remaining_accounts[0] for cashback coins during sell.
Using is_mayhem_mode incorrectly omitted the account for cashback
tokens, causing the program to misread bonding_curve_v2 as
user_volume_accumulator and resulting in Custom(6024) Overflow.
- Replace compile-time `pumpfun-v2` feature flag with runtime
`TradeConfig::use_pumpfun_v2(bool)` for flexible V1/V2 switching
- Fix BUYBACK_FEE_RECIPIENTS pool: replace wrong addresses (was reusing
standard pool + FEE_CONFIG) with official buyback pool from
FEE_RECIPIENTS.md
- Fix legacy buy/buy_exact_sol_in ix data encoding: use 2-byte
Option<bool> (option tag + value) matching official Pump SDK, 26 bytes
total instead of broken 25
- Add `SwapParams.use_pumpfun_v2` field and wire through TradingClient
buy/sell paths
- V2 instructions read `quote_mint` from `PumpFunParams` (not
BondingCurveAccount which lacks the field)
- Fix `fetch_bonding_curve_account` to use BorshDeserialize instead of
non-existent `decode_from_chain_account_data`
- Update all examples with `use_pumpfun_v2: false` field
- Update README with unified V1/V2 section showing both enabling methods