[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80385":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":15,"starSnapshotCount":15,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},80385,"solana-sniper-mev-bot","bigmacman1129\u002Fsolana-sniper-mev-bot","bigmacman1129","Solana trading bot for sniping new tokens on Raydium AMM v4 and pump.fun. Features real-time on-chain monitoring, MEV-ready execution (Jito\u002FWarp), safety filters, auto buy\u002Fsell, take-profit, and stop-loss.","",null,"TypeScript",82,48,46,0,9,20,23,27,5.07,"Microsoft Public License",false,"main",true,[26,27,28,29,30,31,32],"mev","pumpfun","raydium","sniper","solana","solana-trading-bot","trading-bot","2026-06-12 02:04:01","# Solana Trading Bot\r\n\r\nAn 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 \u002F USDC), and auto-sells on take-profit \u002F stop-loss.\r\n\r\n> ⚠️ **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.\r\n>\r\n**For collaboration or development work:**\r\n\r\n- **Telegram** — [@k02_xx](https:\u002F\u002Ft.me\u002Fk02_xx)\r\n\r\n---\r\n\r\n## Features\r\n\r\n- 🦅 **Raydium AMM v4 sniper** — listens for newly-opened liquidity pools and buys within the same block window.\r\n- 🚀 **pump.fun integration** — detects new token creations on the pump.fun bonding-curve program and buys early; sells via bonding curve until graduation.\r\n- ⚡ **Three transaction executors** — `default` (regular RPC), `warp` (warp.id bundled relay), `jito` (Jito bundle fan-out to five block-engine regions).\r\n- 🛡️ **Pool filters** — burn check, mint renounced, freeze authority, metadata mutability, socials, pool size range.\r\n- 🎯 **Snipe list** — restrict buys to a whitelist of mint addresses refreshed from `snipe-list.txt`.\r\n- 📈 **Auto-sell** — take-profit \u002F stop-loss polling against live pool state for both Raydium and pump.fun.\r\n- 🔒 **Concurrency guard** — `ONE_TOKEN_AT_A_TIME` mode via mutex to avoid fighting yourself across new pools.\r\n- 🔁 **Retries** — configurable retry counts for buy and sell transactions.\r\n- 🧪 **Dry-run mode** — simulate trades and log decisions without sending on-chain transactions.\r\n- 🚦 **Risk caps** — max open positions + daily buy limits for Raydium and pump.fun.\r\n\r\n---\r\n\r\n## Architecture\r\n\r\n```\r\n┌────────────────┐    ┌────────────────┐    ┌────────────────┐\r\n│   Listeners    │───▶│      Bot       │───▶│   Transaction  │\r\n│ (WS subscrs.)  │    │  (buy \u002F sell)  │    │    Executor    │\r\n└────────────────┘    └────────────────┘    └────────────────┘\r\n        │                     │                     │\r\n        │                     │                     ├─ default RPC\r\n        │                     │                     ├─ warp.id\r\n        │                     │                     └─ Jito bundles\r\n        │                     │\r\n        │                     ├─ PoolFilters (burn \u002F renounced \u002F socials \u002F size)\r\n        │                     ├─ SnipeListCache\r\n        │                     ├─ MarketCache \u002F PoolCache\r\n        │                     └─ PumpFunCache\r\n        │\r\n        ├─ OpenBook markets      (quoteMint memcmp)\r\n        ├─ Raydium AmmV4 pools   (status=6, quoteMint memcmp)\r\n        ├─ pump.fun logs         (Create instruction)\r\n        └─ Wallet SPL changes    (token balance deltas → auto-sell)\r\n```\r\n\r\nKey modules:\r\n\r\n| Path | Purpose |\r\n|------|---------|\r\n| `index.ts` | Entry point — wires `Connection`, `Listeners`, `Bot`, event handlers. |\r\n| `bot.ts` | `Bot` class — Raydium `buy`\u002F`sell` + pump.fun `buyPumpFun`\u002F`sellPumpFun`, filter & price matching. |\r\n| `listeners\u002F` | WebSocket subscriptions (OpenBook, Raydium, pump.fun logs, wallet). |\r\n| `cache\u002F` | In-memory stores for markets, Raydium pools, pump.fun bonding curves, snipe list. |\r\n| `filters\u002F` | Pluggable safety filters applied before a buy. |\r\n| `transactions\u002F` | Pluggable executors (`default`, `warp`, `jito`). |\r\n| `helpers\u002F` | Env loader, logger, wallet parser, Raydium\u002Fpump.fun helpers & pricing. |\r\n\r\n---\r\n\r\n## Requirements\r\n\r\n- **Node.js ≥ 18**\r\n- A funded **Solana wallet** (keep a **dedicated** keypair for the bot — never use your main one).\r\n- A **reliable RPC** — public `api.mainnet-beta.solana.com` will throttle; use Helius, QuickNode, Triton, Shyft, etc.\r\n- 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.\r\n\r\n---\r\n\r\n## Install\r\n\r\n```bash\r\ngit clone https:\u002F\u002Fgithub.com\u002Fmuxprotocol\u002Fsolana-trading-bot.git\r\ncd solana-trading-bot-master\r\nnpm install\r\ncp .env.copy .env\r\n```\r\n\r\nEdit `.env` (see [Configuration](#configuration)) and then:\r\n\r\n```bash\r\nnpm start\r\n```\r\n\r\n---\r\n\r\n## Configuration\r\n\r\nAll settings live in `.env`. Copy from `.env.copy` and edit.\r\n\r\n### Wallet & Connection\r\n\r\n| Var | Example | Notes |\r\n|-----|---------|-------|\r\n| `PRIVATE_KEY` | `base58 \u002F [n,...] \u002F mnemonic \u002F hex` | Accepted formats: base58, JSON array, mnemonic, or 64\u002F128-char hex. Keep secret. |\r\n| `RPC_ENDPOINT` | `https:\u002F\u002F...` | HTTPS RPC. Use a paid provider. |\r\n| `RPC_WEBSOCKET_ENDPOINT` | `wss:\u002F\u002F...` | WebSocket RPC. |\r\n| `COMMITMENT_LEVEL` | `confirmed` | `processed`, `confirmed`, or `finalized`. |\r\n\r\n### Bot\r\n\r\n| Var | Example | Notes |\r\n|-----|---------|-------|\r\n| `LOG_LEVEL` | `trace` | pino log level. |\r\n| `ONE_TOKEN_AT_A_TIME` | `true` | Mutex to process one token at a time. |\r\n| `PRE_LOAD_EXISTING_MARKETS` | `false` | Bulk-fetch OpenBook markets at start (slow). |\r\n| `CACHE_NEW_MARKETS` | `false` | Subscribe to OpenBook markets live. |\r\n| `TRANSACTION_EXECUTOR` | `default` | `default` \\| `warp` \\| `jito`. |\r\n| `COMPUTE_UNIT_LIMIT` | `101337` | `default` executor only. |\r\n| `COMPUTE_UNIT_PRICE` | `421197` | micro-lamports, `default` executor only. |\r\n| `CUSTOM_FEE` | `0.006` | SOL; for `warp` \u002F `jito` executors. |\r\n| `DRY_RUN` | `false` | If `true`, no transaction is broadcast; decisions are logged only. |\r\n| `MAX_OPEN_POSITIONS` | `3` | Max concurrent positions tracked by the bot. |\r\n| `MAX_DAILY_RAYDIUM_BUYS` | `20` | Successful Raydium buy cap per UTC day. |\r\n| `MAX_DAILY_PUMPFUN_BUY_SOL` | `0.05` | Total SOL budget for pump.fun buys per UTC day. |\r\n\r\n### Buy\r\n\r\n| Var | Example | Notes |\r\n|-----|---------|-------|\r\n| `QUOTE_MINT` | `WSOL` | `WSOL` or `USDC` (Raydium side). |\r\n| `QUOTE_AMOUNT` | `0.001` | How much quote token to spend per buy. |\r\n| `AUTO_BUY_DELAY` | `0` | ms delay before sending buy. |\r\n| `MAX_BUY_RETRIES` | `10` | Retry count on confirmation failure. |\r\n| `BUY_SLIPPAGE` | `20` | Percent. |\r\n\r\n### Sell\r\n\r\n| Var | Example | Notes |\r\n|-----|---------|-------|\r\n| `AUTO_SELL` | `true` | Enable auto-sell on wallet balance changes. |\r\n| `AUTO_SELL_DELAY` | `0` | ms delay before sending sell. |\r\n| `MAX_SELL_RETRIES` | `10` | |\r\n| `PRICE_CHECK_INTERVAL` | `2000` | ms between price polls. |\r\n| `PRICE_CHECK_DURATION` | `600000` | ms total TP\u002FSL monitoring window. |\r\n| `TAKE_PROFIT` | `40` | Percent gain. |\r\n| `STOP_LOSS` | `20` | Percent loss. |\r\n| `SELL_SLIPPAGE` | `20` | Percent. |\r\n\r\n### Filters (Raydium)\r\n\r\n| Var | Example | Notes |\r\n|-----|---------|-------|\r\n| `USE_SNIPE_LIST` | `false` | When `true`, all filters are bypassed and only mints in `snipe-list.txt` are bought. |\r\n| `SNIPE_LIST_REFRESH_INTERVAL` | `30000` | ms. |\r\n| `FILTER_CHECK_INTERVAL` | `2000` | ms. |\r\n| `FILTER_CHECK_DURATION` | `60000` | ms — total filter monitoring window. |\r\n| `CONSECUTIVE_FILTER_MATCHES` | `3` | Required matches in a row before buying. |\r\n| `CHECK_IF_MUTABLE` | `false` | Reject if token metadata is mutable. |\r\n| `CHECK_IF_SOCIALS` | `true` | Require non-empty socials in metadata URI. |\r\n| `CHECK_IF_MINT_IS_RENOUNCED` | `true` | Require mint authority = null. |\r\n| `CHECK_IF_FREEZABLE` | `false` | Reject if freeze authority set. |\r\n| `CHECK_IF_BURNED` | `true` | Require LP supply = 0 (burned). |\r\n| `MIN_POOL_SIZE` | `5` | In quote token. |\r\n| `MAX_POOL_SIZE` | `50` | In quote token. Set both to `0` to disable. |\r\n\r\n### pump.fun\r\n\r\n| Var | Example | Notes |\r\n|-----|---------|-------|\r\n| `ENABLE_RAYDIUM` | `true` | Master toggle for the Raydium sniper. |\r\n| `ENABLE_PUMP_FUN` | `false` | Master toggle for pump.fun. |\r\n| `PUMP_FUN_BUY_AMOUNT_SOL` | `0.001` | Native SOL per pump.fun buy. |\r\n| `PUMP_FUN_MAX_CURVE_PROGRESS` | `50` | Percent; skip if bonding curve is already filled past this. |\r\n\r\nNotes on pump.fun:\r\n\r\n- Trades use **native SOL** through the pump.fun bonding curve (no WSOL \u002F Raydium pool). `QUOTE_MINT` \u002F `QUOTE_AMOUNT` do **not** apply.\r\n- A 1% protocol fee is assumed in price calculations; `BUY_SLIPPAGE` and `SELL_SLIPPAGE` are applied on top.\r\n- 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.\r\n- Pool filters (burn, socials, pool size, etc.) **do not** apply to pump.fun — only `PUMP_FUN_MAX_CURVE_PROGRESS` and the snipe list.\r\n\r\n---\r\n\r\n## Snipe list\r\n\r\nCreate \u002F edit `snipe-list.txt` with one mint address per line. Set `USE_SNIPE_LIST=true`. Refreshes every `SNIPE_LIST_REFRESH_INTERVAL` ms.\r\n\r\n```\r\n# snipe-list.txt\r\nSo11111111111111111111111111111111111111112\r\nEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\r\n```\r\n\r\nWorks for both Raydium and pump.fun paths.\r\n\r\n---\r\n\r\n## Running\r\n\r\n```bash\r\nnpm start        # ts-node index.ts\r\nnpm run tsc      # type-check only\r\n```\r\n\r\nStop with `Ctrl+C`. Logs print to stdout via pino-pretty.\r\n\r\n---\r\n\r\n## Transaction executors\r\n\r\n### `default`\r\nStandard `sendRawTransaction` + confirmation. You pay priority via `COMPUTE_UNIT_PRICE` × `COMPUTE_UNIT_LIMIT` micro-lamports.\r\n\r\n### `warp`\r\nBundled through `https:\u002F\u002Ftx.warp.id\u002Ftransaction\u002Fexecute`. A tip of `CUSTOM_FEE` SOL is sent to the warp fee wallet in a leading transfer.\r\n\r\n### `jito`\r\nSends 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.\r\n\r\n---\r\n\r\n## Safety checklist\r\n\r\n- [ ] Use a **dedicated wallet** funded only with what you're willing to lose.\r\n- [ ] Keep `.env` out of version control (`.gitignore` already excludes it).\r\n- [ ] Start with tiny amounts (`QUOTE_AMOUNT=0.001`, `PUMP_FUN_BUY_AMOUNT_SOL=0.001`).\r\n- [ ] For first runs, set `DRY_RUN=true` to verify behavior before risking funds.\r\n- [ ] Use a paid RPC; free endpoints will miss fills.\r\n- [ ] Test `ENABLE_RAYDIUM=false ENABLE_PUMP_FUN=true` or vice versa in isolation first.\r\n- [ ] Monitor logs actively — `LOG_LEVEL=trace` is verbose but informative.\r\n\r\n---\r\n\r\n## Troubleshooting\r\n\r\n| Symptom | Likely cause |\r\n|---------|--------------|\r\n| `PRIVATE_KEY is not set` | `.env` missing \u002F path wrong. |\r\n| `... token account not found in wallet` | You haven't created a WSOL (or USDC) ATA yet. Wrap a tiny amount of SOL first. |\r\n| No pools detected | RPC too slow \u002F filters too strict \u002F wrong `COMMITMENT_LEVEL`. |\r\n| Buys never confirm | Priority fee too low or RPC drops txs; try `warp` \u002F `jito` executor. |\r\n| `Curve progress too high` | Increase `PUMP_FUN_MAX_CURVE_PROGRESS` or loosen. |\r\n| `Bonding curve complete` | Token already graduated to Raydium; pump.fun path can't trade it. |\r\n\r\n---\r\n\r\n## Project layout\r\n\r\n```\r\n.\r\n├── bot.ts                       Core Bot (buy\u002Fsell for both DEXes)\r\n├── index.ts                     Entry point & event wiring\r\n├── cache\u002F\r\n│   ├── market.cache.ts\r\n│   ├── pool.cache.ts\r\n│   ├── pumpfun.cache.ts         pump.fun bonding curve state cache\r\n│   └── snipe-list.cache.ts\r\n├── filters\u002F                     PoolFilters + individual filters\r\n├── helpers\u002F\r\n│   ├── constants.ts             Env var parsing\r\n│   ├── liquidity.ts             createPoolKeys for Raydium\r\n│   ├── logger.ts\r\n│   ├── market.ts                MinimalMarketLayoutV3\r\n│   ├── pumpfun.ts               pump.fun program + layout + ix builders + pricing\r\n│   ├── promises.ts\r\n│   ├── token.ts                 WSOL \u002F USDC\r\n│   └── wallet.ts\r\n├── listeners\u002Flisteners.ts       WebSocket subscriptions\r\n├── transactions\u002F\r\n│   ├── default-transaction-executor.ts\r\n│   ├── warp-transaction-executor.ts\r\n│   └── jito-rpc-transaction-executor.ts\r\n├── .env.copy                    Template\r\n├── snipe-list.txt               Whitelist (optional)\r\n└── tsconfig.json\r\n```\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT — see `LICENSE.md`.\r\n\r\n## Credits\r\n\r\n- Original Raydium sniper by Filip Dundjer \u002F warp.id.\r\n- pump.fun integration layered on top.\r\n- Built on `@solana\u002Fweb3.js`, `@solana\u002Fspl-token`, `@raydium-io\u002Fraydium-sdk`, `@metaplex-foundation\u002Fmpl-token-metadata`.\r\n","这是一个Solana链上的交易机器人，专门用于在Raydium AMM v4和pump.fun平台上狙击新上线的代币。项目具备实时链上监控、MEV就绪执行（支持Jito\u002FWarp）、安全过滤器、自动买卖、止盈止损等功能。使用TypeScript编写，能够监听新开设的流动性池并在同一区块窗口内进行购买；同时，它还能检测pump.fun平台上的新代币创建，并通过债券曲线程序早期买入直至毕业卖出。适合于希望自动化参与Solana生态中高风险高收益活动的用户，但需要注意的是，此类操作存在极大风险，包括但不限于地毯拉扯、蜜罐陷阱等，因此仅建议用可承受损失的资金进行尝试。",2,"2026-06-11 04:00:34","CREATED_QUERY"]