Open Source — OCTO v2

SourceX Optimax

Optimax's open-source OCTO v2 is now available for everyone.

AI-powered cross-exchange BTC/USDT arbitrage engine. Real-time spread detection across 8 exchanges, GPT-4o analysis, and autonomous trade execution.

0
Exchanges
0+
Lines of Code
0
Python Files
0
Dev Phases
0
Trading Pairs

Modular Event-Driven Design

7 independent layers communicating through a thread-safe EventBus. Async Python architecture built for speed and reliability.

Core Engine

Central orchestrator managing price collection, spread calculation, opportunity detection, AI consultation, order execution and risk management on an async event loop.

asyncioEventBusState Machine

AI Advisor (GPT-4o)

Analyzes arbitrage opportunities using OpenAI GPT-4o Structured Outputs with Pydantic schemas. Returns EXECUTE/SKIP/WAIT decisions with post-trade learning feedback loop.

GPT-4oPydanticStructured Output

Price Feed

WebSocket-first, REST-fallback real-time price streams from all 8 exchanges. Order book depth, bid/ask spread and latency measurement with DirectHTTP failover.

WebSocketREST APIccxtFallback

Smart Executor

Intelligent order type selection (IOC/PostOnly/Market), concurrent buy+sell via asyncio.gather(), graduated rollback, partial fill recovery.

asyncio.gatherLimit+IOCAdaptive Timeout

Signal Generator

Multi-criteria composite scoring: spread 30%, liquidity 15%, slippage 10%, freshness 10%, order flow 15%, execution quality 20%. Adaptive thresholds.

Composite ScoringAdaptiveOrder Flow

Risk Management

Circuit breaker, 2% daily loss limit, emergency stop, cooldown mechanism, spoofing detection, fake liquidity filtering. Auto crash recovery.

Circuit BreakerFailsafeSpoofing Detect

Fund Management

Central wallet management, AI-weighted distribution, auto-rebalance every 5min, cost-optimized routing (TRC20 vs BTC), predictive fund need forecasting.

Smart RebalancerAuto-DistributeTRC20/BTC

Real-Time GUI

Professional dark-themed desktop interface with CustomTkinter. 4-column layout, live prices, spread heatmap, depth chart, P&L graph, AI log. 20Hz polling.

CustomTkinterDark ThemeCanvas Charts

Database Layer

SQLAlchemy ORM + SQLite for trade records, P&L tracking, volatility history. Clean repository pattern data access layer with auto migration.

SQLAlchemySQLiteRepository Pattern

Supported Exchanges

Custom configuration per exchange: fee rates, withdrawal costs, rate limits, networks. 56 unique arbitrage pairs (8x7).

Binance
0.10% taker
WS + REST | 1200/min
Kraken
0.26% taker
WS + REST | 900/min
KuCoin
0.10% taker
WS + REST | 600/min
Bybit
0.10% taker
WS + REST | 600/min
OKX
0.10% taker
WS + REST | 600/min
Gate.io
0.20% taker
WS + REST | 900/min
HTX
0.20% taker
WS + REST | 600/min
Bitfinex
0.20% taker
WS + REST | 900/min

Execution Pipeline

From opportunity detection to trade execution — the full lifecycle of an arbitrage trade.

1

Price Feed (WebSocket + REST)

Real-time bid/ask/depth from 8 exchanges. 1000ms interval, WebSocket-first with REST fallback.

2

Spread Calculator

Net spread across all 56 exchange pairs. Dynamic per-exchange network fees included.

3

Signal Generator

Composite scoring: spread 30% + liquidity 15% + slippage 10% + freshness 10% + flow 15% + quality 20%

4

AI Advisor (GPT-4o)

Structured Output EXECUTE/SKIP/WAIT decision. Market sentiment, volatility, trade history analysis.

5

Risk Check (Failsafe)

Daily loss limit, open trade limit, cooldown check, circuit breaker, spoofing filter.

6

Smart Executor

Concurrent buy+sell via asyncio.gather(). Smart order type, adaptive timeout, partial fill recovery.

7

Post-Trade Learning & Rebalance

Result recording, execution quality tracking, automatic fund rebalancing, AI feedback loop.

Full Feature Set

Comprehensive capabilities developed across 7 implementation phases.

AI-Powered Decisions

GPT-4o Structured Output for intelligent trade decisions with post-trade learning

Paper Trading

Volume-aware slippage, per-exchange fees, order book depth simulation

Spread Heatmap

