Polymarket bot
Machine learning and data flow for prediction-market trading
142 / Polymarket mechanics, order-book microstructure, and a practical workflow for building trading bots with reproducible blockchain data. Covers DuckDB plus Parquet pipelines, feature engineering, backtesting discipline, trigger-based trade ops, latency tradeoffs, and Kelly sizing ideas for prediction-market strategies.
Timeline
Episode notes
Edit these notes…Prediction-market trading is used here as a concrete way to learn modern data and ML workflow discipline, not as a promise of easy money.
Core walkthrough
- The talk starts with Polymarket mechanics: yes/no outcome tokens, wallet signing, bundling, and final settlement on Polygon.
- A major theme is data provenance. The recommended source of truth is chain data instead of platform-provided historical exports.
- Market microstructure is explained with maker/taker behavior and CLOB matching, including why trade direction and sequence matter for feature design.
Data architecture and tooling
- The suggested stack is DuckDB with Parquet files for full-table analytical transforms.
- The speaker contrasts row-oriented OLTP thinking with columnar OLAP workflows for large historical backtests.
- A repeated implementation pattern is immutable partitions plus manifests and hashes for reproducibility and forensics.
Strategy and backtesting themes
- Multiple thesis families are discussed: range and ping-pong market making, account-following, anomaly detection, buy-and-hold timing, and cross-market arbitrage.
- External signals can be useful, but only when they are timestamped to avoid look-ahead leakage.
- Feature ideas include account behavior profiles, trade timing distributions, exposure measures, and volatility bands.
Trade operations and execution
- Production logic is framed as trigger-driven state transitions with detailed logging of conditions and execution context.
- The conversation highlights slippage and latency constraints, especially for short-horizon markets where seconds can matter.
- Position sizing is discussed through the Kelly criterion as a guardrail against overbetting.
Engineering process with LLMs
- The workflow recommends drafting hypotheses in plain language first, then defining API contracts before code generation.
- Testing is split into both code-level unit tests and data-shape tests.
- Frequent commits and reproducible runs are treated as mandatory for debugging model drift and execution failures.
Open items for human follow-up
- Confirm
youtube-fullURL. - Confirm
discussionURL. - Confirm whether additional participants should be credited.