$ show olaxbt/ai-market-maker
This repository implements an agentic crypto trading platform called AI Market Maker (AIMM). Despite the name, the code is not a low-latency market-making engine; it is a multi-agent hedge-fund-style trading stack that combines LLM-driven research agents with deterministic quant logic for backtesting, paper trading, and live trading. The core execution path is a LangGraph workflow: nine Tier-0 specialist agents (monetary, news, TA, on-chain, order flow, etc.) produce structured signals, a weighted arbitrator fuses them into trade intents, a Risk Guard vetoes dangerous proposals, and portfolio management routes execution through an OMS with an in-memory or SQLite ledger. The platform includes a FastAPI backend with REST and streaming endpoints, a Next.js/React dashboard, Docker deployment, Alembic migrations, CI, and a large test suite.
The LLM identified 6 files worth highlighting for reuse:
File-backed cache for LLM decisions keyed by SHA-256 hashes of prompt context and date tags. It makes agentic backtests deterministic and cost-efficient by avoiding repeated LLM calls for identical inputs, and can be extracted into any LLM pipeline that needs reproducible inference.
Computes Sharpe, Sortino, max drawdown, profit factor, win rate, and related performance metrics with noise-floor caps to avoid over-interpreting tiny samples. The logic is self-contained and reusable in any strategy evaluation or research platform.
OmsLedger protocol with InMemoryLedger and SqliteLedger implementations for recording order lifecycle events and keeping an audit trail. This is a clean persistence abstraction that can be lifted into order management systems independent of the trading agents and backtester.
Generic OHLCV fetching and CSV caching layer with rolling and anchored range caching, timestamp alignment, and validation. It can front any OHLCV source and make multi-symbol historical workflows significantly faster by avoiding repeated downloads.
Deterministic factor-weight matrix computation that normalizes heterogeneous agent outputs into [0,1] bullish-direction scores and a global composite confidence. Stateless and domain-independent enough to be reused in any system that fuses multiple weak signals into one decision.
Reusable authenticated HTTP client for third-party market data APIs, supporting JWT/API-key auth, rate limiting, and structured error surfacing. The pattern generalizes to any external data API integration.