Market hierarchy
majjha organises everything into a three-level tree. Understanding it makes the rest of the API obvious.
Series → Events → Markets
Hierarchy
Series BTC-5MIN recurring family ("BTC 5-minute close")
└─ Event …T0900 one resolvable question at a strike time
└─ Market …T0900-Y one tradable YES/NO contract- Series — a recurring template that spawns many events over time, identified by a
series_ticker. - Event — a single question resolving at a
strikeDate, identified by anevent_ticker. WhenmutuallyExclusiveis true, exactly one of its markets resolves YES. - Market — a tradable YES/NO contract with its own order book, identified by a
ticker. This is what you place orders against.
Pricing & settlement
Contracts trade in dollars from 0.01 to 0.99. The price equals the market's implied probability — a YES contract at 0.54 implies a 54% chance. On resolution the winning side settles at 1.00 and the losing side at 0.00.
Buying YES and buying NO are two sides of the same book: a YES buyer at 0.54 matches a NO buyer at 0.46 (the two sum to 1.00).
Market lifecycle
A market moves through a fixed set of statuses:
MarketStatus
DRAFT → ACTIVE → SUSPENDED → CLOSED → RESOLVEDACTIVE— open for trading.SUSPENDED— temporarily halted; no new matches.CLOSED— past its close date, awaiting resolution.RESOLVED— outcome decided; positions settled and paid out.
Money & precision
All monetary values — prices, balances, P&L — are serialized as decimal strings (e.g. "0.54", "1000.00") to avoid floating-point rounding. Parse them with a decimal-safe library, not a native float, before doing arithmetic.