{"openapi":"3.1.0","info":{"title":"River Finance API","contact":{"name":"River Finance","url":"https://www.rivermarkets.com/"},"license":{"name":"Proprietary"},"version":"1.0.0"},"paths":{"/v1/complex-orders":{"get":{"tags":["complex-orders"],"summary":"List Complex Orders","description":"List complex orders (conditional and iceberg) with optional filters.\n\nReturns a dict keyed by complex order type (`conditional_orders`,\n`iceberg_orders`). Use `complex_order_type` to restrict to one type.","operationId":"list_complex_orders_v1_complex_orders_get","parameters":[{"name":"complex_order_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by complex order type: CONDITIONAL, TWAP, ICEBERG, PEG.","title":"Complex Order Type"},"description":"Filter by complex order type: CONDITIONAL, TWAP, ICEBERG, PEG."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by status name. Interpreted per complex_order_type (ConditionalOrderStatus for CONDITIONAL, IcebergOrderStatus for ICEBERG, PegOrderStatus for PEG). Unknown names for the active type are ignored.","title":"Status"},"description":"Filter by status name. Interpreted per complex_order_type (ConditionalOrderStatus for CONDITIONAL, IcebergOrderStatus for ICEBERG, PegOrderStatus for PEG). Unknown names for the active type are ignored."},{"name":"river_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by instrument ID","title":"River Id"},"description":"Filter by instrument ID"},{"name":"generic_asset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by generic asset basket ID","title":"Generic Asset Id"},"description":"Filter by generic asset basket ID"},{"name":"subaccount_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to a specific subaccount","title":"Subaccount Id"},"description":"Filter to a specific subaccount"},{"name":"complex_order_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Filter by complex order IDs","title":"Complex Order Ids"},"description":"Filter by complex order IDs"},{"name":"parent_river_order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by parent order ID","title":"Parent River Order Id"},"description":"Filter by parent order ID"},{"name":"unparented_only","in":"query","required":false,"schema":{"type":"boolean","description":"When true, only return conditional orders with no parent_river_order_id (standalone stops). Ignored for non-conditional types.","default":false,"title":"Unparented Only"},"description":"When true, only return conditional orders with no parent_river_order_id (standalone stops). Ignored for non-conditional types."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Results per page (max 1000)","default":100,"title":"Limit"},"description":"Results per page (max 1000)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplexOrderListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["complex-orders"],"summary":"Create Complex Order","description":"Create a new complex order (conditional or iceberg).\n\nProvide exactly one of `conditional_order_params` (TP/SL/STOP) or\n`iceberg_order_params`. The body shape determines the complex_order_type.\n\nReturns 202 Accepted with the persisted complex order in PENDING status,\nenqueued for activation by the appropriate consumer service.","operationId":"create_complex_order_v1_complex_orders_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplexOrderCreateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplexOrderCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/complex-orders/cancel-all":{"post":{"tags":["complex-orders"],"summary":"Cancel All Complex Orders","description":"Cancel all cancellable complex orders (conditional and iceberg) for a subaccount.\n\nReturns the list of complex_order_ids that were submitted for cancellation.","operationId":"cancel_all_complex_orders_v1_complex_orders_cancel_all_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelAllComplexOrdersRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelComplexOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/complex-orders/{complex_order_id}":{"get":{"tags":["complex-orders"],"summary":"Get Complex Order","description":"Get a single complex order by ID (conditional or iceberg).","operationId":"get_complex_order_v1_complex_orders__complex_order_id__get","parameters":[{"name":"complex_order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Complex Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplexOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["complex-orders"],"summary":"Cancel Complex Order","description":"Cancel a single complex order (conditional or iceberg).\n\nReturns 202 Accepted. Cancellation is processed asynchronously by the\nappropriate consumer service.","operationId":"cancel_complex_order_v1_complex_orders__complex_order_id__delete","parameters":[{"name":"complex_order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Complex Order Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelComplexOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fair-values":{"get":{"tags":["fair-values"],"summary":"List Fair Values","description":"List the caller's fair values, optionally scoped to one subaccount and/or instruments.","operationId":"list_fair_values_v1_fair_values_get","parameters":[{"name":"subaccount_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Restrict to a single subaccount","title":"Subaccount Id"},"description":"Restrict to a single subaccount"},{"name":"river_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Restrict to a set of instruments (repeated param)","title":"River Ids"},"description":"Restrict to a set of instruments (repeated param)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FairValueListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["fair-values"],"summary":"Set Fair Values","description":"Set fair values for instruments on a subaccount (insert-or-overwrite, atomic).","operationId":"set_fair_values_v1_fair_values_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FairValuesUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FairValueListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fair-values/{subaccount_id}/{river_id}":{"delete":{"tags":["fair-values"],"summary":"Delete Fair Value","description":"Clear the fair value for an instrument on a subaccount.","operationId":"delete_fair_value_v1_fair_values__subaccount_id___river_id__delete","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subaccount Id"}},{"name":"river_id","in":"path","required":true,"schema":{"type":"integer","title":"River Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fees/schedules/lookup":{"post":{"tags":["fees"],"summary":"Lookup Fee Schedules","description":"Return normalized exchange fee schedules for up to 1,000 instruments.\n\nCoefficients are decimal strings so clients can reproduce venue rounding\nwithout first losing precision through a JSON floating-point value.","operationId":"lookup_fee_schedules_v1_fees_schedules_lookup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeScheduleLookupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeeScheduleLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fills":{"get":{"tags":["fills"],"summary":"Get Fills","description":"Fetch fills/trades for the user's subaccounts.\n\nReturns fills grouped by subaccount, filterable by instrument and time range.","operationId":"get_fills_v1_fills_get","parameters":[{"name":"subaccount_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subaccount Id"}},{"name":"river_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id"}},{"name":"start_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"}},{"name":"end_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserFillListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generic-assets":{"get":{"tags":["generic-assets"],"summary":"List Generic Assets","description":"List generic assets visible to the caller (their own + platform-curated approved).\n\nSorted by resolves_at (soonest first), then name.","operationId":"list_generic_assets_v1_generic_assets_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by category. Repeat to filter to multiple categories.","title":"Category"},"description":"Filter by category. Repeat to filter to multiple categories."},{"name":"subcategory","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by subcategory","title":"Subcategory"},"description":"Filter by subcategory"},{"name":"owner","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'me' for own baskets only, 'platform' for public only","title":"Owner"},"description":"'me' for own baskets only, 'platform' for public only"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["generic-assets"],"summary":"Create Generic Asset","description":"Create a new user-owned generic asset (basket).","operationId":"create_generic_asset_v1_generic_assets_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generic-assets/{generic_asset_id}":{"get":{"tags":["generic-assets"],"summary":"Get Generic Asset","description":"Fetch a single generic asset (own or public-approved) with its resolved member markets.","operationId":"get_generic_asset_v1_generic_assets__generic_asset_id__get","parameters":[{"name":"generic_asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generic Asset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["generic-assets"],"summary":"Update Generic Asset","description":"Update a user-owned generic asset's name or description. Platform-curated assets cannot be edited via this route.","operationId":"update_generic_asset_v1_generic_assets__generic_asset_id__patch","parameters":[{"name":"generic_asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generic Asset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["generic-assets"],"summary":"Delete Generic Asset","description":"Delete a user-owned generic asset (cascades to members).","operationId":"delete_generic_asset_v1_generic_assets__generic_asset_id__delete","parameters":[{"name":"generic_asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generic Asset Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generic-assets/{generic_asset_id}/members":{"post":{"tags":["generic-assets"],"summary":"Add Generic Asset Members","description":"Add river_ids to a user-owned generic asset.","operationId":"add_generic_asset_members_v1_generic_assets__generic_asset_id__members_post","parameters":[{"name":"generic_asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generic Asset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetMemberAdd"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["generic-assets"],"summary":"Remove Generic Asset Members","description":"Remove river_ids from a user-owned generic asset.","operationId":"remove_generic_asset_members_v1_generic_assets__generic_asset_id__members_delete","parameters":[{"name":"generic_asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generic Asset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericAssetMemberRemove"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance/exchange":{"get":{"tags":["balance"],"summary":"Get Exchange Balance","description":"Return live exchange balances (Kalshi, Polymarket) for a non-custodial subaccount.","operationId":"get_exchange_balance_v1_balance_exchange_get","parameters":[{"name":"subaccount_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","description":"Non-custodial subaccount to fetch exchange balances for","title":"Subaccount Id"},"description":"Non-custodial subaccount to fetch exchange balances for"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance/exchange/shard-transfer":{"post":{"tags":["balance"],"summary":"Transfer Between Shards","description":"Move funds between Kalshi exchange shards within the subaccount's own account.","operationId":"transfer_between_shards_v1_balance_exchange_shard_transfer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShardTransferRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShardTransferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/search":{"get":{"tags":["markets"],"summary":"Search Markets","description":"Search and browse markets across all exchanges.\n\nSupports:\n- Exact match on ticker, condition_id, slug, river_id\n- Full-text search on name, description, tags\n- Browse by filters (no query required)\n- Results ranked by relevance\n\nDefaults to status=active; pass status=all to include closed markets.","operationId":"search_markets_v1_markets_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Search query","title":"Q"},"description":"Search query"},{"name":"exchange_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by exchange name (KALSHI, POLYMARKET)","title":"Exchange Name"},"description":"Filter by exchange name (KALSHI, POLYMARKET)"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by canonical category. Repeat the param to filter to multiple categories (Sports, Crypto, Politics, Finance, Entertainment, Science & Tech, Weather, World Affairs, Health, Social, Other).","title":"Category"},"description":"Filter by canonical category. Repeat the param to filter to multiple categories (Sports, Crypto, Politics, Finance, Entertainment, Science & Tech, Weather, World Affairs, Health, Social, Other)."},{"name":"subcategory","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by subcategory (e.g. Basketball, Football)","title":"Subcategory"},"description":"Filter by subcategory (e.g. Basketball, Football)"},{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/InstrumentStatusFilter","description":"Filter by instrument status. Defaults to active; pass 'all' for active and closed markets.","default":"active"},"description":"Filter by instrument status. Defaults to active; pass 'all' for active and closed markets."},{"name":"expiration_date_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of expiration date range (inclusive, ISO 8601)","title":"Expiration Date Start"},"description":"Start of expiration date range (inclusive, ISO 8601)"},{"name":"expiration_date_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of expiration date range (exclusive, ISO 8601)","title":"Expiration Date End"},"description":"End of expiration date range (exclusive, ISO 8601)"},{"name":"start_datetime_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter to markets with start_datetime >= this (ISO 8601)","title":"Start Datetime After"},"description":"Filter to markets with start_datetime >= this (ISO 8601)"},{"name":"start_datetime_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter to markets with start_datetime < this (ISO 8601)","title":"Start Datetime Before"},"description":"Filter to markets with start_datetime < this (ISO 8601)"},{"name":"event_ticker","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by event_ticker (exact match)","title":"Event Ticker"},"description":"Filter by event_ticker (exact match)"},{"name":"last_price_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Filter to markets with last_price >= this value (0.0–1.0 YES probability).","title":"Last Price Min"},"description":"Filter to markets with last_price >= this value (0.0–1.0 YES probability)."},{"name":"last_price_max","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Filter to markets with last_price <= this value (0.0–1.0 YES probability).","title":"Last Price Max"},"description":"Filter to markets with last_price <= this value (0.0–1.0 YES probability)."},{"name":"volume_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Filter to events whose total summed volume >= this value.","title":"Volume Min"},"description":"Filter to events whose total summed volume >= this value."},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sort mode for event-based pagination: trending, volume, newest, ending-soon, start-time, price","title":"Sort By"},"description":"Sort mode for event-based pagination: trending, volume, newest, ending-soon, start-time, price"},{"name":"include_combos","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeCombos","description":"How to treat parlays: 'exclude' (default), 'include' alongside standard markets, or 'only' combos.","default":"exclude"},"description":"How to treat parlays: 'exclude' (default), 'include' alongside standard markets, or 'only' combos."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of results","default":20,"title":"Limit"},"description":"Maximum number of results"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination","default":0,"title":"Offset"},"description":"Offset for pagination"},{"name":"event_limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2000,"minimum":1},{"type":"null"}],"description":"Paginate by events instead of markets. Up to 200 by default; values above that require start_datetime_after or start_datetime_before.","title":"Event Limit"},"description":"Paginate by events instead of markets. Up to 200 by default; values above that require start_datetime_after or start_datetime_before."},{"name":"event_offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Event offset for event-based pagination","title":"Event Offset"},"description":"Event offset for event-based pagination"},{"name":"markets_per_event","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"With event pagination, cap the markets returned per event to the top N by volume (query-matched markets always survive the cap). Each row's event_market_count carries the event's full market count so clients can lazy-load the rest.","title":"Markets Per Event"},"description":"With event pagination, cap the markets returned per event to the top N by volume (query-matched markets always survive the cap). Each row's event_market_count carries the event's full market count so clients can lazy-load the rest."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/lookup":{"get":{"tags":["markets"],"summary":"Lookup Markets","description":"Batch lookup markets by river_ids.","operationId":"lookup_markets_v1_markets_lookup_get","parameters":[{"name":"river_ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated list of river IDs","title":"River Ids"},"description":"Comma-separated list of river IDs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/resolve-combos":{"post":{"tags":["markets"],"summary":"Resolve Combos","description":"Resolve Kalshi combo markets into their constituent legs.\n\nLegs come back hydrated with the full market row when the leg is in the\nuniverse. River_ids that are not combos (or whose legs have not been\ningested yet) return an empty ``legs`` list.","operationId":"resolve_combos_v1_markets_resolve_combos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveCombosRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveCombosResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/match":{"get":{"tags":["markets"],"summary":"Match Market","description":"Exact match a single market by Kalshi ticker or Polymarket slug. Supply exactly one.","operationId":"match_market_v1_markets_match_get","parameters":[{"name":"ticker","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact Kalshi ticker (e.g. KXNBA-26-DET)","title":"Ticker"},"description":"Exact Kalshi ticker (e.g. KXNBA-26-DET)"},{"name":"slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact Polymarket slug (e.g. will-the-denver-nuggets-win-the-2026-nba-finals)","title":"Slug"},"description":"Exact Polymarket slug (e.g. will-the-denver-nuggets-win-the-2026-nba-finals)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketSearchResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/markets/match/batch":{"post":{"tags":["markets"],"summary":"Match Markets Batch","description":"Batch-resolve many markets by exact Kalshi ticker and/or Polymarket slug in one request.\n\nThe single-market ``/match`` endpoint costs one round-trip per identifier, so resolving\nthousands of mappings serially is slow. This endpoint takes lists of tickers and/or slugs\n(send them together in one call) and returns a full market row — including ``river_id``,\n``ticker``, ``slug`` and ``exchange_name`` — for every identifier that matched. Identifiers\nwith no match come back in ``unmatched_tickers`` / ``unmatched_slugs``.","operationId":"match_markets_batch_v1_markets_match_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketMatchBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketMatchBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orderbooks/generic-asset/{generic_asset_id}":{"get":{"tags":["orderbooks"],"summary":"Get Generic Asset Orderbook","description":"Get merged orderbook for a generic asset (basket).\n\nFetches orderbooks for all member instruments and merges them by summing\nquantity at each price level. Touch mechanism ensures subscriptions are active.","operationId":"get_generic_asset_orderbook_v1_orderbooks_generic_asset__generic_asset_id__get","parameters":[{"name":"generic_asset_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Generic Asset Id"}},{"name":"levels","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Number of price levels to return","default":10,"title":"Levels"},"description":"Number of price levels to return"},{"name":"exchanges","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Restrict the merge to these exchanges (e.g. KALSHI, POLYMARKET). Omit for all member venues.","title":"Exchanges"},"description":"Restrict the merge to these exchanges (e.g. KALSHI, POLYMARKET). Omit for all member venues."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderbookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orderbooks/{river_id}":{"get":{"tags":["orderbooks"],"summary":"Get Orderbook","description":"Get orderbook for a river_id.","operationId":"get_orderbook_v1_orderbooks__river_id__get","parameters":[{"name":"river_id","in":"path","required":true,"schema":{"type":"integer","title":"River Id"}},{"name":"levels","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Number of price levels to return","default":10,"title":"Levels"},"description":"Number of price levels to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderbookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders":{"post":{"tags":["orders"],"summary":"Create Order","description":"Place a new order.\n\nSubmits an order for asynchronous processing. The order is persisted immediately\nand queued for execution on the target exchange.\n\nSee  [Orders](https://docs.rivermarkets.com/concepts/orders) and [Order Types](https://docs.rivermarkets.com/concepts/order-types) for more information.\n\n**Asset Selection:**\nProvide exactly one of `river_id` (standard instrument) or `generic_asset_id` (user-defined basket).\nGeneric asset orders are `LIMIT` only — the system routes IOC limit orders to each\nunderlying instrument at optimal prices. `price` bounds the fills (max for buys, min\nfor sells); liquidity beyond it is not taken and the unfilled remainder is cancelled.\n\n**Response:**\nReturns `202 Accepted` with the order_id and associated complex_orders ids (TP/SL).\nPoll `GET /v1/orders/{order_id}` or use webhooks to track execution.","operationId":"create_order_v1_orders_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["orders"],"summary":"List Orders","description":"List orders with optional filters.\n\nReturns a paginated list of orders across all accessible subaccounts, ordered by `created_at` descending.\n\n**Filters:**\nAll filters are optional and can be combined. If no `subaccount_id` is specified,\nreturns orders from all subaccounts the user has access to.\n\n**Order Statuses:**\n- `PENDING_SUBMISSION`: Order received, awaiting exchange submission.\n- `PROCESSING`: Being processed by the order consumer.\n- `RESTING`: Live on the exchange order book (may include partially-filled live orders).\n- `EXECUTED`: Terminal — fully filled.\n- `PARTIALLY_FILLED`: Terminal — cancelled with some quantity filled.\n- `CANCELLED`: Terminal — cancelled with no fills.\n- `REJECTED`: Rejected by exchange (see order details for reason).\n\n**Aggregated Fields:**\nEach order includes `traded_qty`, `average_price`, and `fees_paid` computed from fills.","operationId":"list_orders_v1_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by order status. Accepts a single OrderStatus name (e.g. 'RESTING') or the meta-value 'ACTIVE' which resolves to RESTING.","title":"Status"},"description":"Filter by order status. Accepts a single OrderStatus name (e.g. 'RESTING') or the meta-value 'ACTIVE' which resolves to RESTING."},{"name":"river_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by instrument ID","title":"River Id"},"description":"Filter by instrument ID"},{"name":"generic_asset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by generic asset ID","title":"Generic Asset Id"},"description":"Filter by generic asset ID"},{"name":"subaccount_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to a specific subaccount","title":"Subaccount Id"},"description":"Filter to a specific subaccount"},{"name":"parent_iceberg_order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to child tranches of a specific iceberg parent.","title":"Parent Iceberg Order Id"},"description":"Filter to child tranches of a specific iceberg parent."},{"name":"parent_peg_order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to child tranches of a specific peg parent.","title":"Parent Peg Order Id"},"description":"Filter to child tranches of a specific peg parent."},{"name":"parent_smart_taker_order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter to IOC children of a specific smart-taker parent.","title":"Parent Smart Taker Order Id"},"description":"Filter to IOC children of a specific smart-taker parent."},{"name":"buy_flag","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by direction: true=buys, false=sells","title":"Buy Flag"},"description":"Filter by direction: true=buys, false=sells"},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only orders created at or after this time (inclusive, ISO 8601; naive values are treated as UTC).","title":"Created After"},"description":"Only orders created at or after this time (inclusive, ISO 8601; naive values are treated as UTC)."},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only orders created before this time (exclusive, ISO 8601; naive values are treated as UTC).","title":"Created Before"},"description":"Only orders created before this time (exclusive, ISO 8601; naive values are treated as UTC)."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Free-text search across the order's market: ticker/slug, the human-readable question (event title, market name, outcome) via full-text + substring match, plus the order's river_id / order id / generic asset id. Applied server-side over all matching orders, not just the current page.","title":"Search"},"description":"Free-text search across the order's market: ticker/slug, the human-readable question (event title, market name, outcome) via full-text + substring match, plus the order's river_id / order id / generic asset id. Applied server-side over all matching orders, not just the current page."},{"name":"show_tp_sl_active","in":"query","required":false,"schema":{"type":"boolean","description":"When true, complex_order_ids only includes attached TP/SL orders with status PENDING or ACTIVE.","default":false,"title":"Show Tp Sl Active"},"description":"When true, complex_order_ids only includes attached TP/SL orders with status PENDING or ACTIVE."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"description":"Results per page (max 10000)","default":100,"title":"Limit"},"description":"Results per page (max 10000)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/batch":{"post":{"tags":["orders"],"summary":"Create Order Batch","description":"Place up to 10 orders in one request.\n\nAll orders must share one `subaccount_id`. Items are validated\nindependently: an invalid item is rejected in its per-index result while\nvalid items proceed, so the response is `202 Accepted` even when some (or\nall) items fail validation. Generic asset orders are not supported in\nbatches. Accepted orders are queued for execution exactly like\n`POST /v1/orders`; track fills and rejections via `GET /v1/orders/{order_id}`\nor the orders websocket.","operationId":"create_order_batch_v1_orders_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBatchCreate"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBatchCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}":{"get":{"tags":["orders"],"summary":"Get Order","description":"Get a single order by ID with its fills.\n\nReturns complete order details including execution history.\n\n**Use Cases:**\n- Track order progress and execution quality\n- Reconcile fills for accounting\n- Debug rejected or partially filled orders","operationId":"get_order_v1_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["orders"],"summary":"Cancel Order","description":"Cancel an existing order.\n\nRequest cancellation of an order.\nReturns 202 Accepted with order state - cancellation is processed asynchronously.","operationId":"cancel_order_v1_orders__order_id__delete","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["orders"],"summary":"Edit Order","description":"Edit (amend) a resting simple limit order.\n\nOnly `qty` and `price` are editable. `qty` is the new TOTAL quantity (not remaining).\nThe order must be RESTING, a simple order (no iceberg/peg parent), a single-instrument\nLIMIT order. Returns 202 Accepted; final status is delivered via the orders WS.","operationId":"edit_order_v1_orders__order_id__patch","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEditRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEditResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/{order_id}/queue-position":{"get":{"tags":["orders"],"summary":"Get Order Queue Position","description":"Get the best (minimum) queue position across all exchange orders backing this river order.\n\nCurrently supported only for Kalshi-backed orders.","operationId":"get_order_queue_position_v1_orders__order_id__queue_position_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderQueuePositionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/orders/cancel-all":{"post":{"tags":["orders"],"summary":"Cancel All Orders","description":"Cancel all open orders for a subaccount.\n\nIf `river_ids` is set, only orders on those instruments are cancelled;\nit must be omitted/null or non-empty. Cancellation is processed\nasynchronously by the order consumer.","operationId":"cancel_all_orders_v1_orders_cancel_all_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelAllRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/positions":{"get":{"tags":["positions"],"summary":"Get Positions","description":"Fetch positions for user's subaccounts.\n\nPositions are computed from cumulative fills, with avg buy/sell prices,\nfees, and fill count. Returns positions grouped by subaccount.\nBy default, only positions in open markets are returned.","operationId":"get_positions_v1_positions_get","parameters":[{"name":"subaccount_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by specific subaccount","title":"Subaccount Id"},"description":"Filter by specific subaccount"},{"name":"river_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by instrument","title":"River Id"},"description":"Filter by instrument"},{"name":"include_closed","in":"query","required":false,"schema":{"type":"boolean","description":"Include positions in closed markets","default":false,"title":"Include Closed"},"description":"Include positions in closed markets"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPositionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/prices/{river_id}/volume":{"get":{"tags":["prices"],"summary":"Get Volume","description":"Traded volume over a recent window, summed from our captured trade prints\n(all exchanges write to `trade_prints`). 1 contract traded = $1 of volume.\nSummed from the raw hypertable rather than the OHLC continuous aggregates\nso the most recent minutes are always included.","operationId":"get_volume_v1_prices__river_id__volume_get","parameters":[{"name":"river_id","in":"path","required":true,"schema":{"type":"integer","description":"River market ID","title":"River Id"},"description":"River market ID"},{"name":"window","in":"query","required":false,"schema":{"enum":["15m","1h","24h"],"type":"string","description":"Lookback window","default":"1h","title":"Window"},"description":"Lookback window"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VolumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/prices/volume":{"get":{"tags":["prices"],"summary":"Get Volume Batch","description":"Batch variant of the windowed-volume endpoint for grid views (multibook):\none grouped scan of `trade_prints` instead of a request per market.\nMarkets with no prints in the window come back with volume 0.","operationId":"get_volume_batch_v1_prices_volume_get","parameters":[{"name":"river_ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated list of river IDs","title":"River Ids"},"description":"Comma-separated list of river IDs"},{"name":"window","in":"query","required":false,"schema":{"enum":["15m","1h","24h"],"type":"string","description":"Lookback window","default":"1h","title":"Window"},"description":"Lookback window"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchVolumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/prices/{river_id}":{"get":{"tags":["prices"],"summary":"Get Prices","description":"Get price data for a market.\nReturns either candlestick OHLC data or simple price history based on the `type` parameter.\nThe endpoint automatically determines the exchange and fetches data accordingly.\n\n- **Kalshi**: Returns real OHLC candlestick data with volume\n- **Polymarket**: Returns price history (candlesticks will have synthetic OHLC where all values equal the price)\n\nAll prices are normalized to 0-1 range.","operationId":"get_prices_v1_prices__river_id__get","parameters":[{"name":"river_id","in":"path","required":true,"schema":{"type":"integer","description":"River market ID","title":"River Id"},"description":"River market ID"},{"name":"type","in":"query","required":false,"schema":{"enum":["candlesticks","history"],"type":"string","description":"Response type","default":"candlesticks","title":"Type"},"description":"Response type"},{"name":"interval","in":"query","required":false,"schema":{"enum":["1d","1w","1m","max"],"type":"string","description":"Time range","default":"1d","title":"Interval"},"description":"Time range"},{"name":"fidelity","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":1,"description":"Minutes per data point (for Polymarket history)","default":60,"title":"Fidelity"},"description":"Minutes per data point (for Polymarket history)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subaccounts":{"get":{"tags":["subaccounts"],"summary":"List Subaccounts","description":"Enumerate all trading subaccounts accessible to the user.\n\nReturns list of accounts with identifiers and metadata.","operationId":"list_subaccounts_v1_subaccounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SubaccountResponse"},"type":"array","title":"Response List Subaccounts V1 Subaccounts Get"}}}}}},"post":{"tags":["subaccounts"],"summary":"Create Subaccount","description":"Create a new trading subaccount. Any active org member can create one;\naccount_type is pinned to non_custodial server-side. A non-admin creator\ngets an explicit admin grant on the new subaccount (org admins hold derived\naccess on every subaccount and never get grant rows).\n\nRuns on the unscoped session: the creator holds no user:manage grant on\nthe subaccount until this transaction writes it, so the scoped-session RLS\nWITH CHECK on subaccount_grants can never admit the bootstrap row.","operationId":"create_subaccount_v1_subaccounts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subaccounts/{subaccount_id}":{"get":{"tags":["subaccounts"],"summary":"Get Subaccount","description":"Fetch configuration and metadata for a specific subaccount.\n\nReturns account configuration, limits, and descriptive metadata.","operationId":"get_subaccount_v1_subaccounts__subaccount_id__get","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","title":"Subaccount Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["subaccounts"],"summary":"Update Subaccount","description":"Update an existing subaccount. Requires user:manage on the subaccount.","operationId":"update_subaccount_v1_subaccounts__subaccount_id__patch","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","title":"Subaccount Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["subaccounts"],"summary":"Delete Subaccount","description":"Delete a subaccount. Requires user:manage on the subaccount. Custodial\nsubaccounts cannot be deleted.\n\nRefused with 409 if the subaccount has any open order (resting/in-flight\norders, or an active iceberg, peg, smart-taker or conditional order) —\ncancel those first.\n\nThis is a soft delete: the row is marked is_active = false so the audit trail\n(orders, fills, ledger entries) stays intact. The user never sees it again.","operationId":"delete_subaccount_v1_subaccounts__subaccount_id__delete","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","title":"Subaccount Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subaccounts/{subaccount_id}/grants":{"get":{"tags":["subaccounts"],"summary":"List Subaccount Grants","description":"Effective access on a subaccount: derived org-admin entries (not editable per\nsubaccount) plus explicit grant rows. Requires user:manage.","operationId":"list_subaccount_grants_v1_subaccounts__subaccount_id__grants_get","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","title":"Subaccount Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubaccountGrantResponse"},"title":"Response List Subaccount Grants V1 Subaccounts  Subaccount Id  Grants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subaccounts/{subaccount_id}/grants/{user_id}":{"put":{"tags":["subaccounts"],"summary":"Put Subaccount Grant","description":"Assign or change a member's role on a subaccount. The role name is expanded to\npermission strings server-side; audit rows come from the DB trigger.","operationId":"put_subaccount_grant_v1_subaccounts__subaccount_id__grants__user_id__put","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","title":"Subaccount Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountGrantPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountGrantPutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["subaccounts"],"summary":"Delete Subaccount Grant","description":"Remove a member's grant on a subaccount; audit row comes from the DB trigger.","operationId":"delete_subaccount_grant_v1_subaccounts__subaccount_id__grants__user_id__delete","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"string","title":"Subaccount Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tradeprints":{"get":{"tags":["tradeprints"],"summary":"Get Tradeprints","description":"Return the most recent trades for one or more markets, sourced directly from\nthe exchanges. Markets are fetched concurrently with a small semaphore\n(`MAX_CONCURRENT_FETCHES`) so a long input list never fans out into a\nthundering herd, and the result list preserves the input order. A failure\non any single market becomes a `not_found` row with a message — the call as\na whole does not 500.\n\nPer-market lookup paths:\n  - Kalshi: `GET /markets/trades?ticker=...&limit=...`\n  - Polymarket: `GET https://data-api.polymarket.com/trades?market=<token>&limit=...`\n    (both YES and NO legs are fetched and the NO leg is flipped into YES-price terms)\n\nTrades are sorted newest-first within each market. Prices are normalised to 0-1.\n\nUse this together with the `/v1/ws/tradeprints` WebSocket: hit this endpoint to\nbackfill the tape on page load, then dedup live WS events by `exchange_trade_id`.","operationId":"get_tradeprints_v1_tradeprints_get","parameters":[{"name":"river_ids","in":"query","required":true,"schema":{"type":"array","items":{"type":"integer"},"description":"River market IDs (repeat the param for each)","title":"River Ids"},"description":"River market IDs (repeat the param for each)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max trades returned per market","default":50,"title":"Limit"},"description":"Max trades returned per market"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeprintsBulkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/watchlists":{"get":{"tags":["watchlists"],"summary":"List Watchlists","description":"List the caller's watchlists (optionally scoped to one subaccount), newest first.","operationId":"list_watchlists_v1_watchlists_get","parameters":[{"name":"subaccount_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Restrict to a single owning subaccount","title":"Subaccount Id"},"description":"Restrict to a single owning subaccount"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["watchlists"],"summary":"Create Watchlist","description":"Create a new watchlist, optionally seeded with an ordered set of river_ids.","operationId":"create_watchlist_v1_watchlists_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/watchlists/{watchlist_id}":{"get":{"tags":["watchlists"],"summary":"Get Watchlist","description":"Fetch a single watchlist with its ordered member markets.","operationId":"get_watchlist_v1_watchlists__watchlist_id__get","parameters":[{"name":"watchlist_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watchlist Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["watchlists"],"summary":"Update Watchlist","description":"Rename a watchlist or edit its description.","operationId":"update_watchlist_v1_watchlists__watchlist_id__patch","parameters":[{"name":"watchlist_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watchlist Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["watchlists"],"summary":"Delete Watchlist","description":"Delete a watchlist (cascades to its members).","operationId":"delete_watchlist_v1_watchlists__watchlist_id__delete","parameters":[{"name":"watchlist_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watchlist Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/watchlists/{watchlist_id}/members":{"post":{"tags":["watchlists"],"summary":"Add Watchlist Members","description":"Append river_ids to the end of a watchlist.","operationId":"add_watchlist_members_v1_watchlists__watchlist_id__members_post","parameters":[{"name":"watchlist_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watchlist Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistMemberAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["watchlists"],"summary":"Remove Watchlist Members","description":"Remove river_ids from a watchlist. Remaining members keep their relative order.","operationId":"remove_watchlist_members_v1_watchlists__watchlist_id__members_delete","parameters":[{"name":"watchlist_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watchlist Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistMemberAdd"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/watchlists/{watchlist_id}/members/order":{"put":{"tags":["watchlists"],"summary":"Reorder Watchlist Members","description":"Reorder a watchlist. The body is the full ordered river_id list; the server\nrewrites each member's position to match. Unknown river_ids are ignored;\nmembers omitted from the list are pushed to the end in their prior order.","operationId":"reorder_watchlist_members_v1_watchlists__watchlist_id__members_order_put","parameters":[{"name":"watchlist_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Watchlist Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistMemberReorder"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountType":{"type":"string","enum":["custodial","non_custodial"],"title":"AccountType","description":"Type of trading subaccount."},"BatchVolumeEntry":{"properties":{"river_id":{"type":"integer","title":"River Id"},"volume":{"type":"number","title":"Volume"}},"type":"object","required":["river_id","volume"],"title":"BatchVolumeEntry"},"BatchVolumeResponse":{"properties":{"window":{"type":"string","enum":["15m","1h","24h"],"title":"Window"},"volumes":{"items":{"$ref":"#/components/schemas/BatchVolumeEntry"},"type":"array","title":"Volumes"},"as_of":{"type":"integer","title":"As Of"}},"type":"object","required":["window","volumes","as_of"],"title":"BatchVolumeResponse","description":"Windowed traded volume for a batch of markets (multibook grids)."},"CancelAllComplexOrdersRequest":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Subaccount to cancel all complex orders for"},"river_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"River Ids","description":"If set, only cancel cancellable complex orders for these instruments. Must be either omitted/null or a non-empty list."}},"type":"object","required":["subaccount_id"],"title":"CancelAllComplexOrdersRequest","description":"Request body for cancelling all complex orders for a subaccount."},"CancelAllRequest":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"river_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"River Ids","description":"If set, only cancel open orders for these instruments; otherwise cancel all open orders on the subaccount. Must be either omitted/null or a non-empty list."}},"type":"object","required":["subaccount_id"],"title":"CancelAllRequest","description":"Request body for cancelling all orders for a subaccount."},"CancelComplexOrderResponse":{"properties":{"cancelled_complex_order_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Cancelled Complex Order Ids","description":"List of cancelled complex order identifiers"},"failed_cancelled_complex_order_ids":{"additionalProperties":{"type":"string"},"propertyNames":{"format":"uuid"},"type":"object","title":"Failed Cancelled Complex Order Ids","description":"Dictionary of failed to cancel complex order identifiers and reasons"}},"type":"object","required":["cancelled_complex_order_ids","failed_cancelled_complex_order_ids"],"title":"CancelComplexOrderResponse","description":"Schema for cancel order response What is returned when user cancels an order/ orders."},"CancelOrderResponse":{"properties":{"cancelled_river_order_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Cancelled River Order Ids","description":"List of cancelled river order identifiers"},"failed_cancelled_reasons":{"additionalProperties":{"type":"string"},"propertyNames":{"format":"uuid"},"type":"object","title":"Failed Cancelled Reasons","description":"Dictionary of failed to cancel river order identifiers and reasons"}},"type":"object","required":["cancelled_river_order_ids","failed_cancelled_reasons"],"title":"CancelOrderResponse","description":"Schema for cancel order response"},"ComboLeg":{"properties":{"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id"},"ticker":{"type":"string","title":"Ticker"},"leg_qty":{"type":"integer","title":"Leg Qty","description":"+1 = yes side, -1 = no side."},"market":{"anyOf":[{"$ref":"#/components/schemas/MarketSearchResult"},{"type":"null"}]}},"type":"object","required":["ticker","leg_qty"],"title":"ComboLeg","description":"One leg of a combo. ``market`` is null when the leg market is not in the universe."},"ComplexOrderCreateRequest":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Subaccount to create the order under"},"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id","description":"Instrument ID. Mutually exclusive with generic_asset_id."},"generic_asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generic Asset Id","description":"Generic asset basket ID. Mutually exclusive with river_id."},"conditional_order_params":{"anyOf":[{"$ref":"#/components/schemas/ConditionalOrderCreate"},{"type":"null"}],"description":"Conditional order parameters (TP/SL/STOP)"},"iceberg_order_params":{"anyOf":[{"$ref":"#/components/schemas/IcebergOrderParams"},{"type":"null"}],"description":"Iceberg order parameters"},"peg_order_params":{"anyOf":[{"$ref":"#/components/schemas/PegOrderParams"},{"type":"null"}],"description":"Peg order parameters"},"smart_taker_order_params":{"anyOf":[{"$ref":"#/components/schemas/SmartTakerOrderParams"},{"type":"null"}],"description":"Smart-taker order parameters"}},"type":"object","required":["subaccount_id"],"title":"ComplexOrderCreateRequest","description":"Request body for creating a complex order.\n\nProvide exactly one of `conditional_order_params` (TP/SL/STOP) or\n`iceberg_order_params` (iceberg). The active param block determines the\ncomplex_order_type."},"ComplexOrderCreateResponse":{"properties":{"complex_order_id":{"type":"string","format":"uuid","title":"Complex Order Id","description":"Unique complex order identifier"}},"type":"object","required":["complex_order_id"],"title":"ComplexOrderCreateResponse","description":"Schema for a complex order response (unified across all complex order types)."},"ComplexOrderListResponse":{"properties":{"complex_orders":{"additionalProperties":{"items":{"$ref":"#/components/schemas/ComplexOrderResponse"},"type":"array"},"type":"object","title":"Complex Orders","description":"List of complex orders matching the query"},"count":{"type":"integer","title":"Count","description":"Total count of matching complex orders (for pagination)"}},"type":"object","required":["complex_orders","count"],"title":"ComplexOrderListResponse","description":"Schema for list of complex orders (all types)."},"ComplexOrderResponse":{"properties":{"complex_order_id":{"type":"string","format":"uuid","title":"Complex Order Id","description":"Unique complex order identifier"},"complex_order_type":{"type":"string","title":"Complex Order Type","description":"Complex order type: CONDITIONAL, TWAP, etc."},"complex_order_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Complex Order Subtype","description":"Complex order subtype: TP, SL, STOP, etc."},"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Subaccount the order belongs to"},"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id","description":"Instrument ID"},"generic_asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generic Asset Id","description":"Generic asset basket ID"},"status":{"type":"string","title":"Status","description":"Order status (interpretation depends on complex_order_type)"},"created_at":{"type":"string","title":"Created At","description":"Creation timestamp (UTC)"},"updated_at":{"type":"string","title":"Updated At","description":"Last update timestamp (UTC)"},"conditional_order":{"anyOf":[{"$ref":"#/components/schemas/ConditionalOrderResponse"},{"type":"null"}],"description":"Conditional order detail"},"iceberg_order":{"anyOf":[{"$ref":"#/components/schemas/IcebergOrderResponse"},{"type":"null"}],"description":"Iceberg order detail"},"peg_order":{"anyOf":[{"$ref":"#/components/schemas/PegOrderResponse"},{"type":"null"}],"description":"Peg order detail"},"smart_taker_order":{"anyOf":[{"$ref":"#/components/schemas/SmartTakerOrderResponse"},{"type":"null"}],"description":"Smart-taker order detail"}},"type":"object","required":["complex_order_id","complex_order_type","subaccount_id","status","created_at","updated_at"],"title":"ComplexOrderResponse","description":"Schema for a complex order response (unified across all complex order types)."},"ConditionalOrderCreate":{"properties":{"conditional_order_type":{"type":"string","enum":["TP","SL","STOP","REVERSE_STOP"],"description":"Type of conditional order: TP (take profit), SL (stop loss), or STOP"},"stop_order_price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Stop Order Price","description":"Activation price for STOP conditional orders. This is the price at which the conditional order triggers and places the trigger_order."},"trigger_order":{"$ref":"#/components/schemas/TriggerOrder","description":"The order that gets placed when the conditional order activates. For TP/SL this happens after the parent order fills; for STOP this happens when stop_order_price is reached."},"parent_river_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent River Order Id","description":"Parent order ID (required for TP and SL)"},"parent_complex_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Complex Order Id","description":"Parent complex order ID (for chaining)"}},"type":"object","required":["conditional_order_type","trigger_order"],"title":"ConditionalOrderCreate","description":"Schema for a conditional order (take profit or stop loss) attached to a parent order."},"ConditionalOrderResponse":{"properties":{"parent_river_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent River Order Id","description":"Parent order ID that this conditional is attached to (for TP/SL)"},"parent_complex_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Complex Order Id","description":"Parent complex order ID that this conditional is attached to (for chaining)"},"conditional_order_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conditional Order Type","description":"Type of conditional order: TP (take profit), SL (stop loss), or STOP"},"stop_order_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Order Price","description":"Activation price for STOP conditional orders. The price at which the conditional triggers and places the trigger order."},"trigger_stop_order_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trigger Stop Order Price","description":"Stop/reverse-stop price for the triggered order (SL or TP MARKET)"},"trigger_order_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Order Type","description":"Order type of the triggered order: LIMIT or MARKET"},"trigger_order_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trigger Order Qty","description":"Quantity of the triggered order"},"trigger_order_limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trigger Order Limit Price","description":"Limit price of the triggered order (if LIMIT)"},"trigger_order_buy_flag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Trigger Order Buy Flag","description":"Direction of the triggered order: true=buy, false=sell"},"trigger_river_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Trigger River Order Id","description":"River order ID of the triggered order (set once activated)"},"trigger_complex_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Trigger Complex Order Id","description":"Complex order ID of the triggered order (set once activated)"}},"type":"object","title":"ConditionalOrderResponse","description":"Response for a conditional order. Contains both the condition definition and the trigger order\nthat gets placed when the condition is met.\n\nFor TP/SL: the parent order fills → the conditional activates → the trigger order is placed.\nFor STOP/REVERSE_STOP: stop_order_price is reached → the trigger order is placed."},"ConditionalOrderType":{"type":"integer","enum":[1,2,3,4],"title":"ConditionalOrderType"},"ExchangeBalance":{"properties":{"exchange_id":{"type":"integer","title":"Exchange Id"},"exchange_name":{"type":"string","title":"Exchange Name"},"balance":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Balance"},"shard_balances":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExchangeShardBalance"},"type":"array"},{"type":"null"}],"title":"Shard Balances"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["exchange_id","exchange_name"],"title":"ExchangeBalance"},"ExchangeBalanceResponse":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"balances":{"items":{"$ref":"#/components/schemas/ExchangeBalance"},"type":"array","title":"Balances"}},"type":"object","required":["subaccount_id","balances"],"title":"ExchangeBalanceResponse"},"ExchangeShardBalance":{"properties":{"exchange_shard":{"type":"integer","title":"Exchange Shard"},"balance":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance"}},"type":"object","required":["exchange_shard","balance"],"title":"ExchangeShardBalance"},"FairValueItem":{"properties":{"river_id":{"type":"integer","title":"River Id"},"fair_value":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Fair Value","description":"Probability in [0, 1]"}},"type":"object","required":["river_id","fair_value"],"title":"FairValueItem","description":"One (instrument, fair value) pair within a batch upsert."},"FairValueListResponse":{"properties":{"fair_values":{"items":{"$ref":"#/components/schemas/FairValueResponse"},"type":"array","title":"Fair Values"}},"type":"object","required":["fair_values"],"title":"FairValueListResponse"},"FairValueResponse":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"river_id":{"type":"integer","title":"River Id"},"fair_value":{"type":"number","title":"Fair Value"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["subaccount_id","river_id","fair_value","updated_at"],"title":"FairValueResponse","description":"A user-set fair value for one instrument on one subaccount."},"FairValuesUpsert":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"fair_values":{"items":{"$ref":"#/components/schemas/FairValueItem"},"type":"array","maxItems":1000,"minItems":1,"title":"Fair Values"}},"type":"object","required":["subaccount_id","fair_values"],"title":"FairValuesUpsert","description":"Request schema for setting fair values on one subaccount (insert-or-overwrite)."},"FeeModel":{"type":"string","enum":["price_shape_v1"],"title":"FeeModel","description":"Formula applied before a fee rule's rounding step.\n\n``PRICE_SHAPE_V1`` computes\n``quantity * coefficient * price * (1 - price)``."},"FeeRounding":{"type":"string","enum":["none","ceil_cent","half_even_cent"],"title":"FeeRounding"},"FeeRuleResponse":{"properties":{"coefficient":{"type":"string","title":"Coefficient","description":"Decimal multiplier in fee = quantity × coefficient × price × (1 - price)."},"rounding":{"$ref":"#/components/schemas/FeeRounding"},"pre_ceiling_cent_decimals":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pre Ceiling Cent Decimals","description":"Decimal places used to stabilize fee × 100 before applying ceil_cent."}},"type":"object","required":["coefficient","rounding","pre_ceiling_cent_decimals"],"title":"FeeRuleResponse"},"FeeScheduleLookupRequest":{"properties":{"river_ids":{"items":{"type":"integer"},"type":"array","maxItems":1000,"minItems":1,"title":"River Ids","description":"River IDs whose exchange fee schedules should be returned."}},"type":"object","required":["river_ids"],"title":"FeeScheduleLookupRequest"},"FeeScheduleLookupResponse":{"properties":{"schedules":{"items":{"$ref":"#/components/schemas/FeeScheduleResponse"},"type":"array","title":"Schedules"},"missing_river_ids":{"items":{"type":"integer"},"type":"array","title":"Missing River Ids"}},"type":"object","required":["schedules","missing_river_ids"],"title":"FeeScheduleLookupResponse"},"FeeScheduleResponse":{"properties":{"river_id":{"type":"integer","title":"River Id"},"exchange":{"type":"string","title":"Exchange"},"model":{"$ref":"#/components/schemas/FeeModel"},"maker":{"$ref":"#/components/schemas/FeeRuleResponse"},"taker":{"$ref":"#/components/schemas/FeeRuleResponse"},"schedule_version":{"type":"string","title":"Schedule Version","description":"Stable fingerprint of the normalized schedule."}},"type":"object","required":["river_id","exchange","model","maker","taker","schedule_version"],"title":"FeeScheduleResponse"},"FillResponse":{"properties":{"river_id":{"type":"integer","title":"River Id"},"client_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Order Id"},"exchange_order_id":{"type":"string","title":"Exchange Order Id"},"exchange_trade_id":{"type":"string","title":"Exchange Trade Id"},"exchange_timestamp":{"type":"string","title":"Exchange Timestamp","description":"Execution timestamp from exchange (UTC)"},"price":{"type":"number","title":"Price"},"qty":{"type":"number","title":"Qty"},"fee":{"type":"number","title":"Fee"},"buy_flag":{"type":"boolean","title":"Buy Flag"},"is_maker":{"type":"boolean","title":"Is Maker"},"counterparty_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty Address"},"counterparty_exchange_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counterparty Exchange Order Id"}},"type":"object","required":["river_id","exchange_order_id","exchange_trade_id","exchange_timestamp","price","qty","fee","buy_flag","is_maker"],"title":"FillResponse","description":"Schema for fill response."},"GenericAssetCreate":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"name":{"type":"string","maxLength":255,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"river_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"River Ids"}},"type":"object","required":["subaccount_id","name"],"title":"GenericAssetCreate","description":"Request schema for creating a new user-owned generic asset (basket)."},"GenericAssetDetailResponse":{"properties":{"generic_asset_id":{"type":"string","format":"uuid","title":"Generic Asset Id"},"owner_subaccount_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Subaccount Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory"},"resolves_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolves At"},"start_datetime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Datetime"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"match_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Type"},"members":{"items":{"$ref":"#/components/schemas/MarketSearchResult"},"type":"array","title":"Members"},"inserted_at":{"type":"string","title":"Inserted At","description":"Creation timestamp (UTC)"}},"type":"object","required":["generic_asset_id","name","members","inserted_at"],"title":"GenericAssetDetailResponse","description":"Response schema for a generic asset with its resolved members (detail view)."},"GenericAssetListResponse":{"properties":{"assets":{"items":{"$ref":"#/components/schemas/GenericAssetResponse"},"type":"array","title":"Assets"}},"type":"object","required":["assets"],"title":"GenericAssetListResponse"},"GenericAssetMemberAdd":{"properties":{"river_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"River Ids"}},"type":"object","required":["river_ids"],"title":"GenericAssetMemberAdd","description":"Request schema for adding members to a user-owned generic asset."},"GenericAssetMemberRemove":{"properties":{"river_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"River Ids"}},"type":"object","required":["river_ids"],"title":"GenericAssetMemberRemove","description":"Request schema for removing members from a user-owned generic asset."},"GenericAssetResponse":{"properties":{"generic_asset_id":{"type":"string","title":"Generic Asset Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory"},"resolves_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolves At"},"start_datetime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Datetime","description":"Underlying event start (e.g. first pitch), for calendar views"},"owner_subaccount_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Subaccount Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"match_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Type","description":"'manual' | 'owner' | 'auto_*' — auto-matched assets group by game in the UI"},"river_ids":{"items":{"type":"integer"},"type":"array","title":"River Ids"},"inserted_at":{"type":"string","title":"Inserted At","description":"Creation timestamp (UTC)"}},"type":"object","required":["generic_asset_id","name","river_ids","inserted_at"],"title":"GenericAssetResponse","description":"A tradeable generic asset (platform-curated or user-owned) with its member river_ids."},"GenericAssetUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"GenericAssetUpdate","description":"Request schema for updating a user-owned generic asset."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IcebergOrderParams":{"properties":{"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Direction: true=buy, false=sell"},"total_qty":{"type":"number","exclusiveMinimum":0.0,"title":"Total Qty","description":"Total iceberg quantity (across all tranches)"},"displayed_qty":{"type":"number","exclusiveMinimum":0.0,"title":"Displayed Qty","description":"Tranche size — quantity shown to the market at any moment"},"limit_price":{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0,"title":"Limit Price","description":"Static limit price for every tranche (between 0 and 1)"},"post_only":{"type":"boolean","title":"Post Only","description":"If true, every tranche is posted as post-only (maker-only)","default":false},"cancel_order_on_pause":{"type":"boolean","title":"Cancel Order On Pause","description":"Kalshi only: if true, resting tranches are cancelled by the exchange when it enters a trading pause. Ignored on other venues.","default":true},"reload_delay_s":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":0.0},{"type":"null"}],"title":"Reload Delay S","description":"Optional delay between a tranche fully filling and the next one being placed, in seconds. NULL or 0 = place next tranche immediately."},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Optional expiry timestamp in UTC (ISO 8601). When set, every tranche is submitted to the venue as GTD with this expiry; venue-side expiry of a tranche cascades to cancel the parent iceberg."}},"type":"object","required":["buy_flag","total_qty","displayed_qty","limit_price"],"title":"IcebergOrderParams","description":"Parameters for creating an iceberg complex order.\n\nAn iceberg's `total_qty` is split into sequential `displayed_qty` tranches\nposted at the same `limit_price`. When a tranche fully fills, the next is\nplaced automatically until the total is exhausted or the iceberg is cancelled."},"IcebergOrderResponse":{"properties":{"buy_flag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Buy Flag","description":"Direction"},"total_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Qty","description":"Total iceberg quantity"},"displayed_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Displayed Qty","description":"Tranche size"},"limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Price","description":"Static limit price for every tranche"},"post_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Post Only","description":"Whether tranches are posted as post-only"},"cancel_order_on_pause":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancel Order On Pause","description":"Kalshi only: whether the exchange cancels resting tranches during a trading pause"},"reload_delay_s":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":0.0},{"type":"null"}],"title":"Reload Delay S","description":"Inter-tranche reload delay in seconds, if set. NULL or 0 = place next tranche immediately."},"executed_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Executed Qty","description":"Sum of fully-executed child tranches' qty"},"remaining_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Qty","description":"total_qty - executed_qty"},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Expiry timestamp in UTC, if set. Tranches are submitted as GTD with this expiry."},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason","description":"Reason for rejection, if any"}},"type":"object","title":"IcebergOrderResponse","description":"Iceberg-specific runtime detail returned alongside a ComplexOrderResponse.\n\nSourced from `view_iceberg_orders` so it includes derived fields\n(executed_qty, remaining_qty)."},"IncludeCombos":{"type":"string","enum":["exclude","include","only"],"title":"IncludeCombos","description":"How ``/v1/markets/search`` treats Kalshi parlay containers (``is_combo``).\n\n- EXCLUDE (default): drop combos — standard markets/browse behaviour.\n- INCLUDE: return combos alongside standard markets.\n- ONLY: return combos exclusively (the Combos browse tab / parlay search)."},"InstrumentStatus":{"type":"string","enum":["active","closed","inactive"],"title":"InstrumentStatus","description":"Instrument status derived in instruments table from exchange-specific fields.\n\nKalshi: maps from kalshi_markets.status\n    - 'active' -> ACTIVE\n    - everything else (closed, determined, finalized, settled, amended, inactive, initialized) -> CLOSED\n\nPolymarket: maps from polymarket_markets.closed and polymarket_markets.active booleans\n    - closed=true -> CLOSED\n    - active=true (and not closed) -> ACTIVE\n    - else (active=false, closed=false) -> INACTIVE"},"InstrumentStatusFilter":{"type":"string","enum":["active","closed","inactive","all"],"title":"InstrumentStatusFilter","description":"``status`` query values for market search. ALL matches any status except\ninactive (never-activated exchange junk), which stays opt-in via INACTIVE."},"MarketLookupResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MarketSearchResult"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"MarketLookupResponse","description":"Schema for batch market lookup response."},"MarketMatchBatchRequest":{"properties":{"tickers":{"items":{"type":"string"},"type":"array","title":"Tickers","description":"Exact Kalshi tickers to resolve (e.g. KXNBA-26-DET)."},"slugs":{"items":{"type":"string"},"type":"array","title":"Slugs","description":"Exact Polymarket / Polymarket-US slugs to resolve (e.g. will-the-denver-nuggets-win-the-2026-nba-finals)."}},"type":"object","title":"MarketMatchBatchRequest","description":"Batch exact-match request: resolve many Kalshi tickers / Polymarket slugs at once."},"MarketMatchBatchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MarketSearchResult"},"type":"array","title":"Results"},"unmatched_tickers":{"items":{"type":"string"},"type":"array","title":"Unmatched Tickers"},"unmatched_slugs":{"items":{"type":"string"},"type":"array","title":"Unmatched Slugs"}},"type":"object","required":["results"],"title":"MarketMatchBatchResponse","description":"Batch exact-match response.\n\n``results`` holds a full market row (with ``river_id``, ``ticker``, ``slug`` and\n``exchange_name``) for every identifier that matched. Identifiers with no match are\nechoed back in ``unmatched_tickers`` / ``unmatched_slugs`` so callers can tell the\ndifference between \"not found\" and a lookup they forgot to send."},"MarketSearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"results":{"items":{"$ref":"#/components/schemas/MarketSearchResult"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"},"total_events":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Events"}},"type":"object","required":["query","results","total"],"title":"MarketSearchResponse","description":"Schema for market search response."},"MarketSearchResult":{"properties":{"river_id":{"type":"integer","title":"River Id"},"exchange_value":{"type":"integer","title":"Exchange Value"},"exchange_name":{"type":"string","title":"Exchange Name"},"ticker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ticker"},"token_id_yes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id Yes"},"token_id_no":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id No"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"tick_size_price":{"type":"number","title":"Tick Size Price"},"tick_size_qty":{"type":"number","title":"Tick Size Qty"},"tick_structure":{"type":"string","title":"Tick Structure","default":"uniform"},"minimum_order_size":{"type":"number","title":"Minimum Order Size"},"expiration_datetime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration Datetime","description":"Market expiration datetime (UTC)"},"start_datetime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Datetime","description":"Game/event start datetime (UTC). Populated for sports; null otherwise."},"neg_risk":{"type":"boolean","title":"Neg Risk"},"neg_risk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Neg Risk Id"},"condition_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition Id"},"name":{"type":"string","title":"Name"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/InstrumentStatus"},"category":{"type":"string","title":"Category","default":"Other"},"subcategory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subcategory"},"rank":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rank"},"event_ticker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Ticker"},"event_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Title"},"is_combo":{"type":"boolean","title":"Is Combo","description":"True for parlays.","default":false},"flip":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Flip","description":"Generic-asset members only: true when this member's YES side is the opposite of the asset's outcome. NULL outside basket-member contexts."},"volume":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Volume"},"volume_24h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Volume 24H"},"series_ticker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Series Ticker"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"last_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Price","description":"Most recent YES price normalized to 0.0–1.0 (probability). Kalshi cents / 100; Polymarket already 0.0–1.0. NULL when no trade has been observed."},"primary_entity_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Entity Name","description":"Resolved display name of the canonical structured-target entity (player, team, competitor, …) referenced by the market. NULL for markets without a structured target. Kalshi only — Polymarket has no equivalent concept."},"event_market_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Market Count","description":"Total number of markets in this row's event. Only populated on the event-paginated path; when markets_per_event trims an event, this is how clients know more markets exist than were returned."}},"type":"object","required":["river_id","exchange_value","exchange_name","tick_size_price","tick_size_qty","minimum_order_size","neg_risk","name","status"],"title":"MarketSearchResult","description":"Schema for a single market search result."},"OrderBatchCreate":{"properties":{"orders":{"items":{"$ref":"#/components/schemas/OrderCreate"},"type":"array","maxItems":10,"minItems":1,"title":"Orders","description":"Orders to place, all for the same subaccount. At most 10 per request."}},"type":"object","required":["orders"],"title":"OrderBatchCreate","description":"Schema for creating a batch of orders in one request."},"OrderBatchCreateResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/OrderBatchItemResult"},"type":"array","title":"Results","description":"One result per requested order, in request order"}},"type":"object","required":["results"],"title":"OrderBatchCreateResponse","description":"Schema for batch order create response."},"OrderBatchItemError":{"properties":{"code":{"type":"string","title":"Code","description":"Machine-readable error code"},"message":{"type":"string","title":"Message","description":"Human-readable rejection reason"}},"type":"object","required":["code","message"],"title":"OrderBatchItemError","description":"Rejection detail for one item of a batch."},"OrderBatchItemResult":{"properties":{"index":{"type":"integer","title":"Index","description":"Index of the order in the request list"},"river_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"River Order Id","description":"Assigned order id when the item was accepted"},"complex_orders":{"anyOf":[{"additionalProperties":{"items":{"type":"string","format":"uuid"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Complex Orders","description":"TP/SL complex order ids when the item was accepted"},"error":{"anyOf":[{"$ref":"#/components/schemas/OrderBatchItemError"},{"type":"null"}],"description":"Set when the item was rejected"}},"type":"object","required":["index"],"title":"OrderBatchItemResult","description":"Per-item result of a batch create. Exactly one of river_order_id / error is set."},"OrderCreate":{"properties":{"order_type":{"type":"string","enum":["LIMIT","MARKET","RFQ_TAKER"],"description":"Order type: 'LIMIT' or 'MARKET'"},"time_in_force":{"type":"string","enum":["FOK","GTC","GTD","IOC"],"description":"Time in force: 'FOK', 'GTC', 'GTD', or 'IOC'"},"qty":{"type":"number","exclusiveMinimum":0.0,"title":"Qty","description":"Order quantity (number of contracts)"},"price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Price","description":"Limit price between 0 and 1. Required for LIMIT orders."},"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Order direction: true=buy, false=sell"},"post_only":{"type":"boolean","title":"Post Only","description":"If true, the order is rejected instead of taking liquidity. Only valid for LIMIT orders with a resting time in force (GTC or GTD).","default":false},"cancel_order_on_pause":{"type":"boolean","title":"Cancel Order On Pause","description":"Kalshi only: if true, the resting order is cancelled by the exchange when it enters a trading pause. Ignored on other venues.","default":true},"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id","description":"Instrument ID. Mutually exclusive with generic_asset_id."},"generic_asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generic Asset Id","description":"Generic asset basket UUID. Mutually exclusive with river_id."},"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Subaccount to place the order under"},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Expiry timestamp in UTC(ISO 8601). Required for GTD orders. i.e '2023-11-07T05:31:56Z'"},"conditional_orders_params":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConditionalOrderCreate"},"type":"array"},{"type":"null"}],"title":"Conditional Orders Params","description":"Optional list of conditional orders (TP/SL) to attach to this order."},"exchanges":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exchanges","description":"Generic asset orders only: restrict routing to these exchanges (e.g. ['KALSHI', 'POLYMARKET']). Omit to route across all member venues."}},"type":"object","required":["order_type","time_in_force","qty","buy_flag","subaccount_id"],"title":"OrderCreate","description":"Schema for creating a new order."},"OrderCreateResponse":{"properties":{"river_order_id":{"type":"string","format":"uuid","title":"River Order Id","description":"Unique order identifier"},"complex_orders":{"additionalProperties":{"items":{"type":"string","format":"uuid"},"type":"array"},"type":"object","title":"Complex Orders","description":"List of complex river orders id"}},"type":"object","required":["river_order_id","complex_orders"],"title":"OrderCreateResponse","description":"Schema for order create response."},"OrderDetailResponse":{"properties":{"river_order_id":{"type":"string","format":"uuid","title":"River Order Id","description":"Unique order identifier"},"order_type":{"type":"string","title":"Order Type","description":"Order type: LIMIT or MARKET"},"time_in_force":{"type":"string","title":"Time In Force","description":"Time in force: FOK, GTC, GTD, or IOC"},"qty":{"type":"number","title":"Qty","description":"Original order quantity"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Limit price (null for market orders)"},"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Order direction: true=buy, false=sell"},"post_only":{"type":"boolean","title":"Post Only","description":"Whether the order is post-only (maker-only)","default":false},"cancel_order_on_pause":{"type":"boolean","title":"Cancel Order On Pause","description":"Kalshi only: whether the exchange cancels the resting order during a trading pause","default":true},"status":{"type":"string","title":"Status","description":"Order status. Live: PENDING_SUBMISSION, PROCESSING, RESTING. Terminal: EXECUTED, PARTIALLY_FILLED (cancelled with some fills), CANCELLED, REJECTED."},"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id","description":"Instrument ID"},"generic_asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generic Asset Id","description":"Generic asset basket UUID"},"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Subaccount the order belongs to"},"expiry_ts_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Expiry timestamp in UTC for GTD orders"},"created_at":{"type":"string","title":"Created At","description":"Order creation timestamp (UTC)"},"updated_at":{"type":"string","title":"Updated At","description":"Last update timestamp (UTC)"},"traded_qty":{"type":"number","title":"Traded Qty","description":"Total quantity filled","default":0.0},"average_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Price","description":"Volume-weighted average fill price"},"fees_paid":{"type":"number","title":"Fees Paid","description":"Total fees paid across all fills","default":0.0},"complex_order_ids":{"additionalProperties":{"items":{"type":"string","format":"uuid"},"type":"array"},"type":"object","title":"Complex Order Ids","description":"List of complex river orders id"},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason","description":"Reason for rejection (if status is REJECTED)"},"parent_iceberg_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Iceberg Order Id","description":"If this order is a tranche of an iceberg parent, the parent's id; otherwise null."},"parent_peg_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Peg Order Id","description":"If this order is the resting child of a peg parent, the parent's id; otherwise null."},"parent_smart_taker_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Smart Taker Order Id","description":"If this order is an IOC child of a smart-taker parent, the parent's id; otherwise null."},"fills":{"items":{"$ref":"#/components/schemas/OrderFillResponse"},"type":"array","title":"Fills","description":"List of executions (fills) for this order","default":[]}},"type":"object","required":["river_order_id","order_type","time_in_force","qty","buy_flag","status","subaccount_id","created_at","updated_at","complex_order_ids"],"title":"OrderDetailResponse","description":"Schema for order detail response including fills."},"OrderEditRequest":{"properties":{"qty":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Qty","description":"New total order quantity"},"price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Price","description":"New limit price (between 0 and 1)"}},"type":"object","title":"OrderEditRequest","description":"Schema for editing (amending) an existing simple limit order.\n\n`qty` is the TOTAL order quantity (not remaining) — matches Kalshi's amend semantics.\nAt least one of `qty` or `price` must be provided."},"OrderEditResponse":{"properties":{"river_order_id":{"type":"string","format":"uuid","title":"River Order Id","description":"Unique order identifier"},"status":{"type":"string","title":"Status","description":"Always PENDING_AMEND. Final status (RESTING on success, REJECTED on failure) is delivered via the orders WS."}},"type":"object","required":["river_order_id","status"],"title":"OrderEditResponse","description":"Schema for order edit response."},"OrderFillResponse":{"properties":{"river_id":{"type":"integer","title":"River Id","description":"Instrument ID"},"exchange_order_id":{"type":"string","title":"Exchange Order Id","description":"Exchange-assigned order ID"},"exchange_trade_id":{"type":"string","title":"Exchange Trade Id","description":"Exchange-assigned trade/fill ID"},"exchange_timestamp":{"type":"string","title":"Exchange Timestamp","description":"Execution timestamp from exchange (UTC)"},"price":{"type":"number","title":"Price","description":"Execution price"},"qty":{"type":"number","title":"Qty","description":"Filled quantity"},"fee":{"type":"number","title":"Fee","description":"Fee charged by the exchange for this fill"},"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Fill direction: true=buy, false=sell"},"is_maker":{"type":"boolean","title":"Is Maker","description":"Whether this fill provided liquidity (maker) or took it (taker)"}},"type":"object","required":["river_id","exchange_order_id","exchange_trade_id","exchange_timestamp","price","qty","fee","buy_flag","is_maker"],"title":"OrderFillResponse","description":"Schema for a single fill on an order."},"OrderListResponse":{"properties":{"orders":{"items":{"$ref":"#/components/schemas/OrderResponse"},"type":"array","title":"Orders","description":"List of orders matching the query"},"has_more":{"type":"boolean","title":"Has More","description":"True when more orders exist past this page"}},"type":"object","required":["orders","has_more"],"title":"OrderListResponse","description":"Schema for list of orders."},"OrderQueuePositionResponse":{"properties":{"river_order_id":{"type":"string","format":"uuid","title":"River Order Id","description":"River order identifier"},"exchange_order_id":{"type":"string","title":"Exchange Order Id","description":"Exchange order ID with the best (minimum) queue priority"},"queue_position":{"type":"number","title":"Queue Position","description":"Number of preceding shares in the queue ahead of this order (lower is better priority)"}},"type":"object","required":["river_order_id","exchange_order_id","queue_position"],"title":"OrderQueuePositionResponse","description":"Schema for the queue-position response of an order."},"OrderResponse":{"properties":{"river_order_id":{"type":"string","format":"uuid","title":"River Order Id","description":"Unique order identifier"},"order_type":{"type":"string","title":"Order Type","description":"Order type: LIMIT or MARKET"},"time_in_force":{"type":"string","title":"Time In Force","description":"Time in force: FOK, GTC, GTD, or IOC"},"qty":{"type":"number","title":"Qty","description":"Original order quantity"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Limit price (null for market orders)"},"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Order direction: true=buy, false=sell"},"post_only":{"type":"boolean","title":"Post Only","description":"Whether the order is post-only (maker-only)","default":false},"cancel_order_on_pause":{"type":"boolean","title":"Cancel Order On Pause","description":"Kalshi only: whether the exchange cancels the resting order during a trading pause","default":true},"status":{"type":"string","title":"Status","description":"Order status. Live: PENDING_SUBMISSION, PROCESSING, RESTING. Terminal: EXECUTED, PARTIALLY_FILLED (cancelled with some fills), CANCELLED, REJECTED."},"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id","description":"Instrument ID"},"generic_asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generic Asset Id","description":"Generic asset basket UUID"},"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Subaccount the order belongs to"},"expiry_ts_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Expiry timestamp in UTC for GTD orders"},"created_at":{"type":"string","title":"Created At","description":"Order creation timestamp (UTC)"},"updated_at":{"type":"string","title":"Updated At","description":"Last update timestamp (UTC)"},"traded_qty":{"type":"number","title":"Traded Qty","description":"Total quantity filled","default":0.0},"average_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Price","description":"Volume-weighted average fill price"},"fees_paid":{"type":"number","title":"Fees Paid","description":"Total fees paid across all fills","default":0.0},"complex_order_ids":{"additionalProperties":{"items":{"type":"string","format":"uuid"},"type":"array"},"type":"object","title":"Complex Order Ids","description":"List of complex river orders id"},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason","description":"Reason for rejection (if status is REJECTED)"},"parent_iceberg_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Iceberg Order Id","description":"If this order is a tranche of an iceberg parent, the parent's id; otherwise null."},"parent_peg_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Peg Order Id","description":"If this order is the resting child of a peg parent, the parent's id; otherwise null."},"parent_smart_taker_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Smart Taker Order Id","description":"If this order is an IOC child of a smart-taker parent, the parent's id; otherwise null."}},"type":"object","required":["river_order_id","order_type","time_in_force","qty","buy_flag","status","subaccount_id","created_at","updated_at","complex_order_ids"],"title":"OrderResponse","description":"Schema for order response, when user request information about an order."},"OrderTimeInForce":{"type":"integer","enum":[1,2,3,4],"title":"OrderTimeInForce","description":"Time-in-force setting. Can be FOK (Fill or kill), GTC (Good till cancelled) or GTD (Good till date)."},"OrderType":{"type":"integer","enum":[1,2,3],"title":"OrderType"},"OrderbookData":{"properties":{"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id"},"generic_asset_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Generic Asset Id"},"bids":{"items":{"$ref":"#/components/schemas/PriceLevelResponse"},"type":"array","title":"Bids"},"asks":{"items":{"$ref":"#/components/schemas/PriceLevelResponse"},"type":"array","title":"Asks"},"best_bid_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Bid Price"},"best_ask_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Ask Price"},"exchange_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Exchange Timestamp","description":"Exchange orderbook timestamp (UTC)"}},"type":"object","required":["bids","asks"],"title":"OrderbookData"},"OrderbookResponse":{"properties":{"status":{"$ref":"#/components/schemas/OrderbookStatus"},"orderbook":{"anyOf":[{"$ref":"#/components/schemas/OrderbookData"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["status"],"title":"OrderbookResponse"},"OrderbookStatus":{"type":"string","enum":["ok","pending","not_found"],"title":"OrderbookStatus"},"PegOrderParams":{"properties":{"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Direction: true=buy, false=sell"},"total_qty":{"type":"number","exclusiveMinimum":0.0,"title":"Total Qty","description":"Total peg quantity"},"min_price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Min Price","description":"Price floor — the child never rests below this (between 0 and 1)"},"max_price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Price","description":"Price ceiling — the child never rests above this (between 0 and 1)"},"post_only":{"type":"boolean","title":"Post Only","description":"If true, the resting child order is posted as post-only; a repeg that would cross the book cancels the peg instead of taking liquidity","default":false},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Optional expiry timestamp in UTC (ISO 8601). When set, the resting child is submitted to the venue as GTD with this expiry; venue-side expiry cancels the peg (caught by the periodic reconciliation sweep)."},"peg_min_stay_time_s":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":0.0},{"type":"null"}],"title":"Peg Min Stay Time S","description":"Optional repeg gate. When set, a price-driven repeg is suppressed until the resting child has been on the book for at least this many seconds (measured from send time). Expiry-driven cancels are unaffected."},"max_qty_level":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Qty Level","description":"Penny-jump threshold (contracts). If the level the peg would join holds more than this many contracts, rest one tick tighter instead (if not crossing the book and not already quoting the level). Unset to disable."}},"type":"object","required":["buy_flag","total_qty"],"title":"PegOrderParams","description":"Parameters for creating a peg complex order.\n\nA peg's child limit order rests on the venue at the current best bid (for buys)\nor best ask (for sells), clamped to the absolute band [min_price, max_price]:\nthe child never rests below min_price or above max_price. Both bounds are\noptional — an unset min floors at 0, an unset max ceils at 1. The peg worker\nrepegs the child as the top of book moves."},"PegOrderResponse":{"properties":{"buy_flag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Buy Flag","description":"Direction"},"total_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Qty","description":"Total peg quantity"},"min_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Price","description":"Price floor — the child never rests below this"},"max_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Price","description":"Price ceiling — the child never rests above this"},"post_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Post Only","description":"Whether the resting child order is post-only"},"executed_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Executed Qty","description":"Sum of filled child qty"},"remaining_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Qty","description":"total_qty - executed_qty"},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Expiry timestamp in UTC, if set. The child is submitted as GTD with this expiry."},"peg_min_stay_time_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Peg Min Stay Time S","description":"Minimum seconds a resting child must stay on the book before a price-driven repeg is allowed, if set."},"max_qty_level":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Qty Level","description":"Penny-jump threshold (contracts): levels larger than this are stepped past, one tick inside the spread."},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason","description":"Reason for rejection, if any"}},"type":"object","title":"PegOrderResponse","description":"Peg-specific runtime detail returned alongside a ComplexOrderResponse.\n\nSourced from `view_peg_orders` so it includes derived fields\n(executed_qty, remaining_qty)."},"PositionResponse":{"properties":{"river_id":{"type":"integer","title":"River Id"},"position":{"type":"number","title":"Position"},"avg_buy_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Buy Price"},"avg_sell_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Sell Price"},"total_fees":{"type":"number","title":"Total Fees"},"total_qty_bought":{"type":"number","title":"Total Qty Bought"},"total_qty_sold":{"type":"number","title":"Total Qty Sold"},"fill_count":{"type":"integer","title":"Fill Count"},"first_fill_at":{"type":"string","title":"First Fill At"},"last_fill_at":{"type":"string","title":"Last Fill At"},"exchange_name":{"type":"string","title":"Exchange Name"},"exchange_ticker":{"type":"string","title":"Exchange Ticker"}},"type":"object","required":["river_id","position","total_fees","total_qty_bought","total_qty_sold","fill_count","first_fill_at","last_fill_at","exchange_name","exchange_ticker"],"title":"PositionResponse","description":"Schema for a position (computed from cumulative fills)."},"PriceCandlestick":{"properties":{"timestamp":{"type":"integer","title":"Timestamp"},"open":{"type":"number","title":"Open"},"high":{"type":"number","title":"High"},"low":{"type":"number","title":"Low"},"close":{"type":"number","title":"Close"},"volume":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Volume"}},"type":"object","required":["timestamp","open","high","low","close"],"title":"PriceCandlestick","description":"Candlestick format for all exchanges."},"PriceLevelResponse":{"properties":{"price":{"type":"number","title":"Price"},"qty":{"type":"number","title":"Qty"},"breakdown":{"additionalProperties":{"type":"number"},"type":"object","title":"Breakdown"}},"type":"object","required":["price","qty"],"title":"PriceLevelResponse"},"PricePoint":{"properties":{"timestamp":{"type":"integer","title":"Timestamp"},"price":{"type":"number","title":"Price"}},"type":"object","required":["timestamp","price"],"title":"PricePoint","description":"Simple price point for history type."},"PriceResponse":{"properties":{"river_id":{"type":"integer","title":"River Id"},"exchange":{"type":"string","title":"Exchange"},"type":{"type":"string","enum":["candlesticks","history"],"title":"Type"},"has_ohlc":{"type":"boolean","title":"Has Ohlc","default":false},"candlesticks":{"anyOf":[{"items":{"$ref":"#/components/schemas/PriceCandlestick"},"type":"array"},{"type":"null"}],"title":"Candlesticks"},"history":{"anyOf":[{"items":{"$ref":"#/components/schemas/PricePoint"},"type":"array"},{"type":"null"}],"title":"History"}},"type":"object","required":["river_id","exchange","type"],"title":"PriceResponse","description":"Response for price queries."},"ResolveCombosRequest":{"properties":{"river_ids":{"items":{"type":"integer"},"type":"array","maxItems":200,"title":"River Ids","description":"Combo river_ids to resolve."}},"type":"object","required":["river_ids"],"title":"ResolveCombosRequest","description":"Resolve Kalshi combo markets into their constituent legs."},"ResolveCombosResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/ResolveCombosResult"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"ResolveCombosResponse","description":"``legs`` is empty for river_ids that are not combos or whose legs are not ingested yet."},"ResolveCombosResult":{"properties":{"river_id":{"type":"integer","title":"River Id"},"legs":{"items":{"$ref":"#/components/schemas/ComboLeg"},"type":"array","title":"Legs"}},"type":"object","required":["river_id","legs"],"title":"ResolveCombosResult"},"ShardTransferRequest":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id","description":"Non-custodial subaccount whose funds move between shards"},"source_exchange_shard":{"type":"integer","minimum":0.0,"title":"Source Exchange Shard","description":"Shard to move funds from"},"destination_exchange_shard":{"type":"integer","minimum":0.0,"title":"Destination Exchange Shard","description":"Shard to move funds to"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount","description":"Transfer amount in USD"}},"type":"object","required":["subaccount_id","source_exchange_shard","destination_exchange_shard","amount"],"title":"ShardTransferRequest"},"ShardTransferResponse":{"properties":{"transfer_id":{"type":"string","title":"Transfer Id"}},"type":"object","required":["transfer_id"],"title":"ShardTransferResponse"},"SmartTakerOrderParams":{"properties":{"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Direction: true=buy, false=sell"},"total_qty":{"type":"number","exclusiveMinimum":0.0,"title":"Total Qty","description":"Total quantity to acquire/offload across all IOC clips"},"limit_price":{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0,"title":"Limit Price","description":"Worst price the taker will accept — max for buy, min for sell (between 0 and 1)"},"min_qty":{"type":"number","exclusiveMinimum":0.0,"title":"Min Qty","description":"Book-depth trigger gate: only fire when at least this much acceptable liquidity sits within limit_price on the opposite side. A depth floor, not a per-clip fill floor — it may exceed total_qty (e.g. 'take my 100 only when >=500 is resting') and an IOC may fill less if liquidity vanishes mid-flight."},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Optional expiry timestamp in UTC (ISO 8601). Once it passes, the order stops firing and is torn down by the periodic reconciliation sweep."}},"type":"object","required":["buy_flag","total_qty","limit_price","min_qty"],"title":"SmartTakerOrderParams","description":"Parameters for creating a smart-taker complex order.\n\nA smart-taker rests nothing on the book. It watches the opposite side and\nfires an IOC sweep (at `limit_price`, for the full remaining qty) whenever at\nleast `min_qty` of acceptable liquidity (price within `limit_price`) is\nresting on the book — amortising taker fee/spread and refusing to cross into\na thin book."},"SmartTakerOrderResponse":{"properties":{"buy_flag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Buy Flag","description":"Direction"},"total_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Qty","description":"Total quantity across all IOC clips"},"limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Price","description":"Worst price the taker will accept"},"min_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Qty","description":"Book-depth trigger gate (min acceptable liquidity resting before firing)"},"executed_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Executed Qty","description":"Sum of filled child qty"},"remaining_qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Qty","description":"total_qty - executed_qty"},"expiry_ts_utc":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expiry Ts Utc","description":"Expiry timestamp in UTC, if set."},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason","description":"Reason for rejection, if any"}},"type":"object","title":"SmartTakerOrderResponse","description":"Smart-taker-specific runtime detail returned alongside a ComplexOrderResponse.\n\nSourced from `view_smart_taker_orders` so it includes derived fields\n(executed_qty, remaining_qty)."},"SubaccountCreate":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"SubaccountCreate","description":"Schema for creating a new subaccount. account_type is pinned to\nnon_custodial server-side and no longer accepted from the client."},"SubaccountGrantPutRequest":{"properties":{"role":{"type":"string","enum":["admin","trader","viewer"],"title":"Role"}},"type":"object","required":["role"],"title":"SubaccountGrantPutRequest"},"SubaccountGrantPutResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"role":{"type":"string","title":"Role"}},"type":"object","required":["user_id","permissions","role"],"title":"SubaccountGrantPutResponse"},"SubaccountGrantResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"role":{"type":"string","title":"Role"},"derived":{"type":"boolean","title":"Derived"},"invited_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Invited By"}},"type":"object","required":["user_id","permissions","role","derived"],"title":"SubaccountGrantResponse"},"SubaccountResponse":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"org_id":{"type":"string","format":"uuid","title":"Org Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"account_type":{"$ref":"#/components/schemas/AccountType"},"is_active":{"type":"boolean","title":"Is Active"},"inserted_at":{"type":"string","title":"Inserted At"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"role":{"type":"string","title":"Role"}},"type":"object","required":["subaccount_id","org_id","name","account_type","is_active","inserted_at","permissions","role"],"title":"SubaccountResponse","description":"Schema for subaccount response."},"SubaccountUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"}},"type":"object","title":"SubaccountUpdate","description":"Schema for updating a subaccount."},"TradeprintEvent":{"properties":{"exchange_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Exchange Timestamp","description":"Exchange-reported trade timestamp (UTC)"},"price":{"type":"number","title":"Price"},"qty":{"type":"number","title":"Qty"},"aggressor_buy_flag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Aggressor Buy Flag"},"exchange_trade_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exchange Trade Id","description":"Exchange-assigned trade id. Used by clients to dedup overlap between REST backfill and WS live stream."}},"type":"object","required":["price","qty"],"title":"TradeprintEvent","description":"A single trade print.\n\n`aggressor_buy_flag` is true when the aggressing (taker) side bought —\ni.e. the trade hit an ask. The frontend renders side color and \"Buy/Sell\"\nfrom this flag."},"TradeprintsBulkResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/TradeprintsResponse"},"type":"array","title":"Results"}},"type":"object","title":"TradeprintsBulkResponse","description":"Response for `GET /v1/tradeprints?river_ids=...`.\n\n`results` preserves the order of the requested `river_ids`. Partial failures\nare surfaced per-row (status `not_found`) with a `message` — a bad river_id\nor upstream error never aborts the whole call."},"TradeprintsResponse":{"properties":{"status":{"$ref":"#/components/schemas/TradeprintsStatus"},"river_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"River Id"},"trades":{"items":{"$ref":"#/components/schemas/TradeprintEvent"},"type":"array","title":"Trades"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["status"],"title":"TradeprintsResponse","description":"Per-market block of recent trades from the exchange."},"TradeprintsStatus":{"type":"string","enum":["ok","pending","not_found"],"title":"TradeprintsStatus"},"TriggerOrder":{"properties":{"order_type":{"type":"string","enum":["LIMIT","MARKET","RFQ_TAKER"],"description":"Order type for the triggered order: 'LIMIT' or 'MARKET'"},"qty":{"type":"number","exclusiveMinimum":0.0,"title":"Qty","description":"Quantity (number of contracts) for the triggered order"},"price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Price","description":"Limit price for the triggered order (between 0 and 1). Required when order_type is LIMIT."},"buy_flag":{"type":"boolean","title":"Buy Flag","description":"Direction of the triggered order: true=buy, false=sell"},"stop_order_price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Stop Order Price","description":"Price at which the triggered order activates as a stop or reverse stop. Required for SL (stop trigger) and TP MARKET (reverse stop trigger). For SL: triggers when price moves against you. For TP MARKET: triggers when price moves in your favor."}},"type":"object","required":["order_type","qty","buy_flag"],"title":"TriggerOrder","description":"The order that will be sent to the exchange when the conditional order's condition is met.\n\nFor TP/SL: the parent order fills → the conditional activates → this trigger order is placed.\nFor STOP/REVERSE_STOP: the stop_order_price is reached → this trigger order is placed."},"UserFillListResponse":{"properties":{"subaccount_to_fills":{"items":{"additionalProperties":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/FillResponse"},"type":"array"}]},"type":"object"},"type":"array","title":"Subaccount To Fills"}},"type":"object","required":["subaccount_to_fills"],"title":"UserFillListResponse","description":"Schema for list of fills for a user."},"UserPositionListResponse":{"properties":{"subaccount_to_positions":{"items":{"additionalProperties":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/PositionResponse"},"type":"array"}]},"type":"object"},"type":"array","title":"Subaccount To Positions"}},"type":"object","required":["subaccount_to_positions"],"title":"UserPositionListResponse","description":"Positions grouped by subaccount."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VolumeResponse":{"properties":{"river_id":{"type":"integer","title":"River Id"},"window":{"type":"string","enum":["15m","1h","24h"],"title":"Window"},"volume":{"type":"number","title":"Volume"},"as_of":{"type":"integer","title":"As Of"}},"type":"object","required":["river_id","window","volume","as_of"],"title":"VolumeResponse","description":"Traded volume over a recent window, summed from captured trade prints."},"WatchlistCreate":{"properties":{"subaccount_id":{"type":"string","format":"uuid","title":"Subaccount Id"},"name":{"type":"string","maxLength":255,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"river_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"River Ids"}},"type":"object","required":["subaccount_id","name"],"title":"WatchlistCreate","description":"Request schema for creating a new watchlist."},"WatchlistDetailResponse":{"properties":{"watchlist_id":{"type":"string","format":"uuid","title":"Watchlist Id"},"owner_subaccount_id":{"type":"string","format":"uuid","title":"Owner Subaccount Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"river_ids":{"items":{"type":"integer"},"type":"array","title":"River Ids"},"members":{"items":{"$ref":"#/components/schemas/MarketSearchResult"},"type":"array","title":"Members"},"created_at":{"type":"string","title":"Created At","description":"Creation timestamp (UTC)"}},"type":"object","required":["watchlist_id","owner_subaccount_id","name","river_ids","members","created_at"],"title":"WatchlistDetailResponse","description":"Response schema for a watchlist with its resolved members (detail view).\n\n``members`` are ordered by ``position``; ``river_ids`` is the same ordering\nas a convenience for handing straight to the multibook handoff."},"WatchlistListResponse":{"properties":{"watchlists":{"items":{"$ref":"#/components/schemas/WatchlistResponse"},"type":"array","title":"Watchlists"}},"type":"object","required":["watchlists"],"title":"WatchlistListResponse"},"WatchlistMemberAdd":{"properties":{"river_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"River Ids"}},"type":"object","required":["river_ids"],"title":"WatchlistMemberAdd","description":"Request schema for adding members to a watchlist (appended at the end)."},"WatchlistMemberReorder":{"properties":{"river_ids":{"items":{"type":"integer"},"type":"array","minItems":1,"title":"River Ids"}},"type":"object","required":["river_ids"],"title":"WatchlistMemberReorder","description":"Request schema for reordering a watchlist.\n\nThe body is the full ordered list of ``river_id``s; the server rewrites\n``position`` to match. Sending the whole array avoids partial-reorder races\nand keeps it to one round-trip."},"WatchlistResponse":{"properties":{"watchlist_id":{"type":"string","title":"Watchlist Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"owner_subaccount_id":{"type":"string","title":"Owner Subaccount Id"},"river_ids":{"items":{"type":"integer"},"type":"array","title":"River Ids"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["watchlist_id","name","owner_subaccount_id","river_ids","created_at"],"title":"WatchlistResponse","description":"A watchlist summary (list view): metadata + ordered member river_ids."},"WatchlistUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"WatchlistUpdate","description":"Request schema for renaming / editing a watchlist."}}},"tags":[{"name":"markets","description":"Search and discover prediction markets across Kalshi and Polymarket."},{"name":"fees","description":"Retrieve exchange fee schedules for local pre-trade calculations."},{"name":"subaccounts","description":"Manage trading subaccounts. Each subaccount can have its own exchange credentials and positions."},{"name":"positions","description":"View current portfolio positions across all connected exchanges."},{"name":"fills","description":"Retrieve trade execution history and fill details."},{"name":"prices","description":"Get historical price data and candlesticks from exchanges."},{"name":"tradeprints","description":"Recent trades for a market. Pairs with the /v1/ws/tradeprints WebSocket for live updates."},{"name":"orders","description":"Place and manage orders on prediction market exchanges."},{"name":"complex-orders","description":"Manage complex orders: conditional orders (take-profit and stop-loss), TWAP, and other advanced order types."}]}