[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-93160":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":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},93160,"solana-arbitrage-trading-bot","bigmacman1129\u002Fsolana-arbitrage-trading-bot","bigmacman1129","Solana arbitrage bot in Rust that scans DEX prices via Jupiter, detects profitable opportunities, and executes trades automatically with optimized RPC performance.","",null,"Rust",54,46,48,0,1,42.12,false,"main",true,[22,23,24,25,26,27,28],"arbitrage-bet","dex","grpc","jupiter","rust","solana","trading-bot","2026-07-22 04:02:08","# Solana Arbitrage Bot\n\n**Solana arbitrage bot** — a Rust bot that discovers and executes profitable DEX arbitrage on Solana via the [Jupiter](https:\u002F\u002Fjupiter.ag) aggregator. RPC-only execution. Supports **continuous quote polling** and optional **Yellowstone gRPC** big-trade monitoring.\n\n*Search: solana arbitrage bot · Solana arbitrage · Jupiter arbitrage bot · DEX arbitrage Rust · Solana trading bot · Yellowstone gRPC · Jupiter API.*\n\n**Contact:** [@hodlwarden](https:\u002F\u002Ft.me\u002Fhodlwarden)\n\n\n### How it works\n\n1. **Discovery** — **Polling:** sweeps a notional range in a grid across all configured base tokens concurrently, requests Jupiter quotes, keeps opportunities above min profit after fees. **Big-trades:** optional Yellowstone gRPC subscription triggers quote simulation on large flows.\n2. **Execution** — Builds swap instructions via Jupiter API, advances nonce, submits via RPC with requested compute and priority fee.\n\n**Workflow:**\n\n![Architecture: Config → Discovery → Jupiter Quotes → Fee check → Execution](images\u002Farchitecture-diagram.png)\n\n**Profit calculation** (execute only when net profit ≥ min profit):\n\n![Profit calculation: notional grid, gross profit, tx cost, net profit, execute if ≥ min_profit](images\u002Fprofit-calculation-flow.png)\n\n---\n\n## Test Results\n\n**$0.006 Profit** - \n[$77 -> $0.006 Profit](https:\u002F\u002Fsolscan.io\u002Ftx\u002F4ASCHbwF2q3ZeeKJgcUx93mtTwHHYwu29bmerU3KJPmGupMziqFvnQScuam8Yx4e458TSRwd9QhxC1HSiHT6EZLc#balance_change)\n\n**$0.011 Profit** - \n[$77 -> $0.011 Profit](https:\u002F\u002Fsolscan.io\u002Ftx\u002F4uQ4sANAv6oGoBeqE28T7CNQ1fDMX7EsduA87yhhBwpVXGyspVwHokkGa9oC11UEY7Kw6DK5sdWngHgDC7hz9GAS#balance_change)\n\n---\n\n## Features\n\n- **Dual discovery modes**\n  - **Continuous polling** — Queries Jupiter quotes across configurable amount ranges and all base tokens **concurrently** (FuturesUnordered). Adaptive interval halves on opportunity found (min 100 ms) and gradually restores when the market is quiet.\n  - **Big-trades monitor** — Subscribes to Yellowstone gRPC for large on-chain flows and reacts with quote simulation.\n- **8 liquid intermediates per base token** — Each base token is tested against USDC, USDT, WSOL, mSOL, JitoSOL, JUP, ETH (Wormhole), and WBTC to maximize path coverage per round.\n- **Circuit breaker** — Automatically pauses trade submission for 30 seconds after 5 consecutive failures; discovery continues while paused.\n- **P&L tracker** — Tracks cumulative SOL profit, win rate, and trade counts. Stats are logged every 50 poll rounds.\n- **Rate-limited Jupiter calls** — A semaphore caps concurrent Jupiter API requests at 8 to prevent rate-limiting.\n- **RPC-only submission** — Transactions are submitted via your configured `submit_endpoint` using standard Solana SDK. No third-party relay dependencies.\n- **Multi-token support** — Configure base tokens (e.g. USDC, SOL) with notional ranges, grid steps, and min-profit thresholds.\n- **Transaction cost awareness** — Estimates fee (compute, priority, tip) and SOL price (refreshed every 5 min) to filter only profitable trades.\n- **Nonce-based submission** — Uses a durable nonce account for reliable transaction lifecycle.\n\n---\n\n## Prerequisites\n\n- **Rust** (stable, e.g. 1.70+): [rustup](https:\u002F\u002Frustup.rs)\n- **Solana RPC** — A node or provider (e.g. Helius, QuickNode, Triton) with `submitTransaction` support.\n- **Wallet** — Keypair file for the bot and a funded **nonce account**.\n- **Jupiter API** — Either the public Jupiter API or a self-hosted proxy; configurable in `Config.toml`.\n- **Yellowstone gRPC** (optional) — Only if you enable big-trades monitoring; requires endpoint and auth token.\n\n---\n\n## Quick Start\n\n1. **Clone and build**\n\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fhodlwarden\u002Fsolana-arbitrage-bot.git solana-arbitrage-bot && cd solana-arbitrage-bot\n   cargo build --release\n   ```\n\n2. **Create a nonce account** (one-time setup)\n\n   Use the Solana CLI to create and fund a durable nonce account:\n\n   ```bash\n   # Generate a nonce authority keypair (or reuse your bot wallet)\n   solana-keygen new -o nonce-authority.json\n\n   # Create the nonce account (fund it with enough SOL for rent, ~0.002 SOL)\n   solana create-nonce-account nonce-account.json 0.01 --nonce-authority nonce-authority.json\n\n   # Get the nonce account public key and paste it into Config.toml\n   solana address -k nonce-account.json\n   ```\n\n   Set `nonce_account_pubkey` in your config to the address printed above.\n\n3. **Configure**\n\n   Copy `Config.example.toml` to `Config.toml` (or `settings.toml`) and fill in your values. **Do not commit secrets.** The app loads `settings.toml` first, then falls back to `Config.toml`. Set at minimum:\n\n   - `signer_keypair_path`, `rpc_endpoint`, `submit_endpoint`\n   - `dex_api.endpoint` (Jupiter API or proxy)\n   - `strategy.nonce_account_pubkey` and `strategy.instruments`\n   - `[fees]` block\n\n4. **Run**\n\n   ```bash\n   cargo run --release\n   # Or after build: .\u002Ftarget\u002Frelease\u002Fjupiter_arbitrage_bot_offchain\n   ```\n\n   Set `RUST_LOG=info` (or `debug`) to control log level.\n\n---\n\n## Configuration\n\nConfiguration is TOML-based. See `Config.example.toml` for the full reference.\n\n| Section       | Purpose |\n|---------------|---------|\n| `[connection]` | `signer_keypair_path`, `rpc_endpoint`, `submit_endpoint`; optional `geyser_endpoint`, `geyser_auth_token` for Yellowstone. |\n| `[dex_api]`   | Jupiter API `endpoint` and optional `auth_token`. |\n| `[strategy]`  | `instruments` (base tokens with mint, notional range, grid steps, min profit), `nonce_account_pubkey`, `default_quote_mint`, `polling_enabled` \u002F `poll_interval_ms`, `geyser_watch_enabled`, `execution_enabled`. |\n| `[fees]`      | `compute_unit_limit`, `priority_fee_lamports`, `relay_tip_sol`; optional `third_party_fee_profit_pct` (e.g. `0.5` = 50% of gross profit in SOL); optional `sol_price_usd` fallback. |\n\n### Third-party fee (fixed vs profit-based)\n\nTransaction cost includes a **base network fee** plus an optional **tip**. You can set the tip in two ways:\n\n- **Fixed** — A constant amount in SOL per trade. Use `relay_tip_sol`.\n- **Profit-based** — A fraction of the trade's **gross profit in SOL**. Use `third_party_fee_profit_pct` (0.0–1.0). When set, the tip is computed as **gross profit (in SOL) × this value**.\n\n**Example (profit-based):**  \nIf gross profit is **0.1 SOL** and you set `third_party_fee_profit_pct = 0.5`, the tip is **0.05 SOL**. Net profit (after base fee and this tip) is then used to decide if the trade meets `min_profit` and is submitted.\n\n**Config examples:**\n\n```toml\n# Fixed tip: 0.00001 SOL per trade\n[fees]\nrelay_tip_sol = 0.00001\n```\n\n```toml\n# Profit-based: 50% of gross profit in SOL as tip\n[fees]\nrelay_tip_sol = 0.00001   # fallback when profit-based is 0\nthird_party_fee_profit_pct = 0.5\n```\n\nIf `third_party_fee_profit_pct` is set and in range (0, 1], it overrides `relay_tip_sol` for that trade; otherwise `relay_tip_sol` is used.\n\n---\n\n## Project Layout\n\n| Path        | Description |\n|------------|-------------|\n| `src\u002Fapp\u002F` | Configuration and runtime settings (node, swap API, strategy, fees). |\n| `src\u002Fchain\u002F` | Chain data and constants (program maps, token info, fee constants). |\n| `src\u002Fengine\u002F` | Arbitrage engine: Jupiter integration, discovery (polling + big-trades), execution, runtime (nonce, blockhash, SOL price, fee cost, circuit breaker, P&L stats). |\n","这是一个基于 Rust 开发的 Solana 链上 DEX 套利交易机器人，通过 Jupiter 聚合器实时扫描跨 DEX 价格差异，识别扣除手续费后的净收益机会并自动执行套利交易。核心特点包括双模发现机制（并发轮询 + Yellowstone gRPC 大额交易监听）、8 种主流中间代币路径覆盖、RPC 原生交易提交、动态间隔调整、电路断路器及 P&L 统计。适用于 Solana 生态高频、低延迟的跨流动性池套利场景，尤其适合对接自有 RPC 节点和追求确定性执行的量化策略部署。",2,"2026-07-12 02:30:05","CREATED_QUERY"]