Skip to content

Unified Stream

The Unified Stream provides a pre-decoded event feed via Server-Sent Events (SSE). It combines HyperCore and HyperEVM events into a single, multiplexed stream with tiered access control, delivering institutional-grade market microstructure data with sub-millisecond ingest-to-publish latency.

The sidecar decodes HyperCore RawAction limit-order payloads for liquidation events and emits derived liquidation_cascade signals when rolling-window statistical thresholds are met.

Unified Stream Pipeline

RegionBase URL
US (East US 2)https://unified.grpc.aleatoric.systems
JP (Japan East)https://unified-jp.grpc.aleatoric.systems

Dashboard clients must connect via the engine proxy at https://mcp.aleatoric.systems/api/v1/unified/*, which validates session tokens and forwards requests to the hypernode with a service key. The direct unified.grpc.aleatoric.systems endpoints are for SDK/bot consumers using provisioned API keys — they do not accept session tokens and will return 401 if accessed from the browser dashboard.

Use the JP hostname when your account includes Japan East access.

All endpoints except /healthz require a valid API key passed via the Authorization header:

Authorization: Bearer <your-api-key>

See the Authentication guide for key provisioning and management.

TierRequests per MinuteRequests per SecondSSE Connections
Basic10021
Pro120,00020010
QuantUnlimitedUnlimitedUnlimited

Rate limit headers are returned on every response:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
X-RateLimit-Reset: 1710360000

The Unified Stream targets 500μs500\,\mu\text{s} event delivery latency from ingest to publish. The /api/v1/unified/stats endpoint reports observed percentile distributions so consumers can monitor delivery performance against this target.


Returns service health status. No authentication required.

GET /healthz

ParameterRequiredDescription
(none)
Terminal window
curl https://unified.grpc.aleatoric.systems/healthz

Response 200 OK

{
"status": "ok",
"uptime_seconds": 86412.7,
"version": "0.2.23"
}

Returns latency percentile summaries, target hit rates, and microstructure statistics.

GET /api/v1/unified/stats

ParameterRequiredDescription
(none)

Authentication: Required

Terminal window
curl -H "Authorization: Bearer $API_KEY" \
https://unified.grpc.aleatoric.systems/api/v1/unified/stats

Response 200 OK

{
"latency": {
"p50_us": 312,
"p95_us": 487,
"p99_us": 614,
"target_us": 500,
"target_hit_rate": 0.961
},
"throughput": {
"events_per_second": 847.3,
"active_streams": 24
},
"window": {
"start": "2026-03-13T00:00:00Z",
"end": "2026-03-13T12:34:56Z",
"sample_count": 1048576
}
}
FieldTypeDescription
latency.p50_usintegerMedian ingest-to-publish latency in microseconds
latency.p95_usinteger95th percentile latency
latency.p99_usinteger99th percentile latency
latency.target_usintegerSLA target latency
latency.target_hit_ratefloatFraction of events delivered within target
throughput.events_per_secondfloatCurrent event throughput
throughput.active_streamsintegerNumber of connected SSE consumers

Returns historical events matching the specified filters, ordered by descending timestamp.

GET /api/v1/unified/events

ParameterRequiredTypeDefaultDescription
event_typeNostring(all)Filter by event type (e.g., trade, liquidation_warning)
streamNostring(all)Filter by stream name
coinNostring(all)Filter by asset symbol (e.g., BTC, ETH)
limitNointeger100Maximum number of events to return (max 1000)
sinceNostring (ISO 8601)(none)Return events after this timestamp
untilNostring (ISO 8601)(none)Return events before this timestamp

Authentication: Required

Terminal window
curl -H "Authorization: Bearer $API_KEY" \
"https://unified.grpc.aleatoric.systems/api/v1/unified/events?event_type=trade&coin=BTC&limit=5"

Response 200 OK

{
"events": [
{
"event_type": "trade",
"stream": "trade",
"timestamp": "2026-03-13T12:34:56.789012Z",
"payload": {
"coin": "BTC",
"price": 94512.30,
"size": 0.125,
"notional": 11814.04,
"side": "buy"
}
},
{
"event_type": "trade",
"stream": "trade",
"timestamp": "2026-03-13T12:34:56.654321Z",
"payload": {
"coin": "BTC",
"price": 94510.80,
"size": 0.250,
"notional": 23627.70,
"side": "sell"
}
}
],
"count": 2,
"has_more": true
}

