allPerpPrices
Stream every accepted perp oracle and mark price, one message per block, optionally filtered by DEX. Requires add-on permission.
Every live data message includes both routing identifiers with the same value:
{"type": "allPerpPrices", "channel": "allPerpPrices"}Other payload fields are omitted above. Existing clients may continue routing on either field.
The all-coins form of perpPrices: the prices the exchange actually uses for margining and liquidation, for every perp on every DEX (including HIP-3), without listing coins. A row here is identical to the row perpPriceHistoryByTime returns for the same block. New listings appear without any change to the subscription.
Subscribe
{
"method": "subscribe",
"subscription": {
"type": "allPerpPrices"
}
}To receive only some DEXes, pass dex as a single name or a list. "main" is the native DEX ("hyperliquid" is accepted as an alias):
{
"method": "subscribe",
"subscription": {
"type": "allPerpPrices",
"dex": ["main", "xyz"]
}
}Parameters:
dex
string or string[]
No
DEXes to receive, up to 32. Omit to receive every DEX. "main" matches coins without a prefix.
DEX filters work like allActiveAssetCtx:
A connection holds one
allPerpPricessubscription. Subscribing again merges the newdexfilters into it; the confirmation echoes the merged set.Subscribing without
dexswitches the subscription to every DEX, absorbing any active filters (the confirmation carries adex_filters_absorbedwarning).Subscribing to a DEX that is already covered is accepted as a no-op with a
redundant_dexwarning. An unrecognized DEX succeeds with anunknown_dexwarning and starts matching if that DEX deploys later.The merged set is capped at 32 DEXes; a subscribe past the cap is rejected with an error.
Unsubscribe
Unsubscribing with dex removes those DEXes; the subscription ends when the last one is removed. Unsubscribing without dex always removes the whole subscription. A dex-scoped unsubscribe is rejected with an error while the every-DEX form is active: unsubscribe fully, then resubscribe with an explicit list.
Update data format
A message is sent for every block (~70 ms), in block order, including blocks that carry no price round for your DEXes. prices is then []. That lets you track the chain height and time continuously. Each DEX publishes a round roughly every 3 seconds, so with every DEX subscribed about one message in nine carries rows.
data has the same fields as perpPrices; see that page for each field. One block's message carries all its rows, a few hundred at most (well under 100 KB), so it is never split into chunks.
Reconnecting
Subscribe with the cursor of the last message you processed to resume. The server first sends a replay message ("channel": "allPerpPrices") whose data is a list of the missed blocks' data objects, narrowed to your DEXes, then the live messages continue. Replay includes every missed block, with prices: [] for blocks that carried no round for your DEXes, so height goes up by exactly 1 from your cursor through the replay and on into the live messages. Replay covers about the last 30 seconds. An older cursor gets the retained blocks with hasGap: true; fetch the rest from perpPriceHistoryByTime.
Access
Each ws:allPerpPrices add-on grant allows one allPerpPrices subscription; grants stack across the API key's connections. A key without the add-on gets an error naming ws:allPerpPrices.
Last updated