๐ŸŒฑ Growing

Hyperkaehler

A quantitative trading bot for Manifold Markets implementing arbitrage, time decay, and mispricing strategies with Kelly-based position sizing and comprehensive risk management.

Go ยท SQLite Planted December 2024 Tended February 2026

The Hook

I was spending hours manually tracking prediction markets looking for arbitrage opportunities. I wanted a bot that could scan thousands of markets and execute trades faster than I could blink.

The Context

Manifold Markets has fascinating inefficiencies โ€” multiple-choice markets where the probabilities don’t add to 100%, time-decay opportunities in “will X happen by DATE?” markets, and mean reversion plays after poorly-calibrated users make large trades. The opportunities exist, but they’re fleeting. By the time I’d manually calculate position sizes and place orders, someone else had already taken the edge.

The Journey

The first version just did simple arbitrage scanning. Then I added time decay detection. Then mean reversion signals. The hardest part was the risk management โ€” Kelly criterion is mathematically beautiful but if you implement it naively you’ll blow up your bankroll on a bad run. I ended up using fractional Kelly (1/4 by default) with multiple safety rails: per-position limits, per-market exposure caps, drawdown circuit breakers, and a minimum edge threshold. The bot now runs continuously with auto-restart and stores every bet in SQLite for post-trade analysis.

The Current State

Hyperkaehler is a multi-strategy trading bot for Manifold Markets that implements arbitrage, time decay, and mispricing strategies. It works about 80% of the time, and I fix the other 20% when I notice something broke. Built in Go using Mango as the Manifold Markets API client, with SQLite for persistence and comprehensive backtesting data.

Trading Strategies

Arbitrage

Exploits probability mispricing in multiple-choice markets where answer probabilities don’t sum to 1. Places limit orders against overpriced answers (or for underpriced ones), filtering out resolved answers and markets closing more than 90 days out.

Time Decay

Targets “Will X happen by DATE?” markets where the event hasn’t occurred and time is running out. As the deadline approaches with no news, probability should decay toward NO.

Mispricing Detection

Market Making

Places limit orders on both sides of active binary markets to capture the spread. Low priority at small bankroll sizes.

Risk Management

Technical Architecture

Uses SQLite with WAL mode for persistence, storing:

The bot runs continuously with auto-restart and daily log rotation, scanning markets on a configurable interval.