Bot examples
Four Python bots from the public ZeroSlip bot-examples repository. Each bot is a single file: settings at the top, code below. Download one, edit its settings, and run it with python3.
How it worksβ
The bot runs as a Python process on your computer or server:
- It reads public market events from ZeroSlip's Data Stream over one websocket.
- It applies its entry and exit rules to the wallet or token you chose.
- In paper mode (the default), it logs simulated trades and PnL. With
LIVE = True, it sends orders and your key to the Lightning Trade API, which signs and executes them.
The backtester reads archived events instead. The sell script reads balances through Solana RPC. The source reference shows every file in full and is included in the full docs for AI.
Setupβ
Use Python 3.9 or newer (the python3 that comes with macOS works) and install the packages once:
python3 -m pip install 'aiohttp>=3.12,<4' 'websockets>=15,<16' 'zstandard>=0.23,<1' 'orjson>=3.10,<4'
Download a file below, open it, and edit the SETTINGS section at the top. No other files or arguments are needed. If your system Python blocks pip install, install uv and run uv run file.py instead.
Run one streaming bot at a time. The Data Stream allows one connection per IP address, including agents.
Examplesβ
Copytrading botβ
Download copytrader_bot.py and add the wallets you follow to WALLETS.
python3 copytrader_bot.py
Copies each wallet's first buy of a token at 10% of its size, capped at 0.01 SOL-equivalent. It follows non-Mayhem Pump.fun and Pump-created PumpSwap pools. If the wallet then sells 25% of its tokens, the bot sells 25% of yours. Only the wallet that opened a position closes it. Read the code.
Live sniper botβ
Download live_sniper_bot.py and set TOKEN_MINT to the token you want to buy.
python3 live_sniper_bot.py
Buys the token once, then sells at 50% profit, 20% loss, or after 300 seconds without activity. Leave TOKEN_MINT empty to snipe non-Mayhem Pump.fun launches whose first buy is over 20 SOL-equivalent.
Paper buys fill at the next trade price and count as missed if the price moved past BUY_SLIPPAGE. Paper PnL excludes fees and liquidity, so it does not prove a strategy is profitable. Read the code.
Sniper strategy backtesterβ
Download backtest_sniper_strategy.py. Set HOURS (default: 1), or REPLAY_FILE to use an archive you already downloaded.
python3 backtest_sniper_strategy.py
Replays completed UTC hours through the launch-sniper rules with modeled latency and fees. It reports PnL, win rate, exit reasons, and missed entries. Zero trades is a valid result: every entry may have moved past the buy slippage. Check the missed count before changing settings.
Fills use the last known price, so results are estimates. Each hour can be hundreds of MB; if temporary storage runs out, set TMPDIR to a folder with space. The newest hour can take 90 seconds to appear. Read the code.
Sell-all-tokens scriptβ
Download sell_all_tokens.py and set WALLET to the wallet you want to preview.
python3 sell_all_tokens.py
Previews a 100% sell of every token in the wallet. To sell only some tokens, set SELL_ALL = False and list them in TOKEN_MINTS. SOL, USDC, and frozen balances are skipped. Read the code.
Live tradingβ
Set API_KEY or PRIVATE_KEY at the top of the sniper, copytrader, or sell file, then set LIVE = True. API_KEY is used if both are set. Keys are sent to the Lightning API for signing; keep files containing keys private. Live sells use your key's wallet, and the balance check costs a small fee.
Check the settings first: defaults are 20% buy slippage, 99% sell slippage, and 100% sell-all slippage. Buy amounts are in SOL-equivalent value. For USDC pools, the bots convert that amount to USDC using the SOL price from the stream, or 80 USDC per SOL until the first price update. Fund both SOL and USDC to trade both kinds of pool.
Positions live in memory. Stopping does not sell, and restarting does not restore them. If an order's result is unclear, the bot stops instead of retrying; check your wallet before restarting.