Cryptobot: an automated trading system
A long-running service that scores assets with an LLM, invests within strict risk limits, watches live order books and sells when conditions are met. It is built as a production system, with modes for safe testing before any real money is involved.
At a glance
Score, invest, monitor, exit
Asset scoring
On a schedule, the bot takes the tradable pairs from the exchange and queries a search-augmented LLM about each asset concurrently with asyncio. It requires a minimum number of cited sources and extracts a numeric score from each answer.
Investment with risk limits
Capital is allocated to the best-scored assets under configurable constraints: a maximum share of total equity exposed at once and a fixed budget per trade.
Broker layer
A wrapper around the exchange API that handles the unglamorous details correctly: lot sizes, step rounding, minimum notional checks and market-order filters.
Real-time monitoring
Open positions are tracked through multiplexed WebSocket order-book streams. The expected sell price is computed from actual bid depth rather than the last trade price. Positions are locked before selling to prevent duplicate orders.
State & observability
Positions, signals and equity snapshots live in SQLite, which Grafana reads to show portfolio value and activity over time.
Built to run unattended
Safe by default
Paper mode simulates orders, testnet uses real endpoints with fake funds, and live mode has to be enabled explicitly.
Config-driven
Exchange, market, cadence, risk limits and LLM prompts all live in a single YAML file.
Resilient connections
WebSocket connections are rebuilt and state is reconciled with the exchange when positions change.
Containerised
Docker Compose runs the bot and its Grafana monitoring together.
Tools & techniques
- Core
- Data
- AI
- Ops