8x8 real-time spread matrix with color-coded opportunity visualization

Spoofing Detection

Tracks large orders, detects vanishing liquidity when price approaches

Auto-Rebalance

5-minute interval checks, TRC20/BTC cost optimization, predictive transfers

Adaptive Timeout

Per-exchange p95 latency x 2, clamped to [3s-15s], automatic adjustment

Order Flow Analysis

Bid/ask imbalance, CVD, VWAP drift, aggregate direction prediction

Adaptive Thresholds

Dynamic min spread based on volatility, automatic market condition adaptation

Central Wallet

USDT/BTC central wallet, AI-weighted distribution, auto profit collection

Crash Recovery

Orphan trade detection, automatic recovery, state restoration

Telegram Notifications

Trade, emergency, P&L and connection status push notifications

Detailed Reporting

Trade history, P&L analysis, exchange performance, AI cost tracking

Technology Stack

Production-grade infrastructure. Async Python, professional GUI, AI integration and robust database.

01

Python 3.11+ & asyncio

High-performance async event loop, concurrent tasks, type hints

Async
02

OpenAI GPT-4o

Structured Outputs, Pydantic schemas, intelligent trade decisions

AI
03

ccxt + WebSocket

Unified API for 8 exchanges, real-time feeds with REST fallback

8 Exchanges
04

CustomTkinter

Modern dark-themed desktop GUI, 1600x950, 15 panels, 20Hz refresh

GUI
05

SQLAlchemy + SQLite

ORM with repository pattern, trade records, P&L tracking

DB
06

Fernet Encryption

API key encryption, .env secrets, secure credential management

Security

Project Structure

7 modules, 70 Python files, 13,700+ lines of code.

sourcex-octo/ ├── main.py # Entry point ├── config.yaml # Operational configuration ├── .env # API keys (secrets) │ ├── ai/ # AI Advisory Module (4 files) │ ├── advisor.py # GPT-4o integration │ ├── prompts.py # AI prompt templates │ └── schemas.py # Pydantic structured output │ ├── config/ # Configuration (5 files) │ ├── exchanges.py # 8 exchange parameters │ ├── settings.py # Settings loader + dataclasses │ └── risk.py # Risk parameters │ ├── core/ # Core Engine (24 files) │ ├── engine.py # Main arbitrage engine │ ├── executor.py # Smart order execution │ ├── signal.py # Multi-criteria signal generator │ ├── spread_calc.py # Spread calculation │ ├── price_feed.py # WebSocket + REST price feed │ ├── execution_metrics.py # Latency tracking [Phase 5] │ ├── spoofing_detector.py # Fake liquidity detection [Phase 6] │ ├── rebalancer.py # Smart rebalancing [Phase 7] │ └── ... # +15 additional modules │ ├── exchanges/ # Exchange API (4 files) │ ├── wrapper.py # Unified ccxt wrapper │ ├── factory.py # Exchange factory pattern │ └── rate_limiter.py # API rate limiting │ ├── gui/ # Interface (18 files) │ ├── app.py # Main window (1600x950) │ ├── theme.py # Dark theme + colors │ ├── frames/ # 15 panels │ └── widgets/ # Custom widgets (heatmap, depth, sparkline) │ ├── db/ # Database (4 files) │ ├── models.py # SQLAlchemy models │ ├── repository.py # Data access layer │ └── database.py # DB manager │ └── utils/ # Utilities (6 files) ├── events.py # EventBus pub/sub ├── notifier.py # Telegram notifications └── crypto.py # Fernet encryption

Get Sourcex Octo

No Python installation required. Download the pre-built binary for your platform and the setup wizard will guide you.

Windows

v1.0.0 — Portable .exe
  • Windows 10 or later (64-bit)
  • 4 GB RAM minimum
  • 300 MB free disk space
  • No Python needed
Download for Windows

~144 MB (zip archive)

macOS

v1.0.0 — DMG Installer
  • macOS 12 Monterey or later
  • Apple Silicon (M1+) or Intel
  • 4 GB RAM minimum
  • 300 MB free disk space
Download for macOS

~160 MB (DMG image)

Source Code

v1.0.0 — Python 3.11+
  • Python 3.11 or later
  • pip package manager
  • Windows / macOS / Linux
  • 27 dependencies (auto-installed)
Download Source (.zip)

~2 MB (zip archive)

Ready to Deploy Sourcex Octo?

Get in touch with our team to learn more about institutional access and whitelabel integration.