An automated Solana sniping bot that trades newly-listed tokens on Raydium AMM v4 and pump.fun bonding curves. Listens to on-chain events in real time, applies configurable safety filters, buys with your chosen quote token (WSOL / USDC), and auto-sells on take-profit / stop-loss.
β οΈ Disclaimer. This software is provided as-is for educational purposes. Sniping memecoins is extremely risky β rug pulls, honeypots, sandwiching, and total loss are common outcomes. Use only funds you can afford to lose. You are solely responsible for every transaction this bot signs with your private key.
For collaboration or development work:
- Telegram β @k02_xx
- π¦ Raydium AMM v4 sniper β listens for newly-opened liquidity pools and buys within the same block window.
- π pump.fun integration β detects new token creations on the pump.fun bonding-curve program and buys early; sells via bonding curve until graduation.
- β‘ Three transaction executors β
default(regular RPC),warp(warp.id bundled relay),jito(Jito bundle fan-out to five block-engine regions). - π‘οΈ Pool filters β burn check, mint renounced, freeze authority, metadata mutability, socials, pool size range.
- π― Snipe list β restrict buys to a whitelist of mint addresses refreshed from
snipe-list.txt. - π Auto-sell β take-profit / stop-loss polling against live pool state for both Raydium and pump.fun.
- π Concurrency guard β
ONE_TOKEN_AT_A_TIMEmode via mutex to avoid fighting yourself across new pools. - π Retries β configurable retry counts for buy and sell transactions.
- π§ͺ Dry-run mode β simulate trades and log decisions without sending on-chain transactions.
- π¦ Risk caps β max open positions + daily buy limits for Raydium and pump.fun.
ββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββββ
β Listeners βββββΆβ Bot βββββΆβ Transaction β
β (WS subscrs.) β β (buy / sell) β β Executor β
ββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββββ
β β β
β β ββ default RPC
β β ββ warp.id
β β ββ Jito bundles
β β
β ββ PoolFilters (burn / renounced / socials / size)
β ββ SnipeListCache
β ββ MarketCache / PoolCache
β ββ PumpFunCache
β
ββ OpenBook markets (quoteMint memcmp)
ββ Raydium AmmV4 pools (status=6, quoteMint memcmp)
ββ pump.fun logs (Create instruction)
ββ Wallet SPL changes (token balance deltas β auto-sell)
Key modules:
| Path | Purpose |
|---|---|
index.ts |
Entry point β wires Connection, Listeners, Bot, event handlers. |
bot.ts |
Bot class β Raydium buy/sell + pump.fun buyPumpFun/sellPumpFun, filter & price matching. |
listeners/ |
WebSocket subscriptions (OpenBook, Raydium, pump.fun logs, wallet). |
cache/ |
In-memory stores for markets, Raydium pools, pump.fun bonding curves, snipe list. |
filters/ |
Pluggable safety filters applied before a buy. |
transactions/ |
Pluggable executors (default, warp, jito). |
helpers/ |
Env loader, logger, wallet parser, Raydium/pump.fun helpers & pricing. |
- Node.js β₯ 18
- A funded Solana wallet (keep a dedicated keypair for the bot β never use your main one).
- A reliable RPC β public
api.mainnet-beta.solana.comwill throttle; use Helius, QuickNode, Triton, Shyft, etc. - The quote token account must already exist in your wallet (e.g. WSOL ATA). You can create a WSOL ATA by wrapping a tiny amount of SOL first.
git clone https://github.com/muxprotocol/solana-trading-bot.git
cd solana-trading-bot-master
npm install
cp .env.copy .envEdit .env (see Configuration) and then:
npm startAll settings live in .env. Copy from .env.copy and edit.
| Var | Example | Notes |
|---|---|---|
PRIVATE_KEY |
base58 / [n,...] / mnemonic / hex |
Accepted formats: base58, JSON array, mnemonic, or 64/128-char hex. Keep secret. |
RPC_ENDPOINT |
https://... |
HTTPS RPC. Use a paid provider. |
RPC_WEBSOCKET_ENDPOINT |
wss://... |
WebSocket RPC. |
COMMITMENT_LEVEL |
confirmed |
processed, confirmed, or finalized. |
| Var | Example | Notes |
|---|---|---|
LOG_LEVEL |
trace |
pino log level. |
ONE_TOKEN_AT_A_TIME |
true |
Mutex to process one token at a time. |
PRE_LOAD_EXISTING_MARKETS |
false |
Bulk-fetch OpenBook markets at start (slow). |
CACHE_NEW_MARKETS |
false |
Subscribe to OpenBook markets live. |
TRANSACTION_EXECUTOR |
default |
default | warp | jito. |
COMPUTE_UNIT_LIMIT |
101337 |
default executor only. |
COMPUTE_UNIT_PRICE |
421197 |
micro-lamports, default executor only. |
CUSTOM_FEE |
0.006 |
SOL; for warp / jito executors. |
DRY_RUN |
false |
If true, no transaction is broadcast; decisions are logged only. |
MAX_OPEN_POSITIONS |
3 |
Max concurrent positions tracked by the bot. |
MAX_DAILY_RAYDIUM_BUYS |
20 |
Successful Raydium buy cap per UTC day. |
MAX_DAILY_PUMPFUN_BUY_SOL |
0.05 |
Total SOL budget for pump.fun buys per UTC day. |
| Var | Example | Notes |
|---|---|---|
QUOTE_MINT |
WSOL |
WSOL or USDC (Raydium side). |
QUOTE_AMOUNT |
0.001 |
How much quote token to spend per buy. |
AUTO_BUY_DELAY |
0 |
ms delay before sending buy. |
MAX_BUY_RETRIES |
10 |
Retry count on confirmation failure. |
BUY_SLIPPAGE |
20 |
Percent. |
| Var | Example | Notes |
|---|---|---|
AUTO_SELL |
true |
Enable auto-sell on wallet balance changes. |
AUTO_SELL_DELAY |
0 |
ms delay before sending sell. |
MAX_SELL_RETRIES |
10 |
|
PRICE_CHECK_INTERVAL |
2000 |
ms between price polls. |
PRICE_CHECK_DURATION |
600000 |
ms total TP/SL monitoring window. |
TAKE_PROFIT |
40 |
Percent gain. |
STOP_LOSS |
20 |
Percent loss. |
SELL_SLIPPAGE |
20 |
Percent. |
| Var | Example | Notes |
|---|---|---|
USE_SNIPE_LIST |
false |
When true, all filters are bypassed and only mints in snipe-list.txt are bought. |
SNIPE_LIST_REFRESH_INTERVAL |
30000 |
ms. |
FILTER_CHECK_INTERVAL |
2000 |
ms. |
FILTER_CHECK_DURATION |
60000 |
ms β total filter monitoring window. |
CONSECUTIVE_FILTER_MATCHES |
3 |
Required matches in a row before buying. |
CHECK_IF_MUTABLE |
false |
Reject if token metadata is mutable. |
CHECK_IF_SOCIALS |
true |
Require non-empty socials in metadata URI. |
CHECK_IF_MINT_IS_RENOUNCED |
true |
Require mint authority = null. |
CHECK_IF_FREEZABLE |
false |
Reject if freeze authority set. |
CHECK_IF_BURNED |
true |
Require LP supply = 0 (burned). |
MIN_POOL_SIZE |
5 |
In quote token. |
MAX_POOL_SIZE |
50 |
In quote token. Set both to 0 to disable. |
| Var | Example | Notes |
|---|---|---|
ENABLE_RAYDIUM |
true |
Master toggle for the Raydium sniper. |
ENABLE_PUMP_FUN |
false |
Master toggle for pump.fun. |
PUMP_FUN_BUY_AMOUNT_SOL |
0.001 |
Native SOL per pump.fun buy. |
PUMP_FUN_MAX_CURVE_PROGRESS |
50 |
Percent; skip if bonding curve is already filled past this. |
Notes on pump.fun:
- Trades use native SOL through the pump.fun bonding curve (no WSOL / Raydium pool).
QUOTE_MINT/QUOTE_AMOUNTdo not apply. - A 1% protocol fee is assumed in price calculations;
BUY_SLIPPAGEandSELL_SLIPPAGEare applied on top. - Once a pump.fun token's bonding curve graduates (
complete = true), it migrates to Raydium. The bot stops selling via pump.fun at that point; the wallet listener will then route to the Raydium sell path if a pool is known. - Pool filters (burn, socials, pool size, etc.) do not apply to pump.fun β only
PUMP_FUN_MAX_CURVE_PROGRESSand the snipe list.
Create / edit snipe-list.txt with one mint address per line. Set USE_SNIPE_LIST=true. Refreshes every SNIPE_LIST_REFRESH_INTERVAL ms.
# snipe-list.txt
So11111111111111111111111111111111111111112
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Works for both Raydium and pump.fun paths.
npm start # ts-node index.ts
npm run tsc # type-check onlyStop with Ctrl+C. Logs print to stdout via pino-pretty.
Standard sendRawTransaction + confirmation. You pay priority via COMPUTE_UNIT_PRICE Γ COMPUTE_UNIT_LIMIT micro-lamports.
Bundled through https://tx.warp.id/transaction/execute. A tip of CUSTOM_FEE SOL is sent to the warp fee wallet in a leading transfer.
Sends a Jito bundle to all 5 block-engine regions (mainnet, amsterdam, frankfurt, ny, tokyo). Tip of CUSTOM_FEE SOL is sent to a randomly-chosen Jito tip account. Compute-budget instructions are skipped since Jito priority is set via the tip.
- Use a dedicated wallet funded only with what you're willing to lose.
- Keep
.envout of version control (.gitignorealready excludes it). - Start with tiny amounts (
QUOTE_AMOUNT=0.001,PUMP_FUN_BUY_AMOUNT_SOL=0.001). - For first runs, set
DRY_RUN=trueto verify behavior before risking funds. - Use a paid RPC; free endpoints will miss fills.
- Test
ENABLE_RAYDIUM=false ENABLE_PUMP_FUN=trueor vice versa in isolation first. - Monitor logs actively β
LOG_LEVEL=traceis verbose but informative.
| Symptom | Likely cause |
|---|---|
PRIVATE_KEY is not set |
.env missing / path wrong. |
... token account not found in wallet |
You haven't created a WSOL (or USDC) ATA yet. Wrap a tiny amount of SOL first. |
| No pools detected | RPC too slow / filters too strict / wrong COMMITMENT_LEVEL. |
| Buys never confirm | Priority fee too low or RPC drops txs; try warp / jito executor. |
Curve progress too high |
Increase PUMP_FUN_MAX_CURVE_PROGRESS or loosen. |
Bonding curve complete |
Token already graduated to Raydium; pump.fun path can't trade it. |
.
βββ bot.ts Core Bot (buy/sell for both DEXes)
βββ index.ts Entry point & event wiring
βββ cache/
β βββ market.cache.ts
β βββ pool.cache.ts
β βββ pumpfun.cache.ts pump.fun bonding curve state cache
β βββ snipe-list.cache.ts
βββ filters/ PoolFilters + individual filters
βββ helpers/
β βββ constants.ts Env var parsing
β βββ liquidity.ts createPoolKeys for Raydium
β βββ logger.ts
β βββ market.ts MinimalMarketLayoutV3
β βββ pumpfun.ts pump.fun program + layout + ix builders + pricing
β βββ promises.ts
β βββ token.ts WSOL / USDC
β βββ wallet.ts
βββ listeners/listeners.ts WebSocket subscriptions
βββ transactions/
β βββ default-transaction-executor.ts
β βββ warp-transaction-executor.ts
β βββ jito-rpc-transaction-executor.ts
βββ .env.copy Template
βββ snipe-list.txt Whitelist (optional)
βββ tsconfig.json
MIT β see LICENSE.md.
- Original Raydium sniper by Filip Dundjer / warp.id.
- pump.fun integration layered on top.
- Built on
@solana/web3.js,@solana/spl-token,@raydium-io/raydium-sdk,@metaplex-foundation/mpl-token-metadata.