{"openapi":"3.1.0","info":{"title":"majjha API","version":"1.0.0","description":"Public Predictions API for majjha — prediction markets for crypto, tech, esports and more. REST for requests; a companion WebSocket streams live order books and tickers (see the WebSocket guide).","contact":{"name":"majjha","url":"https://docs.majjha.com"}},"servers":[{"url":"https://api.majjha.com","description":"Live (real money)"},{"url":"https://api-play.majjha.com","description":"Play (play-money sandbox)"},{"url":"http://localhost:7890","description":"Local development"}],"tags":[{"name":"Exchange","description":"Health & status"},{"name":"Series","description":"Recurring market families"},{"name":"Events","description":"Groups of related markets"},{"name":"Markets","description":"Tradable YES/NO contracts"},{"name":"Orders","description":"Place, amend & cancel"},{"name":"Portfolio","description":"Positions, fills, balance"}],"paths":{"/api/exchange/status":{"get":{"operationId":"get-exchange-status","summary":"Get exchange status","description":"Returns the operational status of the exchange and a server timestamp. Public — no authentication required. Use it as a lightweight liveness probe before submitting orders.","tags":["Exchange"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"status":"operational","timestamp":1717459200}}}}}}},"/api/series":{"get":{"operationId":"list-series","summary":"List series","description":"Returns a cursor-paginated list of series, optionally filtered by category.","tags":["Series"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":"eyJpZCI6ICJzZXJfMDQyIn0","series":[{"id":"ser_btc5m","ticker":"BTC-5MIN","title":"Bitcoin 5-minute close","categoryId":"cat_crypto","category_name":"Crypto","category_slug":"crypto","frequency":"5m","tags":["bitcoin","crypto","high-frequency"],"description":"Will BTC close above the strike at the end of each 5-minute window?","event_count":288,"createdAt":"2026-06-01T00:00:00Z","updatedAt":"2026-06-04T09:00:00Z"}]}}}}},"parameters":[{"name":"category","in":"query","required":false,"description":"Filter by category slug (e.g. `crypto`).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page's `cursor` field.","schema":{"type":"string"}}]}},"/api/series/{series_ticker}":{"get":{"operationId":"get-series","summary":"Get series","description":"Returns a single series by its ticker, including its category and event count.","tags":["Series"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"series":{"id":"ser_btc5m","ticker":"BTC-5MIN","title":"Bitcoin 5-minute close","categoryId":"cat_crypto","category_name":"Crypto","category_slug":"crypto","frequency":"5m","tags":["bitcoin","crypto","high-frequency"],"description":"Will BTC close above the strike at the end of each 5-minute window?","event_count":288,"createdAt":"2026-06-01T00:00:00Z","updatedAt":"2026-06-04T09:00:00Z"}}}}}},"parameters":[{"name":"series_ticker","in":"path","required":true,"description":"The series ticker, e.g. `BTC-5MIN`.","schema":{"type":"string"}}]}},"/api/events":{"get":{"operationId":"list-events","summary":"List events","description":"Returns a cursor-paginated list of events. Filter by series or status, and optionally inline each event's markets.","tags":["Events"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":null,"events":[{"id":"evt_btc5m_1717459200","eventTicker":"BTC-5MIN-25JUN04T0900","seriesTicker":"BTC-5MIN","title":"BTC above $68,500 at 09:05?","mutuallyExclusive":true,"strikeDate":"2026-06-04T09:05:00Z","description":"Resolves YES if BTC/USD is at or above the strike at 09:05 UTC.","status":"ACTIVE","createdAt":"2026-06-04T09:00:00Z","updatedAt":"2026-06-04T09:00:00Z"}]}}}}},"parameters":[{"name":"series_ticker","in":"query","required":false,"description":"Only return events belonging to this series.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by event status.","schema":{"type":"string","enum":["ACTIVE","CLOSED","RESOLVED"]}},{"name":"with_nested_markets","in":"query","required":false,"description":"When true, include a `markets` array on each event.","schema":{"type":"boolean","default":"false"}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page.","schema":{"type":"string"}}]}},"/api/events/{event_ticker}":{"get":{"operationId":"get-event","summary":"Get event","description":"Returns a single event by ticker. Optionally inline its markets.","tags":["Events"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"event":{"id":"evt_btc5m_1717459200","eventTicker":"BTC-5MIN-25JUN04T0900","seriesTicker":"BTC-5MIN","title":"BTC above $68,500 at 09:05?","mutuallyExclusive":true,"strikeDate":"2026-06-04T09:05:00Z","description":"Resolves YES if BTC/USD is at or above the strike at 09:05 UTC.","status":"ACTIVE","createdAt":"2026-06-04T09:00:00Z","updatedAt":"2026-06-04T09:00:00Z"},"markets":[{"id":"mkt_btc5m_a1","ticker":"BTC-5MIN-25JUN04T0900-Y","eventTicker":"BTC-5MIN-25JUN04T0900","title":"BTC above $68,500 at 09:05?","status":"ACTIVE","lastYesPrice":"0.54","lastNoPrice":"0.46","volume":"12840.00","liquidity":"3200.00"}]}}}}},"parameters":[{"name":"event_ticker","in":"path","required":true,"description":"The event ticker.","schema":{"type":"string"}},{"name":"with_nested_markets","in":"query","required":false,"description":"When true, include a `markets` array alongside the event.","schema":{"type":"boolean","default":"false"}}]}},"/api/markets":{"get":{"operationId":"list-markets","summary":"List markets","description":"Returns markets with filtering and pagination. Two pagination modes are supported: pass `cursor` (or `event_ticker` / `series_ticker`) for cursor pagination, otherwise classic `page`-based pagination is used.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"markets":[{"id":"mkt_btc5m_a1","ticker":"BTC-5MIN-25JUN04T0900-Y","eventTicker":"BTC-5MIN-25JUN04T0900","title":"BTC above $68,500 at 09:05?","description":"Resolves YES if BTC/USD is at or above the strike at 09:05 UTC.","resolutionCriteria":"Coinbase BTC-USD spot at 09:05:00 UTC.","categoryId":"cat_crypto","status":"ACTIVE","outcome":null,"closeDate":"2026-06-04T09:05:00Z","lastYesPrice":"0.54","lastNoPrice":"0.46","volume":"12840.00","liquidity":"3200.00","marketType":"BINARY","createdAt":"2026-06-04T09:00:00Z","updatedAt":"2026-06-04T09:03:00Z"}],"total":142,"page":1,"totalPages":8}}}}},"parameters":[{"name":"category","in":"query","required":false,"description":"Filter by category slug.","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Full-text search over market titles.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by market status.","schema":{"type":"string","enum":["ACTIVE","CLOSED","RESOLVED","SUSPENDED","DRAFT"]}},{"name":"event_ticker","in":"query","required":false,"description":"Only markets in this event (switches to cursor mode).","schema":{"type":"string"}},{"name":"series_ticker","in":"query","required":false,"description":"Only markets in this series (switches to cursor mode).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor (cursor mode).","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"1-based page number (page mode).","schema":{"type":"integer","default":"1"}}]}},"/api/markets/{ticker}":{"get":{"operationId":"get-market","summary":"Get market","description":"Returns a single market by ticker (or internal id), including detail fields like category and trade counts.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"market":{"id":"mkt_btc5m_a1","ticker":"BTC-5MIN-25JUN04T0900-Y","eventTicker":"BTC-5MIN-25JUN04T0900","title":"BTC above $68,500 at 09:05?","description":"Resolves YES if BTC/USD is at or above the strike at 09:05 UTC.","resolutionCriteria":"Coinbase BTC-USD spot at 09:05:00 UTC.","categoryId":"cat_crypto","category_name":"Crypto","category_slug":"crypto","status":"ACTIVE","outcome":null,"closeDate":"2026-06-04T09:05:00Z","lastYesPrice":"0.54","lastNoPrice":"0.46","volume":"12840.00","liquidity":"3200.00","marketType":"BINARY","trade_count":318,"position_count":64,"createdAt":"2026-06-04T09:00:00Z","updatedAt":"2026-06-04T09:03:00Z"}}}}}},"parameters":[{"name":"ticker","in":"path","required":true,"description":"Market ticker or internal id.","schema":{"type":"string"}}]}},"/api/markets/{ticker}/orderbook":{"get":{"operationId":"get-orderbook","summary":"Get market order book","description":"Returns the current order book for a market: aggregated `bids` and `asks` levels plus convenience top-of-book fields. Prices and quantities are decimal strings.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"orderbook":{"bids":[{"price":"0.53","quantity":"120","order_count":3},{"price":"0.52","quantity":"340","order_count":7}],"asks":[{"price":"0.55","quantity":"90","order_count":2},{"price":"0.56","quantity":"210","order_count":5}],"best_bid":"0.53","best_ask":"0.55","spread":"0.02","mid_price":"0.54"}}}}}},"parameters":[{"name":"ticker","in":"path","required":true,"description":"Market ticker or internal id.","schema":{"type":"string"}}]}},"/api/markets/{ticker}/trades":{"get":{"operationId":"get-market-trades","summary":"Get market trades","description":"Returns recent public trades (prints) for a single market, newest first.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"trades":[{"id":"trd_9f2","marketId":"mkt_btc5m_a1","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"YES","price":"0.54","quantity":"25","createdAt":"2026-06-04T09:03:11Z"}]}}}}},"parameters":[{"name":"ticker","in":"path","required":true,"description":"Market ticker or internal id.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max number of trades to return.","schema":{"type":"integer","default":"50"}}]}},"/api/markets/trades":{"get":{"operationId":"list-trades","summary":"List trades (exchange-wide)","description":"Returns a cursor-paginated, exchange-wide trade tape. Optionally filter by `ticker`. Useful for building a live ticker or backfilling price history.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":"eyJ0cyI6IDE3MTc0NTkzODB9","trades":[{"trade_id":"trd_9f2","ticker":"BTC-5MIN-25JUN04T0900-Y","price":"0.54","count":"25","taker_side":"yes","created_at":"2026-06-04T09:03:11Z"}]}}}}},"parameters":[{"name":"ticker","in":"query","required":false,"description":"Restrict the tape to a single market ticker.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"100"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page.","schema":{"type":"string"}}]}},"/api/markets/{ticker}/price-history":{"get":{"operationId":"get-price-history","summary":"Get price history","description":"Returns a time series of YES-price ticks for charting a market.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"ticks":[{"yes_price":"0.51","created_at":"2026-06-04T09:00:30Z"},{"yes_price":"0.53","created_at":"2026-06-04T09:01:30Z"},{"yes_price":"0.54","created_at":"2026-06-04T09:03:00Z"}]}}}}},"parameters":[{"name":"ticker","in":"path","required":true,"description":"Market ticker or internal id.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max number of ticks, newest last.","schema":{"type":"integer","default":"500"}}]}},"/api/markets/{ticker}/analyze":{"get":{"operationId":"analyze-market","summary":"Analyze market (AI)","description":"Returns an AI-generated probability estimate and rationale for a market. Intended for research and UI surfacing — not financial advice.","tags":["Markets"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"probability":0.56,"confidence":"medium","reasoning":"Spot has trended slightly above the strike with rising short-term momentum...","keyFactors":["short-term momentum","thin order book above strike"],"marketSentiment":"leaning YES","recommendation":"Slight edge to YES at current price","currentPrice":0.54}}}}},"parameters":[{"name":"ticker","in":"path","required":true,"description":"Market ticker or internal id.","schema":{"type":"string"}}]}},"/api/portfolio/orders":{"post":{"operationId":"create-order","summary":"Create order","description":"Places a single order. Returns the resulting order with any immediate fills. Use `time_in_force` to control resting behaviour and `client_order_id` for idempotent client-side tracking.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"order_id":"ord_a1b2c3","client_order_id":"my-order-001","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","price":"0.54","count":"100","fill_count":"40","remaining_count":"60","average_fill_price":"0.54","status":"PARTIAL"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ticker":{"type":"string","description":"Market ticker to trade."},"side":{"type":"string","description":"Contract side.","enum":["yes","no"]},"action":{"type":"string","description":"Open or close exposure.","enum":["buy","sell"],"default":"buy"},"count":{"type":"number","description":"Number of contracts."},"price":{"type":"number","description":"Limit price in dollars (0.01–0.99)."},"time_in_force":{"type":"string","description":"Order lifetime.","enum":["GTC","FOK","IOC"],"default":"GTC"},"client_order_id":{"type":"string","description":"Client-supplied idempotency key."},"post_only":{"type":"boolean","description":"Reject if the order would immediately match (maker-only).","default":"false"},"reduce_only":{"type":"boolean","description":"Only reduce an existing position; never increase it.","default":"false"}},"required":["ticker","side","count","price"]},"example":{"ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","action":"buy","count":100,"price":0.54,"time_in_force":"GTC","client_order_id":"my-order-001"}}}},"security":[{"bearerAuth":[]}]},"get":{"operationId":"list-orders","summary":"List orders","description":"Returns your orders, cursor-paginated and optionally filtered by `ticker` and `status`.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":null,"orders":[{"order_id":"ord_a1b2c3","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","type":"LIMIT","time_in_force":"GTC","price":"0.54","count":"100","fill_count":"40","remaining_count":"60","status":"PARTIAL","client_order_id":"my-order-001","post_only":false,"reduce_only":false,"created_at":"2026-06-04T09:03:00Z","updated_at":"2026-06-04T09:03:05Z"}]}}}}},"parameters":[{"name":"ticker","in":"query","required":false,"description":"Filter by market ticker.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by order status.","schema":{"type":"string","enum":["OPEN","PARTIAL","FILLED","CANCELLED"]}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page.","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/api/portfolio/orders/{order_id}":{"get":{"operationId":"get-order","summary":"Get order","description":"Returns a single order you own by its id.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"order_id":"ord_a1b2c3","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","type":"LIMIT","time_in_force":"GTC","price":"0.54","count":"100","fill_count":"40","remaining_count":"60","status":"PARTIAL","client_order_id":"my-order-001","post_only":false,"reduce_only":false,"created_at":"2026-06-04T09:03:00Z","updated_at":"2026-06-04T09:03:05Z"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"description":"The order id.","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]},"delete":{"operationId":"cancel-order","summary":"Cancel order","description":"Cancels the remaining (unfilled) quantity of an order.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"status":"cancelled"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"description":"The order id to cancel.","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/api/portfolio/orders/{order_id}/amend":{"post":{"operationId":"amend-order","summary":"Amend order","description":"Atomically replaces an order's price and/or remaining count, preserving the order id. Re-queues at the new price (loses time priority if price changes).","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"order_id":"ord_a1b2c3","client_order_id":"my-order-001","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","price":"0.55","count":"80","fill_count":"40","remaining_count":"40","average_fill_price":"0.54","status":"PARTIAL"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"description":"The order id to amend.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"price":{"type":"number","description":"New limit price (0.01–0.99)."},"count":{"type":"number","description":"New total contract count."}}},"example":{"price":0.55,"count":80}}}},"security":[{"bearerAuth":[]}]}},"/api/portfolio/orders/{order_id}/decrease":{"post":{"operationId":"decrease-order","summary":"Decrease order","description":"Reduces an order's resting count without touching its price or time priority.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"status":"decreased"}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"description":"The order id to decrease.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","description":"Contracts to remove from the resting quantity."}},"required":["count"]},"example":{"count":20}}}},"security":[{"bearerAuth":[]}]}},"/api/portfolio/orders/batched":{"post":{"operationId":"batch-create-orders","summary":"Batch create orders","description":"Submits up to 20 orders in a single request. Each result is returned independently — a failure on one order does not roll back the others.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"results":[{"order":{"order_id":"ord_a1","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","price":"0.53","count":"50","fill_count":"0","remaining_count":"50","status":"OPEN"}},{"error":"insufficient balance"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","description":"Array of order objects (same fields as Create order). Max 20."}},"required":["orders"]},"example":{"orders":[{"ticker":"BTC-5MIN-25JUN04T0900-Y","side":"yes","action":"buy","count":50,"price":0.53},{"ticker":"BTC-5MIN-25JUN04T0900-Y","side":"no","action":"buy","count":50,"price":0.46}]}}}},"security":[{"bearerAuth":[]}]},"delete":{"operationId":"batch-cancel-orders","summary":"Batch cancel orders","description":"Cancels up to 20 orders by id in a single request.","tags":["Orders"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"results":[{"order_id":"ord_a1","status":"cancelled"},{"order_id":"ord_a2","status":"cancelled"},{"order_id":"ord_a3","error":"not found"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_ids":{"type":"array","description":"Array of order ids to cancel."}},"required":["order_ids"]},"example":{"order_ids":["ord_a1","ord_a2","ord_a3"]}}}},"security":[{"bearerAuth":[]}]}},"/api/portfolio/balance":{"get":{"operationId":"get-balance","summary":"Get balance","description":"Returns your cash balance: `available` to trade, `reserved` against resting orders, `total` cash, and total `portfolio_value` (cash + mark-to-market positions). Amounts are decimal strings.","tags":["Portfolio"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"available":"842.50","reserved":"157.50","total":"1000.00","portfolio_value":"1063.20"}}}}},"security":[{"bearerAuth":[]}]}},"/api/portfolio/positions":{"get":{"operationId":"list-positions","summary":"List positions","description":"Returns your open positions, cursor-paginated, with mark-to-market value and P&L.","tags":["Portfolio"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":null,"positions":[{"position_id":"pos_77","market_id":"mkt_btc5m_a1","market_title":"BTC above $68,500 at 09:05?","market_status":"ACTIVE","side":"YES","quantity":"100","avg_entry_price":"0.54","current_price":"0.58","value":"58.00","unrealized_pnl":"4.00","realized_pnl":"0.00"}]}}}}},"parameters":[{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page.","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/api/portfolio/fills":{"get":{"operationId":"list-fills","summary":"List fills","description":"Returns your individual trade fills (executions), cursor-paginated and optionally filtered by ticker.","tags":["Portfolio"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":null,"fills":[{"fill_id":"fil_31","trade_id":"trd_9f2","order_id":"ord_a1b2c3","ticker":"BTC-5MIN-25JUN04T0900-Y","side":"bid","count":"40","price":"0.54","is_taker":true,"created_at":"2026-06-04T09:03:05Z"}]}}}}},"parameters":[{"name":"ticker","in":"query","required":false,"description":"Filter by market ticker.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page.","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/api/portfolio/settlements":{"get":{"operationId":"list-settlements","summary":"List settlements","description":"Returns markets that have resolved against your positions, with realized P&L.","tags":["Portfolio"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"cursor":null,"settlements":[{"settlement_id":"stl_12","market_id":"mkt_btc5m_z9","market_title":"BTC above $68,400 at 08:55?","market_status":"RESOLVED","side":"YES","avg_entry_price":"0.48","realized_pnl":"26.00","settled_at":"2026-06-04T08:55:00Z"}]}}}}},"parameters":[{"name":"ticker","in":"query","required":false,"description":"Filter by market ticker.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size. Max 100.","schema":{"type":"integer","default":"20"}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from the previous page.","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}]}},"/api/portfolio/deposits":{"post":{"operationId":"create-deposit","summary":"Create deposit","description":"Credits play-money funds to your balance (Phase 1 off-chain). Returns the updated balance.","tags":["Portfolio"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"available":"1342.50","reserved":"157.50","total":"1500.00"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Amount to deposit."}},"required":["amount"]},"example":{"amount":500}}}},"security":[{"bearerAuth":[]}]}},"/api/portfolio/withdrawals":{"post":{"operationId":"create-withdrawal","summary":"Create withdrawal","description":"Debits funds from your available balance. Returns the updated balance.","tags":["Portfolio"],"responses":{"200":{"description":"Successful response","content":{"application/json":{"example":{"available":"1142.50","reserved":"157.50","total":"1300.00"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"Amount to withdraw (must be ≤ available)."}},"required":["amount"]},"example":{"amount":200}}}},"security":[{"bearerAuth":[]}]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (pmx_…) or JWT in an Authorization: Bearer header."}}}}