How cortex-ai-quant/crypto-arbitrage-bot-automated-trading works
Purpose and Scope
This repository is a small Python implementation scaffold for a crypto-arbitrage bot. The README presents a broader “Cortex AI” trading product, but the checked-in source surface is limited to configuration, market scanning, and execution modules under src/. Claims about dashboards, binaries, AI inference, MEV protection, and multi-chain routing are not verifiable from the provided tree.
Entry Points and Runtime
The likely runtime is Python 3.10+ with dependencies installed from requirements.txt. No CLI script, service launcher, web server, or packaged executable is present in the tree; consumers likely import the package or invoke a module externally.
• Package boundary: src/__init__.py
• Dependency declaration: requirements.txt
• Automation/validation boundary: .github/workflows/ci.yml
Configuration and Secrets Boundary
src/config.py is the architecture’s expected source for runtime settings: exchange endpoints, API credentials, trading thresholds, symbols, or risk limits. It should isolate environment-specific and sensitive values from scanning/execution logic. The repository does not expose a dedicated secrets manager, database, or deployment manifest.
• Configuration component: src/config.py
• Ignore policy likely protects local artifacts/secrets: .gitignore
Market Discovery / Opportunity Scanning
src/scanner.py is the market-data and strategy-detection stage. It is the natural boundary for obtaining quotes/order-book information from exchanges or chain/DEX providers, normalizing prices, and emitting candidate arbitrage opportunities. Its inputs should come from configured external APIs; its outputs should be strategy-neutral opportunity records consumed by execution.
• Scanner stage: src/scanner.py
• Scanner configuration source: src/config.py
Trade Execution and External Integrations
src/executor.py is the order-routing stage. It should translate validated scanner opportunities into exchange or on-chain trade actions, handle side/order sequencing, and report execution results or failures. This is the highest-risk boundary because it interacts with trading-enabled exchange API keys and potentially wallet/signing infrastructure. The README names Binance, OKX, Bybit, STON.fi, Raydium, and Jupiter, but no provider-specific integration files are visible.
• Execution stage: src/executor.py
• Shared configuration: src/config.py
Primary Control Flow
The intended control loop is:
1. Load runtime settings and credentials from src/config.py.
2. src/scanner.py polls or subscribes to market data and calculates spreads.
3. Scanner emits an executable candidate when profitability/risk criteria are met.
4. src/executor.py submits and monitors the required orders/transactions.
5. Results feed operational logging or subsequent scan decisions; no persistent storage, queue, dashboard, or telemetry component is visible in this repository.
Infrastructure and Operational Boundaries
The documented deployment target is a local machine or VPS running Python, with network access to exchange APIs and blockchain/DEX infrastructure. GitHub Actions CI exists at .github/workflows/ci.yml, but no Docker, cloud infrastructure, database, message broker, or monitoring stack is represented. The implementation should therefore treat external exchange/network APIs as unreliable boundaries and keep credential handling, rate limiting, idempotency, and execution safety concentrated around src/config.py and src/executor.py.
Main entry points: executor.py Trade executor · __init__.py Package boundary · config.py Runtime configuration · scanner.py Market scanner
Components 9
Python Runtime
Imported or externally invoked; no launcher is present.
- Package boundary
src/__init__.py - Runtime configuration · Isolates exchange endpoints, credentials, thresholds, and risk limits.
src/config.py - Market scanner · Normalizes market data and emits candidate arbitrage opportunities.
src/scanner.py - Trade executor · Submits and monitors trading actions for validated opportunities.
src/executor.py - Python dependencies
requirements.txt
External Boundaries
Unreliable market, exchange, and chain providers.
- Market and trading APIs · Provides quotes and accepts orders or transactions.
- Trading credentials · Sensitive authority used at the execution boundary.
Automation
- GitHub Actions CI
.github/workflows/ci.yml
Other components
- Ignore policy · Likely excludes local artifacts and secrets.
.gitignore
Connections 14
- Python dependencies → Package boundary: installs runtime libraries
- Package boundary → Runtime configuration: loads
- Package boundary → Market scanner: hosts
- Package boundary → Trade executor: hosts
- Runtime configuration → Market scanner: supplies scan settings
- Runtime configuration → Trade executor: supplies limits and endpoints
- Trading credentials → Runtime configuration: configured as sensitive values
- Market and trading APIs → Market scanner: market data
- Market scanner → Trade executor: executable opportunity
- Trade executor → Market and trading APIs: orders / transactions
- Trade executor → Trading credentials: uses trading authority
- Trade executor → Market scanner: execution outcomes
- Ignore policy → Runtime configuration: protects local values
- GitHub Actions CI → Package boundary: validates