Autonomous Delta-Neutral Arbitrageur is an AI-assisted crypto arbitrage agent. It monitors cross-exchange spreads, asks an auditor model for a GO/WAIT decision, optionally executes a sandbox trade, and logs every decision to SQLite for live dashboard monitoring.
- Language: Python 3.12+
- Project Manager:
uv - Domain: Quantitative Finance / Crypto Arbitrage
- Real-time spread monitoring: Pulls prices for configured symbols from Binance US, Coinbase, and Kraken using CCXT.
- Agent workflow with gated execution: Uses a LangGraph flow with monitor -> auditor -> executor steps.
- AI audit before trade: Auditor LLM evaluates whether a spread is still profitable after fees and returns GO or NO-GO.
- Sandbox execution path: Places demo market orders on Kraken sandbox when audit passes.
- Persistent event logging: Stores monitor, audit, and execution events in SQLite for traceability.
- Live command-center dashboard: Streamlit UI shows P/L, win rate, logs, and spread trends.
- Automated quality checks: Pytest + Ruff + CI security checks (Bandit and pip-audit).
- Core runtime: src/main.py
- Database and logging helpers: src/db.py
- Dashboard app: src/dashboard.py
- Test suite: tests
The runtime loop executes these stages:
- Monitor: Fetches exchange tickers and calculates max spread percentage.
- Audit: Sends latest prices to the auditor model for GO/WAIT.
- Execute: If GO, places sandbox order and logs estimated profit.
- Observe: Dashboard reads logged events and visualizes recent behavior.
The live dashboard displays:
- Total Profit (USDT): Cumulative profits from executed trades
- Active Spreads Found: Number of profitable opportunities detected
- Win Rate: Percentage of executed trades vs total attempted trades
- Agent Reasoning Logs: Real-time logs from Monitor, Auditor, and Executor components
- Live Spread Monitoring: Time-series chart showing spread percentages over time
- Python 3.12+
uvpackage manager
-
Clone the repository:
git clone https://github.com/your-username/Autonomous_Delta-Neutral_Arbitrageur.git cd Autonomous_Delta-Neutral_Arbitrageur -
Create and activate the virtual environment:
uv venv source .venv/bin/activate -
Install dependencies:
uv sync
-
Create a
.envfile from the example:cp .env.example .env
-
Add your exchange API keys and any other required environment variables to the
.envfile.
-
Run the trading agent:
uv run adna
or
uv run python src/main.py
-
Run the dashboard:
uv run streamlit run src/dashboard.py
-
Build image:
docker build -t adna:local . -
Run agent only (compose profile):
docker compose --profile agent up --build
-
Run dashboard only (compose profile):
docker compose --profile dashboard up --build
-
Run full stack (agent + dashboard):
docker compose --profile full up --build
- Validate formatting and lint checks pass.
- Run tests with coverage threshold.
- Run dependency and security audits.
- Verify entrypoint smoke test for
adna.
-
Stop compose services:
docker compose down
-
Follow agent logs:
docker compose logs -f agent
-
Follow dashboard logs:
docker compose logs -f dashboard
-
Confirm
.envhas required API credentials. -
Check recent agent logs for
trade_execution_failedanddashboard_data_load_failedevents. -
Use
run_idandcycle_idfrom logs to correlate monitor, auditor, and executor actions within the same cycle. -
Check
metrics_summarylog lines for aggregate wait, executed, failed, and aborted counts plus average cycle/audit/execution latency. -
Re-run security and dependency checks locally:
uv run --with pip-audit pip-audit --ignore-vuln CVE-2026-4539 uv run --with bandit bandit -q -r src
This project follows Test-Driven Development (TDD).
-
Run all tests:
uv run pytest
-
Run a specific test file:
uv run pytest tests/test_prices.py
-
Run tests with verbose output:
uv run pytest -v
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE.md file for details.