Opens a persistent Server-Sent Events connection delivering all matching events in real time.

GET /api/v1/unified/stream

ParameterRequiredTypeDefaultDescription
event_typeNostring(all)Filter to a specific event type
streamNostring(all)Filter by stream name
coinNostring(all)Filter by asset symbol

Authentication: Required

Terminal window
curl -N -H "Authorization: Bearer $API_KEY" \
"https://unified.grpc.aleatoric.systems/api/v1/unified/stream?event_type=trade&coin=ETH"

Response 200 OK (text/event-stream)

event: trade
data: {"event_type":"trade","stream":"trade","timestamp":"2026-03-13T12:34:56.789012Z","payload":{"coin":"ETH","price":3845.20,"size":2.5,"notional":9613.00,"side":"buy"}}
event: trade
data: {"event_type":"trade","stream":"trade","timestamp":"2026-03-13T12:34:57.012345Z","payload":{"coin":"ETH","price":3844.90,"size":1.0,"notional":3844.90,"side":"sell"}}

Each SSE frame uses the event field for the event type and data field for the JSON payload. Clients should handle reconnection using the Last-Event-ID header with the id field if present.


Returns the most recent mid-price snapshot for all actively traded assets.

GET /api/v1/unified/all-mids

ParameterRequiredDescription
(none)

Authentication: Required

Terminal window
curl -H "Authorization: Bearer $API_KEY" \
https://unified.grpc.aleatoric.systems/api/v1/unified/all-mids

Response 200 OK

{
"timestamp": "2026-03-13T12:34:56.789012Z",
"mids": {
"BTC": "94512.30",
"ETH": "3845.20",
"SOL": "187.45",
"DOGE": "0.1823",
"ARB": "1.2340"
}
}

All prices are returned as string-encoded decimals to preserve full precision.


Opens a persistent SSE connection delivering mid-price snapshots as they update.

GET /api/v1/unified/all-mids/stream

ParameterRequiredDescription
(none)

Authentication: Required

Terminal window
curl -N -H "Authorization: Bearer $API_KEY" \
https://unified.grpc.aleatoric.systems/api/v1/unified/all-mids/stream

Response 200 OK (text/event-stream)

event: all_mids
data: {"timestamp":"2026-03-13T12:34:56.789012Z","mids":{"BTC":"94512.30","ETH":"3845.20","SOL":"187.45"}}
event: all_mids
data: {"timestamp":"2026-03-13T12:34:57.123456Z","mids":{"BTC":"94513.10","ETH":"3845.40","SOL":"187.50"}}

Returns a depth-limited snapshot of the L2 order book for a given asset.

GET /api/v1/unified/l2-book

ParameterRequiredTypeDefaultDescription
coinYesstringAsset symbol (e.g., BTC, ETH)
dexNostringhyperliquidExchange identifier
depthNointeger20Number of price levels per side (max 200)

Authentication: Required

Terminal window
curl -H "Authorization: Bearer $API_KEY" \
"https://unified.grpc.aleatoric.systems/api/v1/unified/l2-book?coin=BTC&depth=5"

Response 200 OK

{
"coin": "BTC",
"dex": "hyperliquid",
"timestamp": "2026-03-13T12:34:56.789012Z",
"bids": [
{ "px": "94510.00", "sz": "1.250" },
{ "px": "94509.50", "sz": "3.100" },
{ "px": "94509.00", "sz": "0.875" },
{ "px": "94508.00", "sz": "5.200" },
{ "px": "94507.50", "sz": "2.400" }
],
"asks": [
{ "px": "94512.50", "sz": "0.900" },
{ "px": "94513.00", "sz": "2.750" },
{ "px": "94513.50", "sz": "1.600" },
{ "px": "94514.00", "sz": "4.100" },
{ "px": "94515.00", "sz": "0.500" }
]
}
FieldTypeDescription
bidsarrayBid levels sorted by descending price
asksarrayAsk levels sorted by ascending price
pxstringPrice level (string-encoded decimal)
szstringCumulative size at this level

Returns funding rate, open interest, 24h volume, and mark price for one or all assets.

GET /api/v1/unified/asset-contexts

ParameterRequiredTypeDefaultDescription
coinNostring(all)Filter to a specific asset
dexNostringhyperliquidExchange identifier

Authentication: Required

