Production-grade TypeScript arbitrage scanner and execution framework for Solana, built around the Axiom on-chain trading terminal and Jupiter aggregator routing. Detects cross-DEX, triangular, and CEX-DEX spread opportunities with configurable risk controls, circuit breakers, and dry-run execution by default.
Safety first: This bot does not move mainnet funds by default.
DRY_RUN=trueandEXECUTION_ENABLED=falseare the defaults. Review risk limits and wallet configuration before enabling live execution.
| Module | Description |
|---|---|
| Cross-DEX strategy | Compare quotes across Jupiter, Axiom, Raydium, Orca, Meteora, and Phoenix to find two-leg spreads |
| Triangular strategy | Detect cyclic profit paths (A → B → C → A) via aggregator routing |
| CEX-DEX strategy | Compare simulated CEX mid prices against on-chain DEX quotes |
| Axiom integration | Dedicated client for Axiom terminal API with mock fallback |
| Jupiter quotes | Live quote API support (quote-api.jup.ag) with retry logic |
| Risk manager | Min profit (bps), max slippage, trade size caps, daily limits, confidence scoring |
| Circuit breaker | Halts execution after consecutive failures with auto cooldown |
| REST API | Health, stats, scan, and config endpoints |
| CLI | One-shot and continuous scanning modes |
src/
├── config/ Zod-validated environment configuration
├── types/ Shared domain types
├── market/ Token registry + price feed
├── exchanges/ Jupiter, Axiom, mock DEX clients
├── strategies/ Cross-DEX, triangular, CEX-DEX
├── core/ Arbitrage engine orchestrator
├── risk/ Risk manager + circuit breaker
├── execution/ Trade executor (dry-run / live)
├── api/ Express HTTP server
├── utils/ Logger, math, retry helpers
├── cli.ts Command-line interface
└── index.ts Main entry (API + continuous scan)
cd axiom-arbitrage-trading-bot
cp .env.example .env
npm install
npm test
npm run build
npm startVerify the API:
curl http://127.0.0.1:8790/api/health
curl -X POST http://127.0.0.1:8790/api/v1/scannpm run scan:oncenpm run scannpm run cli -- scan --once --json
npm run cli -- stats
npm run cli -- healthCopy .env.example to .env and adjust:
| Variable | Default | Description |
|---|---|---|
BOT_MODE |
mock |
mock (simulated) or live (real APIs) |
SOLANA_RPC_URL |
mainnet RPC | Solana JSON-RPC endpoint |
AXIOM_API_KEY |
unset | Axiom terminal API key |
JUPITER_QUOTE_URL |
Jupiter v6 | Quote API base URL |
MIN_PROFIT_BPS |
15 |
Minimum net profit in basis points |
MAX_SLIPPAGE_BPS |
50 |
Max slippage tolerance |
MAX_TRADE_SIZE_SOL |
1 |
Max trade size per opportunity |
MAX_DAILY_TRADES |
100 |
Daily execution cap |
EXECUTION_ENABLED |
false |
Enable trade execution |
DRY_RUN |
true |
Simulate trades without submitting txs |
WATCH_TOKENS |
SOL,USDC,... | Comma-separated token symbols |
SCAN_INTERVAL_MS |
5000 |
Continuous scan interval |
PORT |
8790 |
HTTP API port |
| Method | Path | Description |
|---|---|---|
GET |
/api/health |
Liveness probe |
GET |
/api/v1/stats |
Bot statistics |
GET |
/api/v1/config |
Active configuration (safe fields) |
POST |
/api/v1/scan |
Trigger one arbitrage scan |
Buys a token on the cheapest venue and sells on the most expensive venue for the same pair. Ideal for memecoin volatility on Solana where Raydium, Orca, Meteora, and Jupiter routes diverge briefly.
Finds three-hop cycles (e.g. SOL → USDC → BONK → SOL) where the round-trip output exceeds input after fees and estimated gas.
Compares centralized exchange mid prices (simulated in mock mode; wire Binance/Bybit/OKX websockets for production) against on-chain DEX quotes for latency-arbitrage windows.
- Set
BOT_MODE=liveand configure a reliableSOLANA_RPC_URL(Helius, QuickNode, or Alchemy). - Add your
AXIOM_API_KEYfor Axiom terminal routing. - Wire CEX websocket feeds into
CexDexStrategyfor real CEX-DEX spreads. - Set conservative
MIN_PROFIT_BPS,MAX_TRADE_SIZE_SOL, andMAX_DAILY_TRADES. - Only enable
EXECUTION_ENABLED=trueafter thorough dry-run validation. - Store
WALLET_PRIVATE_KEYsecurely — never commit it to version control.
| Script | Purpose |
|---|---|
npm run build |
Compile TypeScript to dist/ |
npm start |
Start API server + continuous scanner |
npm run dev |
Development mode with hot reload |
npm test |
Run Vitest test suite |
npm run lint:types |
TypeScript type check |
npm run scan:once |
One-shot CLI scan |
npm run scan |
Continuous CLI scanning |
MIT — see LICENSE.
Need help deploying, configuring strategies, or integrating with Axiom / Jupiter?
Contact us on Telegram for technical support:
| Channel | Handle |
|---|---|
| Telegram | @tradingtermin |
We respond to setup questions, configuration issues, and integration requests.