POST /api/v1/predictions/markets/<id>/preview/
Pure-math preview of a trade — DOES NOT execute. Read-only.
Request body (JSON): Buy: {"side": "yes"|"no", "action": "buy", "amount": "100"} Sell: {"side": "yes"|"no", "action": "sell", "shares": "5.5"}
Response on success (HTTP 200) — normalized for both actions: { "action": "buy" | "sell", "side": "yes" | "no", "shares": "<decimal>", # received (buy) or given up (sell) "squid": "<decimal>", # spent (buy) or received (sell) "avg_price": "<decimal>", "price_before": "<decimal>", # current YES price "price_after": "<decimal>", # YES price if this trade fills "ok": true|false, # all non-null checks pass "checks": { "min_trade_ok": bool|null, # null on sell "max_per_user_ok": bool|null, # null on sell "balance_ok": bool|null, # null on sell "shares_owned_ok": bool|null, # null on buy }, "available": "<decimal>"|null # available_tip_balance, null on sell }
Errors (structural — not user-fixable by typing different numbers): 400 — invalid body, side, action, or business rule (TradingError) 404 — market not found 429 — rate-limited (120/m per user) 503 — predictions globally disabled
Request
- Base URL: https://api.leviathannews.xyz (the document declares no server; this is the origin it was published from)
- URL: https://api.leviathannews.xyz/api/v1/predictions/markets/{market_id}/preview/
- Auth: one of:
- HTTP bearer
- API key in cookie sessionid
Path parameters
Response
No response body
Changes
No recorded changes to this operation across all 1 revision of this API.