feat(trading): zero-RPC extreme-fast buys and listener race hardening (#170) (#183)

Extreme-fast mode submits with no RPC calls between detection and buy
when the listener parsed the on-chain CreateEvent (geyser/logs/blocks):
TokenInfo.state_from_event carries the canonical creator, mayhem/cashback
flags and quote_mint, so the pre-buy curve refresh is skipped. The geyser
listener now delegates to the event-first parser instead of inlining
instruction decoding, which also catches create_v2 transactions that omit
the trailing is_cashback_enabled byte.

Listeners without event data (pumpportal) keep the refresh, hardened per
issue #170: bonding curve derived from the mint instead of the payload's
bondingCurveKey, curve and mint read in one slot-consistent
getMultipleAccounts (correcting the guessed token program), and an
unreadable curve now skips the token within trade.curve_refresh_budget
instead of submitting a buy built from guessed accounts.

Machine-checked by verify_extreme_fast_zero_rpc.py and
verify_pumpportal_buy_path.py; validated live via simulate_bot_buy_path
on both geyser and pumpportal paths.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Anton Sauchyk
2026-07-29 18:29:03 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent bc59a2257d
commit 7bc6f25508
19 changed files with 1239 additions and 86 deletions
+18
View File
@@ -35,9 +35,27 @@ trade:
# EXTREME FAST mode configuration
# When enabled, skips waiting for the bonding curve to stabilize and RPC price check.
# The bot buys the specified number of tokens directly, making the process faster but less precise.
# For geyser/logs/blocks listeners the buy is built entirely from the on-chain
# CreateEvent — ZERO RPC calls between detection and submission (see
# trust_create_event below). pumpportal payloads lack the needed fields, so
# that listener does one batched read first (see curve_refresh_budget).
extreme_fast_mode: true
extreme_fast_token_amount: 20 # Amount of tokens to buy
# Pre-buy curve refresh (issue #170). The buyer re-reads the bonding curve /
# pool at `processed` before building the buy so fee_recipient, creator_vault,
# quote_mint and the token program are current. If the account is not readable
# within this budget (seconds), the token is SKIPPED instead of submitting a
# buy built from listener-guessed defaults, which tends to revert on-chain.
curve_refresh_budget: 2.0
# When the create event carried the canonical creator, mayhem/cashback flags
# and quote_mint (geyser/logs/blocks listeners), skip the pre-buy read
# entirely: extreme_fast_mode then submits with ZERO RPC calls after
# detection. pumpportal events never carry these, so they always refresh.
# Set false to force the refresh for every listener.
trust_create_event: true
# Priority fee configuration
# Manage transaction speed and cost on the Solana network.
# Note: dynamic mode requires an additional RPC call, which slows down the buying process.