{"asyncapi":"3.0.0","info":{"title":"CantonCap Streaming API","version":"1.0.0","description":"Contract for authenticated CantonCap market-data streams. Channel addresses are subscription topics carried over the WebSocket endpoint. A channel is resumable only when its operation explicitly declares a retained policy."},"defaultContentType":"application/json","servers":{"production":{"host":"api.cantoncap.cc","pathname":"/v1/stream","protocol":"wss","description":"Production WebSocket endpoint.","security":[{"$ref":"#/components/securitySchemes/apiKey"}]},"local":{"host":"localhost:3002","pathname":"/v1/stream","protocol":"ws","description":"Local development streaming server.","security":[{"$ref":"#/components/securitySchemes/apiKey"}]}},"channels":{"control":{"address":"control","description":"Connection-local subscription commands, acknowledgements, heartbeats, and typed terminal errors. These frames use the same WebSocket session as the data channels and are not broker topics.","messages":{"subscribeRequestV1":{"$ref":"#/components/messages/SubscribeRequestV1"},"unsubscribeRequest":{"$ref":"#/components/messages/UnsubscribeRequest"},"subscribed":{"$ref":"#/components/messages/Subscribed"},"unsubscribed":{"$ref":"#/components/messages/Unsubscribed"},"heartbeat":{"$ref":"#/components/messages/Heartbeat"},"streamError":{"$ref":"#/components/messages/StreamError"}}},"ticker":{"address":"ticker:{market_id}","description":"Latest normalized ticker observations for one canonical market.","parameters":{"market_id":{"$ref":"#/components/parameters/marketId"}},"messages":{"tickerEventFrame":{"$ref":"#/components/messages/TickerEventFrame"}}},"assetQuote":{"address":"asset_quote:{asset_id}","description":"Aggregate quotes and calculated fields for one stable asset ID.","parameters":{"asset_id":{"$ref":"#/components/parameters/assetId"}},"messages":{"assetQuoteEventFrameV1":{"$ref":"#/components/messages/AssetQuoteEventFrameV1"}}},"trades":{"address":"trades:{market_id}","description":"Approved public canonical trades for one market.","parameters":{"market_id":{"$ref":"#/components/parameters/marketId"}},"messages":{"tradeEventFrame":{"$ref":"#/components/messages/TradeEventFrame"}}},"orderbook":{"address":"orderbook:{market_id}","description":"Full snapshots and resynchronization notices for one market. The data model also supports absolute updates; current sources deliver full resnapshots. A market with no book snapshot observed in the last 29 days has no current book and the subscription is refused with not_found.","parameters":{"market_id":{"$ref":"#/components/parameters/marketId"}},"messages":{"orderBookEventFrame":{"$ref":"#/components/messages/OrderBookEventFrame"}}},"candles":{"address":"candles:{market_id}:{interval}","description":"Full candle replacements keyed by market, interval and open_time. Polls reconcile the current UTC period and the previous two periods; closing updates and recent corrections can follow newer periods. Intermediate revisions can coalesce and older corrections require REST. Empty periods are omitted. Boundaries are start-inclusive and end-exclusive. complete means the period has ended, not that corrections are impossible.","parameters":{"market_id":{"$ref":"#/components/parameters/marketId"},"interval":{"$ref":"#/components/parameters/interval"}},"messages":{"candleEventFrameV1":{"$ref":"#/components/messages/CandleEventFrameV1"}}},"sourceStatus":{"address":"source_status:{venue_id}","description":"Operational feed availability, independent of age-only classifications. last_updated_at is the last market-data measurement time.","parameters":{"venue_id":{"$ref":"#/components/parameters/venueId"}},"messages":{"sourceStatusEventFrame":{"$ref":"#/components/messages/SourceStatusEventFrame"}}}},"operations":{"sendStreamCommand":{"action":"send","channel":{"$ref":"#/channels/control"},"summary":"Subscribe to or cancel a connection-local channel.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/control/messages/subscribeRequestV1"},{"$ref":"#/channels/control/messages/unsubscribeRequest"}]},"receiveStreamControl":{"action":"receive","channel":{"$ref":"#/channels/control"},"summary":"Receive subscription acknowledgements, heartbeats, and typed errors.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/control/messages/subscribed"},{"$ref":"#/channels/control/messages/unsubscribed"},{"$ref":"#/channels/control/messages/heartbeat"},{"$ref":"#/channels/control/messages/streamError"}]},"receiveTicker":{"action":"receive","channel":{"$ref":"#/channels/ticker"},"summary":"Receive ticker observations.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/ticker/messages/tickerEventFrame"}],"x-cantoncap-authorization":{"visibility":"approved_public","required_scope":"stream:ticker"},"x-cantoncap-resumability":{"mode":"from_event_id","retention":"PT15M"}},"receiveAssetQuote":{"action":"receive","channel":{"$ref":"#/channels/assetQuote"},"summary":"Receive aggregate asset quotes.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/assetQuote/messages/assetQuoteEventFrameV1"}],"x-cantoncap-authorization":{"visibility":"approved_public","required_scope":"stream:asset_quote"},"x-cantoncap-resumability":{"mode":"from_event_id","retention":"PT15M"}},"receiveTrades":{"action":"receive","channel":{"$ref":"#/channels/trades"},"summary":"Receive authorized canonical trades.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/trades/messages/tradeEventFrame"}],"x-cantoncap-authorization":{"visibility":"approved_public","required_scope":"stream:trades"},"x-cantoncap-resumability":{"mode":"from_event_id","retention":"P1D"}},"receiveOrderBook":{"action":"receive","channel":{"$ref":"#/channels/orderbook"},"summary":"Receive full book snapshots and resynchronization notices.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/orderbook/messages/orderBookEventFrame"}],"x-cantoncap-authorization":{"visibility":"approved_public","required_scope":"stream:orderbook"},"x-cantoncap-resumability":{"mode":"snapshot_then_sequence","retention":null}},"receiveCandles":{"action":"receive","channel":{"$ref":"#/channels/candles"},"summary":"Receive candle observations.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/candles/messages/candleEventFrameV1"}],"x-cantoncap-authorization":{"visibility":"approved_public","required_scope":"stream:candles"},"x-cantoncap-resumability":{"mode":"from_event_id","retention":"P7D"}},"receiveSourceStatus":{"action":"receive","channel":{"$ref":"#/channels/sourceStatus"},"summary":"Receive connector source-status changes.","security":[{"$ref":"#/components/securitySchemes/apiKey"}],"messages":[{"$ref":"#/channels/sourceStatus/messages/sourceStatusEventFrame"}],"x-cantoncap-authorization":{"visibility":"approved_public","required_scope":"stream:source_status"},"x-cantoncap-resumability":{"mode":"latest_only","retention":null}}},"components":{"securitySchemes":{"apiKey":{"type":"httpApiKey","name":"X-API-Key","in":"header","description":"CantonCap API key. Entitlements filter every subscription."}},"parameters":{"marketId":{"description":"Stable opaque CantonCap market ID."},"assetId":{"description":"Stable opaque CantonCap asset ID."},"venueId":{"description":"Stable CantonCap venue ID."},"interval":{"description":"Candle interval such as 1m, 5m, 1h, or 1d."}},"correlationIds":{"frameEventId":{"description":"Stable event identifier inside an encoded subscription frame.","location":"$message.payload#/event_id"}},"messages":{"SubscribeRequestV1":{"name":"subscribe_request_v1","title":"Versioned market-data subscribe request","payload":{"$ref":"#/components/schemas/SubscribeRequestV1"}},"UnsubscribeRequest":{"name":"unsubscribe_request","title":"Unsubscribe request","payload":{"$ref":"#/components/schemas/UnsubscribeRequest"}},"Subscribed":{"name":"subscribed","title":"Subscription acknowledgement","payload":{"$ref":"#/components/schemas/Subscribed"}},"Unsubscribed":{"name":"unsubscribed","title":"Cancellation acknowledgement","payload":{"$ref":"#/components/schemas/Unsubscribed"}},"Heartbeat":{"name":"heartbeat","title":"Application heartbeat","payload":{"$ref":"#/components/schemas/Heartbeat"}},"StreamError":{"name":"stream_error","title":"Typed stream error","payload":{"$ref":"#/components/schemas/StreamError"}},"TickerEventFrame":{"name":"ticker_event_frame","title":"Encoded ticker subscription frame","correlationId":{"$ref":"#/components/correlationIds/frameEventId"},"payload":{"$ref":"#/components/schemas/TickerEventMessage"}},"AssetQuoteEventFrameV1":{"name":"asset_quote_event_frame_v1","title":"Exact v1 asset-quote subscription frame","correlationId":{"$ref":"#/components/correlationIds/frameEventId"},"payload":{"$ref":"#/components/schemas/AssetQuoteEventMessageV1"}},"TradeEventFrame":{"name":"trade_event_frame","title":"Encoded trade subscription frame","correlationId":{"$ref":"#/components/correlationIds/frameEventId"},"payload":{"$ref":"#/components/schemas/TradeEventMessage"}},"OrderBookEventFrame":{"name":"orderbook_event_frame","title":"Encoded order-book subscription frame","correlationId":{"$ref":"#/components/correlationIds/frameEventId"},"payload":{"$ref":"#/components/schemas/OrderBookEventMessage"}},"CandleEventFrameV1":{"name":"candle_event_frame_v1","title":"Exact v1 candle subscription frame","correlationId":{"$ref":"#/components/correlationIds/frameEventId"},"payload":{"$ref":"#/components/schemas/CandleEventMessageV1"}},"SourceStatusEventFrame":{"name":"source_status_event_frame","title":"Encoded source-status subscription frame","correlationId":{"$ref":"#/components/correlationIds/frameEventId"},"payload":{"$ref":"#/components/schemas/SourceStatusEventMessage"}}},"schemas":{"TickerEventMessage":{"allOf":[{"$ref":"#/components/schemas/WireTickerEvent"},{"type":"object","required":["type","subscription_id","channel"],"properties":{"type":{"type":"string","const":"event"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^ticker:mkt_[A-Za-z0-9_-]+$"}}}]},"AssetQuoteEventMessageV1":{"allOf":[{"$ref":"#/components/schemas/WireAssetQuoteEventV1"},{"type":"object","required":["type","subscription_id","channel"],"properties":{"type":{"type":"string","const":"event"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^asset_quote:ast_[A-Za-z0-9_-]+$"}}}]},"TradeEventMessage":{"allOf":[{"$ref":"#/components/schemas/WireTradeEvent"},{"type":"object","required":["type","subscription_id","channel"],"properties":{"type":{"type":"string","const":"event"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^trades:mkt_[A-Za-z0-9_-]+$"}}}]},"OrderBookEventMessage":{"allOf":[{"$ref":"#/components/schemas/WireOrderBookEvent"},{"type":"object","required":["type","subscription_id","channel"],"properties":{"type":{"type":"string","const":"event"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^orderbook:mkt_[A-Za-z0-9_-]+$"}}}]},"CandleEventMessageV1":{"allOf":[{"$ref":"#/components/schemas/WireCandleEventV1"},{"type":"object","required":["type","subscription_id","channel"],"properties":{"type":{"type":"string","const":"event"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^candles:mkt_[A-Za-z0-9_-]+:(?:1m|5m|10m|15m|30m|1h|4h|1d|7d|1w)$"}}}]},"SourceStatusEventMessage":{"allOf":[{"$ref":"#/components/schemas/WireSourceStatusEvent"},{"type":"object","required":["type","subscription_id","channel"],"properties":{"type":{"type":"string","const":"event"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^source_status:[A-Za-z0-9_-]{1,128}$"}}}]},"SubscribeRequestV1":{"type":"object","additionalProperties":false,"required":["type","request_id","channel"],"properties":{"type":{"type":"string","const":"subscribe"},"request_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string","pattern":"^(?:ticker:mkt_[A-Za-z0-9_-]+|asset_quote:ast_[A-Za-z0-9_-]+|trades:mkt_[A-Za-z0-9_-]+|orderbook:mkt_[A-Za-z0-9_-]+|candles:mkt_[A-Za-z0-9_-]+:(?:1m|5m|10m|15m|30m|1h|4h|1d|7d|1w)|source_status:[A-Za-z0-9_-]{1,128})$"},"resume_from_event_id":{"type":["string","null"],"pattern":"^evt_[A-Za-z0-9_-]{1,128}$","description":"Last received event ID for this channel. Replay is best effort, bounded by age/capacity and lost on restart. An unavailable token returns resume_unavailable. Order books and source status reject non-null tokens.","default":null}}},"UnsubscribeRequest":{"type":"object","additionalProperties":false,"required":["type","request_id","subscription_id"],"properties":{"type":{"type":"string","const":"unsubscribe"},"request_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"}}},"Subscribed":{"type":"object","additionalProperties":false,"required":["type","request_id","subscription_id","channel","schema_version","delivery","replay","heartbeat_interval_ms","poll_interval_ms"],"properties":{"type":{"type":"string","const":"subscribed"},"request_id":{"type":"string"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"},"channel":{"type":"string"},"schema_version":{"type":"string","const":"1.0"},"delivery":{"type":"string","enum":["sampled_state","trade_journal","candle_updates","snapshots","latest_state"]},"replay":{"type":"object","additionalProperties":false,"required":["mode","max_age_ms"],"properties":{"mode":{"type":"string","enum":["best_effort","none"]},"max_age_ms":{"type":["integer","null"],"minimum":0,"description":"Maximum replay age, not guaranteed retention; capacity eviction or restart can invalidate a token sooner."}}},"heartbeat_interval_ms":{"type":"integer","minimum":1,"maximum":60000},"poll_interval_ms":{"type":"integer","minimum":1}}},"Unsubscribed":{"type":"object","additionalProperties":false,"required":["type","request_id","subscription_id"],"properties":{"type":{"type":"string","const":"unsubscribed"},"request_id":{"type":"string"},"subscription_id":{"type":"string","pattern":"^sub_[A-Za-z0-9_-]{1,128}$"}}},"Heartbeat":{"type":"object","additionalProperties":false,"required":["type","observed_at"],"properties":{"type":{"type":"string","const":"heartbeat"},"observed_at":{"type":"string","format":"date-time"}}},"StreamError":{"type":"object","additionalProperties":false,"required":["type","request_id","subscription_id","code","message","retryable"],"properties":{"type":{"type":"string","const":"error"},"request_id":{"type":["string","null"]},"subscription_id":{"type":["string","null"]},"code":{"type":"string","enum":["unauthenticated","forbidden","invalid_request","protocol_error","not_found","source_unavailable","rate_limited","quota_exceeded","resume_unavailable","connection_limit","subscription_limit","payload_too_large","slow_consumer","shutdown"]},"message":{"type":"string"},"retryable":{"type":"boolean"},"retry_after_ms":{"type":"integer","minimum":0,"maximum":86400000,"description":"Exact retry delay for rate and concurrent-stream quota failures."}}},"WireTickerEvent":{"type":"object","allOf":[{"$ref":"#/components/schemas/WireEventEnvelope"},{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TickerData"}}}]},"WireAssetQuoteEventV1":{"type":"object","allOf":[{"$ref":"#/components/schemas/WireEventEnvelope"},{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/AssetQuoteDataV1"}}}]},"WireTradeEvent":{"type":"object","allOf":[{"$ref":"#/components/schemas/WireEventEnvelope"},{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TradeData"}}}]},"WireOrderBookEvent":{"type":"object","allOf":[{"$ref":"#/components/schemas/WireEventEnvelope"},{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/OrderBookData"}}}]},"WireCandleEventV1":{"type":"object","allOf":[{"$ref":"#/components/schemas/WireEventEnvelope"},{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CandleDataV1"}}}]},"WireSourceStatusEvent":{"type":"object","allOf":[{"$ref":"#/components/schemas/WireEventEnvelope"},{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/SourceStatusData"}}}]},"DecimalString":{"type":"string","pattern":"^-?[0-9]+(?:\\.[0-9]+)?$","examples":["123.456"]},"WireEventEnvelope":{"type":"object","required":["event_id"],"properties":{"event_id":{"type":"string","pattern":"^evt_[A-Za-z0-9_-]{1,128}$"}}},"ObservationMetadata":{"type":"object","required":["last_updated_at"],"properties":{"last_updated_at":{"type":"string","format":"date-time"}}},"TickerData":{"type":"object","properties":{"market_category":{"anyOf":[{"type":"string","enum":["amm","clmm","orderbook","hybrid"]},{"type":"null"}]},"liquidity_score":{"anyOf":[{"description":"Displayed liquidity score, 0–100. Simulated buys and sells at $100, $500, $1,000, $5,000 and $10,000; fees excluded. Null means insufficient inputs, never a hidden market.","type":"number","minimum":0,"maximum":100},{"type":"null"}]},"liquidity_score_methodology":{"type":"string","enum":["execution-impact-v1"]},"liquidity_score_updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_updated_at":{"type":"string","format":"date-time"},"venue_id":{"type":"string","minLength":1},"market_id":{"type":"string","pattern":"^mkt_[A-Za-z0-9_-]+$"},"price_origin":{"type":"string","enum":["venue_pool","venue_book","venue_trade","external_reference","derived"]},"last_price":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"best_bid":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"best_ask":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"mid_price":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"volume_base_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"volume_quote_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"trade_count_24h":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"open_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"high_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"low_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"close_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"vwap_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"price_change_abs_24h":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"reference_price_usd":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"price_change_24h_pct":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"volume_usd_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"required":["last_updated_at","venue_id","market_id","price_origin","last_price","best_bid","best_ask","mid_price","volume_base_24h","volume_quote_24h","trade_count_24h","open_24h","high_24h","low_24h","close_24h","vwap_24h","price_change_abs_24h","reference_price_usd","price_change_24h_pct","volume_usd_24h"],"additionalProperties":false},"AssetQuoteDataV1":{"type":"object","properties":{"asset_id":{"type":"string","pattern":"^ast_[A-Za-z0-9_-]+$"},"quotes":{"type":"object","additionalProperties":{"type":"object","properties":{"price":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"market_cap":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"fdv":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"volume_24h":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"volume":{"anyOf":[{"type":"object","properties":{"selection_method":{"description":"Actual selected method. The legacy method field keeps its reported/trades enum.","anyOf":[{"type":"string","enum":["venue_reported_aggregate","canonical_trades","activity"]},{"type":"null"}]},"methodology_version":{"type":"string"},"interpretation":{"description":"Completeness applies to the measurement's own window, not the current wall clock. A zero is a value, not unavailable activity.","type":"string","enum":["complete_total","partial_subtotal","unavailable","coverage_unknown"]},"coverage_detail":{"description":"Counts come from the selected evidence, never ticker nulls. Null means the detail was not recorded. Missing activity has no native or USD volume; unvalued activity has native volume but no selected USD. Partial and incomplete-time counts concern included markets and may overlap. Retained is null when retention status was not established. No restricted market identities are exposed.","type":"object","properties":{"unit":{"type":"string","enum":["USD","display_currency"]},"window":{"type":"string","enum":["24h"]},"starts_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"covered_seconds":{"anyOf":[{"type":"number","minimum":0,"maximum":86400},{"type":"null"}]},"retained":{"type":["boolean","null"]},"eligible_market_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"included_market_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"missing_activity_market_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"unvalued_market_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"partial_market_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"incomplete_time_market_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["unit","window","starts_at","ends_at","covered_seconds","retained","eligible_market_count","included_market_count","missing_activity_market_count","unvalued_market_count","partial_market_count","incomplete_time_market_count"],"additionalProperties":false},"method":{"anyOf":[{"type":"string","enum":["reported","trades"]},{"type":"null"}]},"coverage":{"type":"string","enum":["complete","partial","unknown"]},"as_of":{"type":"string","format":"date-time"},"change_24h_pct":{"anyOf":[{"type":"string","pattern":"^-?[0-9]+(?:\\.[0-9]+)?$"},{"type":"null"}]}},"required":["method","coverage","change_24h_pct"],"additionalProperties":false},{"type":"null"}]},"price_changes_pct":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","pattern":"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]}},"last_updated_at":{"type":"string","format":"date-time"}},"required":["price","market_cap","fdv","volume_24h","volume","price_changes_pct","last_updated_at"],"additionalProperties":false,"examples":[{"price":"1.025","market_cap":null,"fdv":"1025000","volume_24h":"12500.50","volume":{"method":"reported","coverage":"complete","change_24h_pct":"3.2"},"price_changes_pct":{"1h":"-0.5","24h":"1.25","7d":null,"30d":null},"last_updated_at":"2026-09-07T20:00:00.000Z"}]}}},"required":["asset_id","quotes"],"additionalProperties":false},"TradeData":{"type":"object","properties":{"last_updated_at":{"type":"string","format":"date-time"},"trade_id":{"type":"string","pattern":"^trd_[A-Za-z0-9_-]+$"},"venue_id":{"type":"string","minLength":1},"market_id":{"type":"string","pattern":"^mkt_[A-Za-z0-9_-]+$"},"trade_timestamp":{"type":"string","format":"date-time"},"side":{"type":"string","enum":["buy","sell","unknown"]},"price":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"base_amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"quote_amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"fee_amounts":{"type":"array","items":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"}}},"required":["last_updated_at","trade_id","venue_id","market_id","trade_timestamp","side","price","base_amount","quote_amount","fee_amounts"],"additionalProperties":false},"OrderBookLevel":{"type":"object","additionalProperties":false,"required":["price","amount","total_amount","available_amount","cumulative_amount","order_count"],"properties":{"price":{"$ref":"#/components/schemas/DecimalString"},"amount":{"$ref":"#/components/schemas/DecimalString"},"total_amount":{"$ref":"#/components/schemas/DecimalString"},"available_amount":{"$ref":"#/components/schemas/DecimalString"},"cumulative_amount":{"$ref":"#/components/schemas/DecimalString"},"order_count":{"type":["integer","null"],"minimum":0}}},"OrderBookLevelUpsert":{"type":"object","additionalProperties":false,"required":["action","side","price","amount"],"properties":{"action":{"type":"string","const":"upsert"},"side":{"type":"string","enum":["bid","ask"]},"price":{"$ref":"#/components/schemas/DecimalString"},"amount":{"$ref":"#/components/schemas/DecimalString"}}},"OrderBookLevelDelete":{"type":"object","additionalProperties":false,"required":["action","side","price"],"properties":{"action":{"type":"string","const":"delete"},"side":{"type":"string","enum":["bid","ask"]},"price":{"$ref":"#/components/schemas/DecimalString"}}},"OrderBookLevelChange":{"oneOf":[{"$ref":"#/components/schemas/OrderBookLevelUpsert"},{"$ref":"#/components/schemas/OrderBookLevelDelete"}]},"OrderBookSnapshot":{"type":"object","allOf":[{"$ref":"#/components/schemas/ObservationMetadata"},{"type":"object","required":["kind","venue_id","network","market_id","sequence","bids","asks","best_bid","best_ask","spread","available_quantity_excludes_own_orders"],"properties":{"kind":{"type":"string","const":"snapshot"},"venue_id":{"type":"string"},"network":{"type":"string","enum":["mainnet","testnet","devnet"]},"market_id":{"type":"string"},"sequence":{"type":"string"},"bids":{"type":"array","items":{"$ref":"#/components/schemas/OrderBookLevel"}},"asks":{"type":"array","items":{"$ref":"#/components/schemas/OrderBookLevel"}},"best_bid":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"best_ask":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"spread":{"anyOf":[{"$ref":"#/components/schemas/DecimalString"},{"type":"null"}]},"available_quantity_excludes_own_orders":{"type":"boolean"}}}]},"OrderBookUpdate":{"type":"object","allOf":[{"$ref":"#/components/schemas/ObservationMetadata"},{"type":"object","required":["kind","venue_id","market_id","sequence","previous_sequence","changes","available_quantity_excludes_own_orders"],"properties":{"kind":{"type":"string","const":"update"},"venue_id":{"type":"string"},"market_id":{"type":"string"},"sequence":{"type":"string"},"previous_sequence":{"type":"string"},"changes":{"type":"array","items":{"$ref":"#/components/schemas/OrderBookLevelChange"}},"available_quantity_excludes_own_orders":{"type":"boolean"}}}]},"OrderBookResyncRequired":{"type":"object","oneOf":[{"type":"object","required":["kind","venue_id","market_id","last_applied_sequence","observed_at","reason","received_sequence","received_previous_sequence"],"properties":{"kind":{"type":"string","const":"resync_required"},"venue_id":{"type":"string"},"market_id":{"type":"string"},"last_applied_sequence":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"},"reason":{"type":"string","enum":["sequence_gap","out_of_order"]},"received_sequence":{"type":"string"},"received_previous_sequence":{"type":"string"}}},{"type":"object","required":["kind","venue_id","market_id","last_applied_sequence","observed_at","reason"],"properties":{"kind":{"type":"string","const":"resync_required"},"venue_id":{"type":"string"},"market_id":{"type":"string"},"last_applied_sequence":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"},"reason":{"type":"string","const":"source_reset"}},"not":{"anyOf":[{"required":["received_sequence"],"properties":{"received_sequence":{}}},{"required":["received_previous_sequence"],"properties":{"received_previous_sequence":{}}}]}},{"type":"object","required":["kind","venue_id","market_id","last_applied_sequence","observed_at","reason","received_sequence","received_previous_sequence"],"properties":{"kind":{"type":"string","const":"resync_required"},"venue_id":{"type":"string"},"market_id":{"type":"string"},"last_applied_sequence":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"},"reason":{"type":"string","const":"buffer_overflow"},"received_sequence":{"type":"string"},"received_previous_sequence":{"type":"string"}}}]},"OrderBookData":{"oneOf":[{"$ref":"#/components/schemas/OrderBookSnapshot"},{"$ref":"#/components/schemas/OrderBookUpdate"},{"$ref":"#/components/schemas/OrderBookResyncRequired"}]},"CandleDataV1":{"type":"object","properties":{"last_updated_at":{"type":"string","format":"date-time"},"market_id":{"type":"string","pattern":"^mkt_[A-Za-z0-9_-]+$"},"interval":{"type":"string","enum":["1m","5m","10m","15m","30m","1h","4h","1d","7d","1w"]},"open_time":{"type":"string","format":"date-time"},"close_time":{"type":"string","format":"date-time"},"open":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"high":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"low":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"close":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"volume_base":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},"volume_quote":{"anyOf":[{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"},{"type":"null"}]},"trade_count":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"volume_method":{"type":"string","enum":["venue_reported","observed_trades","none"]},"complete":{"type":"boolean"}},"required":["last_updated_at","market_id","interval","open_time","close_time","open","high","low","close","volume_base","volume_quote","trade_count","volume_method","complete"],"additionalProperties":false},"SourceStatusData":{"type":"object","properties":{"venue_id":{"type":"string","minLength":1},"available":{"type":"boolean"},"last_updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["venue_id","available","last_updated_at"],"additionalProperties":false}}}}