How to Build a Polymarket Trading Bot with Slippage and Position Sizing in Python
A developer tutorial on DEV Community outlines how to build a Python-based trading bot for Polymarket, a prediction market platform. The guide covers connecting to Polymarket's CLOB and Gamma APIs to discover active markets and read live order books. It explains how to calculate trading edge by comparing a model's probability estimate against the current market price, and applies fractional Kelly criterion with a hard per-market exposure cap for position sizing. The tutorial also addresses slippage by checking available order book depth before placing trades, recommending resting limit orders over market orders in thin books. The author notes that smarter API polling — scaled to market activity rather than fixed intervals — would improve efficiency in a production setup.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in