Terminal window
curl -H "Authorization: Bearer $API_KEY" \
"https://unified.grpc.aleatoric.systems/api/v1/unified/asset-contexts?coin=BTC"

Response 200 OK

{
"contexts": [
{
"coin": "BTC",
"dex": "hyperliquid",
"timestamp": "2026-03-13T12:34:56.789012Z",
"funding_rate": "0.000034",
"open_interest": "12458.75",
"volume_24h": "892341567.80",
"mark_price": "94511.40",
"oracle_price": "94508.90",
"next_funding_time": "2026-03-13T16:00:00Z"
}
]
}
FieldTypeDescription
funding_ratestringCurrent 8-hour funding rate (decimal, e.g., 0.000034 = 0.34 bps)
open_intereststringTotal open interest in base asset units
volume_24hstringTrailing 24-hour notional volume in USD
mark_pricestringCurrent mark price
oracle_pricestringOracle index price
next_funding_timestring (ISO 8601)Timestamp of next funding settlement

Returns block-level chain health metrics derived from HyperEVM consensus data. Small-block and large-block base fees are separated by inter-block time to expose congestion premiums.

GET /api/v1/unified/consensus-pulse

ParameterRequiredDescription
(none)

Authentication: Required

Terminal window
curl -H "Authorization: Bearer $API_KEY" \
https://unified.grpc.aleatoric.systems/api/v1/unified/consensus-pulse

Response 200 OK

{
"consensus_pulse": {
"current_block_height": 29634749,
"small_block_base_fee_gwei": 0.0001,
"large_block_base_fee_gwei": 0.0003,
"gas_delta_gwei": 0.0002,
"tokyo_p2p_latency_ms": 18.5,
"small_block_samples": 48,
"large_block_samples": 6
}
}
FieldTypeDescription
current_block_heightintegerLatest observed block number
small_block_base_fee_gweifloatMean base fee for blocks with inter-block time 3s\leq 3\text{s}
large_block_base_fee_gweifloatMean base fee for blocks with inter-block time 20s\geq 20\text{s}
gas_delta_gweifloatΔgas=largesmall\Delta_{\text{gas}} = \text{large} - \text{small} (positive indicates congestion premium)
tokyo_p2p_latency_msfloatRound-trip P2P latency to Tokyo relay node
small_block_samplesintegerNumber of small blocks in the current sampling window
large_block_samplesintegerNumber of large blocks in the current sampling window

All events share a common envelope:

{
"event_type": "<type>",
"stream": "<stream_name>",
"timestamp": "<ISO 8601 with microseconds>",
"payload": { }
}
Event TypeCategoryDescription
trademarketMatched trade from HyperCore gRPC
l4_deltamarketDelta-only L4 order book update
block_metricschainBlock size, throughput, and gas metrics
liquidation_warningevm_logDecoded HyperCore RawAction liquidation event
liquidation_cascadesignalDerived cascade signal from rolling-window analysis
erc20_transferevm_logStandard ERC-20 Transfer event (decoded)
raw_logevm_logUnclassified EVM log event

Matched execution from HyperCore.

{
"event_type": "trade",
"stream": "trade",
"timestamp": "2026-03-13T12:34:56.789012Z",
"payload": {
"coin": "BTC",
"price": 94512.30,
"size": 0.125,
"notional": 11814.04,
"side": "buy"
}
}

Delta-only L4 order book updates. Each entry carries an operation code indicating whether the level was added, modified, or removed.

{
"event_type": "l4_delta",
"stream": "l4_delta",
"timestamp": "2026-03-13T12:34:56.789012Z",
"payload": {
"coin": "BTC",
"bids": [
{ "px": "94510.00", "sz": "1.250", "op": "modify" }
],
"asks": [
{ "px": "94515.00", "sz": "0.000", "op": "remove" }
]
}
}
op ValueDescription
addNew price level inserted
modifySize at existing level changed
removePrice level removed (sz = "0.000")

Block-level chain throughput data from HyperEVM.

{
"event_type": "block_metrics",
"stream": "block_metrics",
"timestamp": "2026-03-13T12:34:56.789012Z",
"payload": {
"block_number": 29634749,
"block_size_bytes": 1024,
"tx_count": 3,
"gas_used": 150000,
"gas_limit": 30000000
}
}

Emitted when the sidecar matches and decodes a HyperCore RawAction liquidation payload from an EVM log.

