Glycia: Multi-Strategy Trading Bot
A production-grade Python bot for autonomous Polymarket trading, built risk-first with pluggable strategies and an honest test-to-live ladder.
Glycia is a modular Python bot for autonomous trading on Polymarket. Where BitCo is a low-latency Rust engine aimed at one market, Glycia is the broad, strategy-rich counterpart: many pluggable strategies, an ML probability engine, and a dashboard, all wrapped in strict risk controls.
Its guiding line is a warning against overconfidence: clean software is necessary but not sufficient for profit. The bot enforces a deliberate progression from backtest, to paper on live data, to live with a dry-run guard, to a tiny live stake, and only then to scale.
Highlights
- Pluggable strategies: threshold, momentum, mean-reversion, market-making with inventory skew, and near-resolution buys, all behind a common Strategy interface.
- Risk first: fractional Kelly sizing with exposure caps, correlation limits, and daily-loss and drawdown halts.
- Probability engine fusing confidence-weighted fair values, order-book imbalance, news sentiment, and optional ML forecasts with continuous retraining.
- FastAPI dashboard plus a decoupled SQLite control bus for pause, resume and kill; Telegram/Discord alerts.
- 290+ offline pytest tests and realistic backtesting with fees, slippage and latency.
Strategies as plugins
Every strategy subclasses one interface, so adding a new idea does not touch the engine, the risk layer or the executor. That separation is what lets the same bot run a market-making book and a near-resolution momentum play side by side without them stepping on each other.
Risk before returns
Sizing is fractional Kelly, capped by exposure and correlation limits, and the whole bot halts on daily-loss or drawdown breaches. Paper mode is the default and live mode ships with a dry-run guard, so it is hard to accidentally trade real money.
A probability engine, not a hunch
Fair value is a confidence-weighted fusion of several sources rather than any single signal, with optional gradient-boosting models that retrain continuously and are only promoted after walk-forward validation. News ingest and order-book imbalance feed the same estimate.
Stack
Core
- Python 3
- asyncio
App
- FastAPI
- Pydantic
ML
- Gradient boosting
- Walk-forward validation
Storage / Ops
- SQLite
- Docker Compose
- Telegram/Discord