// GLOSSARY
Fill
An execution: some or all of your order matching against the other side of the book. One order can produce many fills at different prices. Fills — not orders — are what you reconcile positions, fees, and P&L against.
An order is an intention; a fill is a fact. When your order matches a resting order (or an incoming one matches yours), the venue records a fill: price, size, side, fee, timestamp, and IDs linking it back to the order.
One order, many fills
A 1,000-contract buy that walks the book might fill 400 at 43¢, 350 at 44¢, and 250 at 45¢ — three fills, one order, an average price of ~43.85¢. Any serious bot stores fills individually: fees are calculated per fill, and the average hides the slippage structure you'll want to analyze later.
Reconciliation
Robust systems treat the venue's fill stream as ground truth and rebuild positions from it, rather than trusting their own record of what they sent. Both Kalshi and Polymarket expose fills via REST and push them over WebSocket feeds; wiring that into a position tracker is walked through in the Python prediction-market bot guide.