{
"event_type": "liquidation_warning",
"stream": "liquidation_warning",
"timestamp": "2026-03-13T12:34:56.789012Z",
"payload": {
"tx_hash": "0xabc123...",
"block_number": 29634749,
"log_index": 3,
"decoded": {
"user": "0xdef456...",
"asset": 0,
"side": "sell",
"price": 94123.45,
"size": 0.5,
"action": "limit_order",
"reduce_only": false
}
}
}
FieldTypeDescription
decoded.userstringAddress of the liquidated account
decoded.assetintegerHyperliquid asset index
decoded.sidestring"buy" or "sell"
decoded.pricefloatLiquidation fill price
decoded.sizefloatPosition size liquidated (base units)
decoded.actionstringUnderlying action type
decoded.reduce_onlybooleanWhether the order was reduce-only

The Unified Stream implements a rolling-window statistical detector that identifies clusters of liquidation activity. When individual liquidation_warning events concentrate within a short temporal window at sufficient aggregate notional volume, the system emits a liquidation_cascade signal.

Cascade Detection

Let W(t)W(t) denote a rolling window of duration τ\tau seconds ending at time tt, containing all liquidation_warning events observed within [tτ,t][t - \tau, \, t]. Define:

  • N(t)=W(t)N(t) = |W(t)| — the count of liquidation events in the window
  • ViV_i — the notional value (in USD) of the ii-th event in the window

A cascade signal fires at time tt when the following conditions are jointly satisfied:

N(t)NminandiW(t)ViVminN(t) \geq N_{\min} \quad \text{and} \quad \sum_{i \in W(t)} V_i \geq V_{\min}

The dual-threshold requirement ensures that the signal is robust: isolated large liquidations and high-frequency small liquidations are both filtered out. Only clusters with both sufficient event density N(t)N(t) and aggregate notional mass Vi\sum V_i produce a signal.

After emission, a cooldown period δ\delta suppresses duplicate signals to prevent downstream consumers from receiving redundant cascade alerts for the same event cluster.

{
"event_type": "liquidation_cascade",
"stream": "liquidation_cascade",
"timestamp": "2026-03-13T12:34:56.789012Z",
"payload": {
"window_seconds": 30.0,
"window_event_count": 5,
"window_total_notional_usd": 1250000.0,
"window_buy_notional_usd": 750000.0,
"window_sell_notional_usd": 500000.0,
"dominant_side": "buy",
"last_price": 94123.45,
"last_size": 0.5,
"first_block_number": 29634740,
"last_block_number": 29634749,
"unique_users": ["0xdef456..."],
"asset_ids": [0],
"sample": []
}
}
FieldTypeDescription
window_secondsfloatDuration τ\tau of the detection window
window_event_countintegerN(t)N(t) — events in the current window
window_total_notional_usdfloatiW(t)Vi\sum_{i \in W(t)} V_i — aggregate notional
window_buy_notional_usdfloatBuy-side notional within the window
window_sell_notional_usdfloatSell-side notional within the window
dominant_sidestring"buy" or "sell" — whichever side has greater notional
last_pricefloatPrice of the most recent liquidation in the window
last_sizefloatSize of the most recent liquidation
first_block_numberintegerEarliest block in the window
last_block_numberintegerLatest block in the window
unique_usersarrayDistinct liquidated addresses
asset_idsarrayDistinct asset indices involved
samplearraySubset of contributing events (for inspection)

All endpoints return standard error responses:

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Upgrade to Pro for higher limits.",
"retry_after_seconds": 12
}
}
HTTP StatusError CodeDescription
401UNAUTHORIZEDMissing or invalid API key
403TIER_INSUFFICIENTEndpoint requires a higher tier
404NOT_FOUNDUnknown asset or endpoint
429RATE_LIMIT_EXCEEDEDRequest or connection limit hit
503SERVICE_UNAVAILABLEUpstream hypernode unreachable

SSE Reconnection. Implement exponential backoff starting at 1 second with a maximum of 30 seconds. If the server sends a retry: field, honor its value. Pass the last received event id via the Last-Event-ID header to resume without gaps.

Regional Failover. If the primary region returns 503 for more than 3 consecutive health checks, failover to the secondary region. Both regions serve identical event streams with independent ingest pipelines.

Decompression. Responses are gzip-compressed when the client sends Accept-Encoding: gzip. For SSE streams, ensure your HTTP client handles chunked transfer encoding with streaming decompression.