
Overview | Quick Start | Docs | Contributing | License
AI-Market-Maker is an open-source, hedge-fund-style trading stack for crypto. It combines specialist AI trading agents (acting as trading desks), a LangGraph orchestration layer, a hard Risk Guard veto before any execution, and quant-grade discipline including centralized policy, benchmarks against buy-and-hold, and full traceability.
Designed to feel like a small professional trading firm — not just another bot.
SKILL.md + manifest.json + dedicated runners)Current (Trading Mode)
Fetch real-time data, generate signals through specialist agents, run portfolio logic, apply Risk Guard veto, and execute on Binance Testnet.
Near-term
Full position lifecycle, multi-asset portfolio management, configurable leverage, and improved long/short handling.
Longer-term
Deeper agentic capabilities, better OpenClaw integration, and support for additional execution venues and data sources.
Input → Process → Output → Feedback contract.The workflow mimics a small hedge fund:
See docs/langgraph-workflow.md for the complete graph state, nodes, edges and routing logic.
# 1. Clone the repo
git clone https://github.com/olaxbt/ai-market-maker.git
cd ai-market-maker
# 2. Install dependencies
pip install uv
# 3. Install TA-Lib first (see installation options in Prerequisites section)
# Example using Conda (recommended for OpenClaw environments):
# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
# bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
# source $HOME/miniconda/bin/activate
# conda install -y ta-lib -c conda-forge
# 4. Install Python dependencies
uv sync --extra dev
uv run pre-commit install
# 3. Set up environment
cp .env.example .env
# Edit .env with your API keys (Binance Testnet + OpenAI recommended)
#
# Required for the Docker stack:
# DATABASE_URL=postgresql+psycopg://aimm:aimm@db:5432/aimm
# AIMM_AUTH_SECRET=<long-random-secret>
# 4. Run the platform stack (recommended): DB + API + worker + web
# Requires Docker Desktop / docker compose.
#
docker compose -f docker-compose.prod.yml up --build -d
# 5. Run migrations (first time, and after schema changes)
docker compose -f docker-compose.prod.yml run --rm api alembic upgrade head
# 6. Open the dashboard
# http://localhost:3000/leaderboard (results + signals)
# http://localhost:3000/console (nexus console)
# http://localhost:3000/get-started (copy/paste setup guide)
# http://localhost:3000/tools (tool browser)
Open http://localhost:3000 to view the dashboard.
Note: first boot may show an empty Leaderboard/Signals until you run a backtest (Nexus → Research) or publish provider results/signals.
For CLI-only trading mode:
uv run python src/main.py
If you want a public site where people can: - view Leaderboard results + Signals - publish results from their own local runs (provider keys)
Run the leaderboard stack (DB + API, optional Web UI):
# API + DB (leaderboard endpoints)
docker compose -f docker-compose.leaderboard.yml up -d --build
# Optional: include the web-v2 portal UI (service `portal`; avoids clobbering Next `web` if you merge this file with prod compose)
docker compose -f docker-compose.leaderboard.yml --profile web up -d --build
This keeps the public deployment lightweight and focused on evaluation, while users run the full agentic system locally.
/leaderboard to see how results/signals are presented./get-started for local setup commands./tools to browse callable platform endpoints.POST /backtests/quick) and confirm:.runs/backtests/<run_id>//leadpage/external_result)GET /runs/latest/payload?soft=1 and inspect topology/traces/message log.Option 1: Conda (Recommended)
# Install Miniconda if not already installed
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
source $HOME/miniconda/bin/activate
conda install -y ta-lib -c conda-forge
Option 2: System Package Manager
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y ta-lib
# macOS (Homebrew)
brew install ta-lib
# Then install Python wrapper
pip install ta-lib
Option 3: Source Compilation
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
./configure --prefix=/usr/local
make
sudo make install
pip install ta-lib
Note for OpenClaw Users: If running in OpenClaw environment without sudo privileges, use Option 1 (Conda) as shown in the CI workflow.
config/policy.default.json and config/app.default.json (single source of truth).envDetailed docs:
- docs/configuration.md
- docs/policy-schema.md
- docs/run-modes.md
# Default unit tests (no network)
uv run pytest -q
# Full agentic E2E tests
uv run pytest -q tests/test_agentic_trading_e2e.py tests/test_tier0_consensus.py
All agents follow a standardized interface defined in src/agents/base_agent.py.
Every backtest automatically includes: - Performance metrics (Sharpe, Sortino, Profit Factor, etc.) - Benchmark vs. buy-and-hold (spot move + equity curve) - Excess return calculation - Full trade ledger and forced risk exits - Multi-asset portfolio analysis
Important: A single profitable backtest is not proof of edge. Always validate across multiple regimes and out-of-sample periods.
Run these from the repository root (the directory that contains pyproject.toml), after uv sync --extra dev (or uv sync).
# Using the OpenClaw runner (same cwd requirement)
uv run python openclaw/scripts/claw_runner.py --backtest
# With custom parameters
uv run python openclaw/scripts/claw_runner.py --backtest --symbols "BTC/USDT,ETH/USDT,SOL/USDT" --steps 100
# Direct multi-symbol demo (public OHLCV via CCXT; no API keys required)
# Quote --symbols in zsh/fish. NEXUS_DISABLE + LLM off avoid slow/failing network and LLM calls.
NEXUS_DISABLE=1 AI_MARKET_MAKER_USE_LLM=0 \
uv run python -m backtest.run_demo \
--symbols 'BTC/USDT,ETH/USDT,SOL/USDT' \
--steps 100 \
--online \
--exchange binance
If you see ModuleNotFoundError: No module named 'backtest', you are not in the repo root or dependencies are not installed (uv sync).
If your .env sets AIMM_STRATEGY_PRESET, it overrides config/app.default.json strategy defaults; unset it to use shipped app.default.json presets.
The default configuration (using multiple symbols and conservative risk parameters) typically produces results like:
Trade count: 17
Total return: 14.95%
Excess return vs BTC buy & hold: +30.25%
Sharpe ratio: 1.79
Maximum drawdown: 11.84%
Win rate: 62.5%
These results reflect: - Multi-asset diversification (BTC, ETH, SOL) - Conservative position sizing and risk limits - Automated benchmark comparison - Full trade transparency and risk event logging
The stack includes a Futu OpenD adapter for fetching real-time HK and US stock data and placing simulated (paper) orders.
bash
chmod +x OpenD
./OpenD
OpenD exposes port 11111 (quote) and 11112 (trade) by default.# .env (all have sensible defaults if unset)
FUTU_OPEND_HOST=127.0.0.1 # OpenD host
FUTU_OPEND_QUOTE_PORT=11111 # Quote API port
FUTU_OPEND_TRADE_PORT=11112 # Trade API port
FUTU_DRY_RUN=0 # 1 = parse only, never send real orders (safe default)
# FUTU_UNLOCK_PWD= # Required for order placement
python -c "
from futu import OpenQuoteContext
ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = ctx.get_stock_quote('HK.00700')
print('OK' if ret == 0 else 'FAIL', data)
ctx.close()
"
Open the Futu dashboard at /futu (Nexus nav → Futu tab) after starting the web UI.
- Select HK/US tickers from the configured universe.
- View OHLCV candlestick charts (interval: 1h / 1d / 1w).
- Place simulated buy/sell orders (paper trades).
- Falls back to synthetic mock data when OpenD is not available.
A Next.js dashboard is included for viewing: - Live agent traces and reasoning - Backtest results - Topology visualization - Prompt editing (where applicable) - Futu stock data and charts
Run with:
cd web && npm install && npm run dev
ai-market-maker/
├── src/ # Core Python logic
│ ├── agents/ # Individual trading desks
│ ├── tools/ # Exchange, TA, sentiment tools
│ ├── backtest/ # Backtesting engine
│ └── api/ # FastAPI endpoints
├── web/ # Next.js dashboard
├── openclaw/ # OpenClaw skill definitions
├── config/ # Default policy and app config
├── docs/ # Detailed documentation
├── tests/ # Test suite
└── .env.example
This project includes complete OpenClaw support with dedicated tooling for agentic trading workflows.
``` openclaw/ ├── SKILL.md # Skill documentation ├── manifest.json # OpenClaw manifest ├── scripts/ # Dedicated runners │ ├── claw_runner.py
$ claude mcp add ai-market-maker \
-- python -m otcore.mcp_server <graph>