// GLOSSARY
Expiry / expiration
The time a contract stops trading and awaits settlement. Distinct from resolution: a market can close (no more trading) before the outcome is known. Orders can also carry their own expirations, e.g. good-till-cancel vs time-limited.
Expiry has two meanings in prediction markets, and conflating them causes bugs.
Market expiry
Every market has a close time after which trading stops. It may sit closed for hours or days before it resolves — an election market closes when polls do, but settlement waits for the result. Between close and resolution your position is frozen: no exit, no hedge. Position sizing should account for that window.
Order expiry
Orders carry their own lifetimes. A good-till-cancel (GTC) order rests until filled or cancelled; venues also support time-bound variants, and Polymarket order messages include an explicit expiration field in the signed payload. An IOC order is the degenerate case — it expires immediately after its attempt to match.
Practical notes for bots
Always read close times from the venue API rather than assuming them (events get delayed, markets get extended — check venue docs for the exact fields), and treat "market closed" as a distinct order-rejection case from "market resolved". Order-type behavior across venues is compared in rate limits and order types.