Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 2.41 KB

File metadata and controls

79 lines (54 loc) · 2.41 KB

🎯 PumpFun Trading Example (Encrypted Keystore)

Keystore / KEYPAIR_BASE58 + multi-SWQoS

Same trading flow as pumpfun_trade, but the wallet uses a sol-safekey file or fallback KEYPAIR_BASE58.

中文 | English | Repository overview


← Back to repository overview


When to use

  • Token must still be on PumpFun (not graduated); use pumpswap_trade_with_safekey after migration.
  • Set keystore_path in config/*/solana.yaml (e.g. ./keystore.json), enter the password at runtime or set KEYSTORE_PASSWORD.
  • If keystore_path is empty, KEYPAIR_BASE58 is accepted as a fallback (less secure).

Create a keystore

cd sol-safekey
cargo run --release -- export <private_key_or_mnemonic> ../pumpfun_trade_with_safekey/keystore.json

Then point keystore_path in pumpfun_trade_with_safekey/config/dev/solana.yaml to that file.

For longer documentation (SWQoS, nonce, security), see pumpswap_trade_with_safekey/README.md—same layout, different protocol (PumpSwap).

Before you run

  1. Clone sol-safekey separately and export keystore.json (this repo does not vendor it)—see root README.md.
  2. In this crate:
cp .env.example .env
cp config/dev/solana.yaml.example config/dev/solana.yaml
cp config/dev/trading.yaml.example config/dev/trading.yaml
  1. Edit YAML/keystore_path, SWQoS, nonce. Do not commit .env or filled YAML.

Run & build

cd pumpfun_trade_with_safekey
./run.sh <MINT_ADDRESS>
cargo build --release
# Binary: build-cache/release/pumpfun_trade_with_safekey
./build-linux-release.sh

Behavior summary

  • 1 round by default: buy → wait ~30s → sell full mint balance (ROUNDS in src/run.rs).
  • 2+ SWQoS requires durable nonce; empty YAML placeholders are skipped so NONCE_ACCOUNT still works.
  • Params are refreshed from RPC before sell, same as pumpfun_trade.

📄 License

MIT License

💬 Contact

https://fnzero.dev/ · https://github.com/0xfnzero/fnzero-examples