Skip to content

Latest commit

 

History

History
141 lines (94 loc) · 4.09 KB

File metadata and controls

141 lines (94 loc) · 4.09 KB

🎯 PumpFun Bonding-Curve Trading Example

Buy → wait → sell on PumpFun with multiple SWQoS channels

For tokens still on the PumpFun bonding curve (not graduated to PumpSwap). Configure the wallet via PRIVATE_KEY or private_key in config/*/solana.yaml.

GitHub stars

Rust Solana PumpFun

中文 | English | Repository overview

Note: After the token graduates to PumpSwap, use pumpswap_trade / pumpswap_trade_with_safekey.


← Back to repository overview


📋 Table of contents

  • When to use · Features · Installation · Configuration · Run · Build
  • Comparison with PumpSwap example

When to use this example

Use pumpfun_trade Use pumpswap_trade instead
Token is still on the PumpFun bonding curve Token has graduated to PumpSwap
PumpFunParams::from_mint_by_rpc succeeds You need a pool address for PumpSwap

If you pass a graduated mint here, the program fails while resolving the bonding curve.


Features

  1. Protocol: DexType::PumpFun with PumpFunParams::from_mint_by_rpc; params are fetched again before sell so creator_vault and curve state stay fresh.
  2. Flow: Buy → wait ~30s → sell the wallet’s full balance of that mint; 1 round by default (edit ROUNDS, REST_SECS in src/run.rs).
  3. Multi-SWQoS, durable nonce (required when 2+ SWQoS are enabled), trading.yaml for slippage/Gas—same ideas as pumpswap_trade.
  4. Nonce placeholders: empty strings in nonce_config lists are ignored so NONCE_ACCOUNT can still apply.

Installation

git clone https://github.com/0xfnzero/fnzero-examples.git
cd fnzero-examples/pumpfun_trade

Install Rust/Cargo: https://rustup.rs


Configuration

Before first run, create local files from templates (do not commit; see repo root README.md “Before you run & privacy”):

cp .env.example .env
cp config/dev/solana.yaml.example config/dev/solana.yaml
cp config/dev/trading.yaml.example config/dev/trading.yaml
# For prod, copy config/prod/*.example as well

Then edit .env and YAML: PRIVATE_KEY, RPC, SWQoS tokens, nonce_config, etc. Trading params are in trading.yaml.

For more wallet/SWQoS detail, see pumpswap_trade/README.md (protocol/mint requirements differ).


Run

./run.sh <MINT_ADDRESS>
# or
cargo run --release -- <MINT_ADDRESS>

APP_ENV=dev|prod selects config/dev vs config/prod.


Build

.cargo/config.toml writes artifacts to build-cache/release/.

cargo build --release
./build-cache/release/pumpfun_trade <MINT_ADDRESS>

Linux bundle:

./build-linux-release.sh

Comparison with PumpSwap example

pumpfun_trade pumpswap_trade
DEX PumpFun (curve) PumpSwap (outer AMM)
Pool Derived from mint / curve find_pool_by_mint
Mint Not graduated Listed on outer pool

Encrypted-keystore variant: pumpfun_trade_with_safekey/README.md.


📄 License

MIT License


💬 Contact