Open-source execution engine for detecting and acting on price spreads across CEX and prediction markets
Cortex AI is an open-source, non-custodial framework for building and running automated arbitrage strategies. It connects to multiple exchanges through read and write API keys, monitors order books in real time, and executes trades locally on your machine with no third-party custody and no cloud dependency.
If you have been searching for a free crypto arbitrage bot on GitHub that you can actually inspect, modify, and run on your own hardware, this project is built for exactly that. It is not a closed-source ai trading app that hides its logic behind a subscription. It is a transparent, developer-friendly alternative for traders who want to understand what their bot is doing.
The project is designed for traders and developers who want full control over their execution logic. You configure the venues, define the spread thresholds, and decide when to act. Cortex AI handles the monitoring, risk checks, and order routing. You can connect it to Binance, Bybit, OKX, Gate, Bitget, or any exchange with a public API, and you can run it as a pure scanner or as a live execution engine.
For those looking for an ai trading bot that combines automation with optional intelligence, Cortex AI supports pluggable AI models including Claude AI, Gemini, and OpenAI-compatible endpoints. The AI layer is entirely optional. If you prefer rule-based arbitrage, you can run the framework without any AI provider at all.
What it is not: It is not a profit guarantee, not a managed fund, and not a signal-selling service. All configuration and financial outcomes remain your own responsibility.
Core capabilities:
- ๐ก Real-time spread scanner monitors BTC, ETH, TON, SOL and other pairs across multiple exchanges simultaneously
- โก Low-latency order routing with local execution and minimal overhead
- ๐ง Optional AI-assisted signal filtering integrates with Claude, Gemini, and OpenAI-compatible APIs for sentiment and volatility context
- ๐ Non-custodial key vault stores API keys locally with no withdrawal permissions required
- ๐ก๏ธ Risk controls include configurable slippage limits, MEV protection, and per-trade caps
- ๐ Live dashboard shows P&L tracking, trade history, and spread heatmaps
- ๐ง Modular architecture makes it easy to add new exchanges, custom strategies, or alternative data sources
graph TD
A[Order Book Stream] --> B(Scanners: Binance/Bybit/OKX)
B --> C{Spread Calculator}
C -->|Spread > Threshold| D[Risk & Slippage Check]
C -->|Optional| E[LLM Sentiment Filter]
E --> D
D -->|Passed| F[Local Execution Router]
F --> G[Exchange APIs]
| Feature | Cortex AI | Manual Arbitrage | Signal Groups | Closed-Source Bots |
|---|---|---|---|---|
| Open Source | โ Full code access | โ | โ No | โ No |
| Non-Custodial | โ Keys stay local | โ Yes | โ Funds held | |
| Multi-Exchange | โ 4+ venues | โ No | โ Some | |
| AI Signal Layer | โ Optional | โ No | โ Rare | |
| Local Execution | โ Yes | โ Yes | โ Cloud only | |
| Configurable Risk | โ Full control | โ Manual | โ No | |
| Transparent Fees | โ No hidden cuts | โ No fees | โ Subscription | |
| Free Forever | โ MIT License | โ Free | โ Paid |
If you have been searching for a free crypto arbitrage bot github project that does not hide its code, Cortex AI is built for exactly that. Unlike closed-source ai trading apps that ask for your API keys and hold your funds, this framework keeps everything local and transparent.
- Simultaneous order-book monitoring across Binance, Bybit, OKX, and HTX
- Configurable refresh interval with a default of 10 seconds
- Spread heatmap with historical comparison
- Supports 16+ trading pairs out of the box
- Works as a standalone arbitrage scanner even if you never enable live execution
- Local order routing with sub-second execution targets
- Configurable slippage tolerance and max position size
- Automatic rebalancing between venues
- Demo mode for testing strategies without capital
- Compatible with low-latency VPS setups for faster fills
- Pluggable LLM integration for sentiment and volatility context
- Supports Claude AI, Gemini, and OpenAI-compatible APIs
- Signals are advisory only and execution logic remains fully under your control
- No external data leaves your machine unless you enable it
- Designed for traders who want an ai trading bot with optional intelligence, not a black box
- Non-custodial architecture where API keys never leave your local environment
- IP whitelisting support for all exchange connections
- Read-only mode available for monitoring-only use
- No telemetry, no analytics, no phone-home
- Safe to test alongside your existing trading tools without conflicts
| Parameter | Description | Default |
|---|---|---|
EXECUTION_MODE |
DEMO or LIVE |
DEMO |
SCAN_INTERVAL |
Order-book refresh rate in ms | 10000 |
MAX_SLIPPAGE |
Maximum acceptable slippage in percent | 0.15 |
MIN_SPREAD |
Minimum spread to trigger alert in percent | 0.10 |
MAX_POSITION |
Maximum position size per trade in USDT | 100 |
AI_SIGNALS |
Enable LLM-based signal filtering | false |
All parameters are configured in the .env file and can be changed without editing code. |
โก Quick and easy โ takes less than 2 minutes!
Prerequisites:
- Python 3.11+
- Node.js 20+ for the optional MCP server
- Exchange API keys with read and write permissions, IP whitelisted
Step 1 โ Clone the repository:
git clone https://github.com/cortex-ai-lab/cortex-ai-trading-bot.git
cd cortex-ai-trading-bot
pip install -r requirements.txt
npm install
cp .env.example .envStep 2 โ Install dependencies:
pip install -r requirements.txt
npm installStep 3 โ Configure your environment:
cp .env.example .env
Edit .env with your API credentials:
env
BINANCE_API_KEY="your-key"
BINANCE_SECRET="your-secret"
BYBIT_API_KEY="your-key"
OKX_API_KEY="your-key"
EXECUTION_MODE="DEMO"
SCAN_INTERVAL=10000
MIN_SPREAD=0.10
MAX_POSITION=100Step 4 โ Run the scanner:
python main.py --mode=scanner
Step 5 โ Monitor the dashboard:
Open http://localhost:8080 in your browser to see live spreads and execution logs.
๐ Folder Structure
text
cortex-ai-trading-bot/
โโโ main.py
โโโ config/
โ โโโ .env
โโโ scanners/
โ โโโ binance.py
โ โโโ bybit.py
โ โโโ okx.py
โโโ execution/
โ โโโ router.py
โ โโโ risk.py
โโโ dashboard/
โ โโโ index.html
โโโ logs/
โโโ trades.logNo. Cortex AI is an open-source AI trading bot, not a profit guarantee. It helps you find and act on price spreads across exchanges like Binance, Bybit, OKX, and HTX, but arbitrage is competitive and carries real financial risk. Many spreads close before execution, and fees can eat into margins. If you are searching for a "free crypto arbitrage bot github" or an "ai trading bot" that prints money, this is not it. This is a developer tool for building and running your own automated arbitrage strategies.
Possibly. Automated crypto trading can result in losses, especially if misconfigured. Use DEMO mode first, understand the logic, and only deploy capital you can afford to lose. This framework is used by traders who want full control over their own execution logic, not by people looking for a passive income machine.
No. Cortex AI is fully open-source under the MIT License. There are no subscription fees, no profit sharing, and no hidden cuts. You keep 100 percent of any gains and bear 100 percent of any losses. Unlike many "ai trading app" services that charge monthly fees, this is a free and open alternative.
The bot is non-custodial and never holds your funds. API keys are stored locally on your machine. For maximum safety, use read-only API keys first and disable withdrawal permissions entirely. This architecture is designed for traders who want to connect to Binance, Bybit, OKX, or Gate without giving up control of their capital.
The project is maintained actively. Check the Releases page for the latest version and changelog. New exchange connectors and AI model integrations are added regularly, including support for Claude AI, Gemini, and OpenAI-compatible APIs.
Yes. Cortex AI runs on Windows, macOS, and Linux. Python 3.11+ is required. The framework is lightweight enough to run on a local machine, but a low-latency VPS is recommended for live execution.
The framework is primarily built for crypto exchange APIs. Stock and forex connectors are experimental and may require custom implementation. The core engine is designed around crypto arbitrage and cross-exchange spread detection.
The bot logs all activity to logs/trades.log and will attempt to reconnect automatically. However, you should monitor it during active use because no automation is 100 percent reliable. If you are running live strategies, always keep an eye on the dashboard.
Cortex AI is model-agnostic. It can integrate with Claude AI, Gemini, and OpenAI-compatible endpoints for optional signal filtering and market context. The AI layer is advisory only โ execution logic remains fully under your control. You can run the bot without any AI provider if you prefer pure rule-based arbitrage.
No. Cortex AI focuses on cross-exchange arbitrage between centralized venues like Binance, Bybit, OKX, and HTX. It does not execute flash loans or on-chain MEV strategies. If you are looking for a flash loan arbitrage bot, this framework is not designed for that use case.
Cortex AI reads public order-book data from connected exchanges, calculates spreads in real time, and presents them in a local dashboard. When a spread exceeds your configured threshold, the bot can either alert you or execute a trade, depending on your EXECUTION_MODE.
This makes it a practical AI trading bot for anyone who wants to build a free crypto arbitrage bot without relying on a closed-source ai trading app. The framework supports connections to major venues including Binance, Bybit, OKX, Gate, and Bitget, and can be extended to any exchange with a public API.
All logic runs locally on your machine. No data is sent to external servers unless you explicitly enable an AI signal provider. If you use Claude AI, Gemini, or OpenAI-compatible models for signal filtering, only the data you choose to send is transmitted. Otherwise, the bot operates fully offline from third-party services.
For developers searching for an open-source trading bot with Python, this project is designed to be readable, modular, and easy to extend. You can add new exchanges, custom risk rules, or alternative AI models without rewriting the core engine.
| Issue | Solution |
|---|---|
| Scanner shows no data | Verify API keys are valid and have read permissions |
| Execution fails | Check MAX_SLIPPAGE and MAX_POSITION settings and ensure sufficient balance on both venues |
| Dashboard not loading | Confirm port 8080 is not blocked by firewall |
| AI signals not working | Verify API key for your LLM provider is set and AI_SIGNALS=true |
| Bot crashes on startup | Check Python version is 3.11+ and reinstall dependencies |
| Exchange connection timeout | Check your internet connection and confirm the exchange API is not under maintenance |
| Spreads appear but no trades execute | Ensure EXECUTION_MODE is set to LIVE and that your API keys have write permissions |
Cortex AI is an open-source software project provided for educational and research purposes only.
Trading cryptocurrencies and other financial instruments involves substantial risk of loss. Past performance of any strategy, whether simulated or live, does not guarantee future results. You are solely responsible for your configuration, your capital, and your outcomes.
Cortex AI operates on a strictly non-custodial basis. We do not manage, store, or have access to your funds, private keys, or API credentials.
Nothing in this repository constitutes financial advice. Use at your own risk.
