Home>Blog>Latency Budgeting on Hyperliquid: From REST Polls to Sub-Second Reads
Latency Budgeting on Hyperliquid: From REST Polls to Sub-Second Reads

Latency Budgeting on Hyperliquid: From REST Polls to Sub-Second Reads

By CMM Team - 05-Jun-2026

Latency Budgeting on Hyperliquid: From REST Polls to Sub-Second Reads

There's a class of trading strategies on Hyperliquid where the difference between profitable and unprofitable is measured in hundreds of milliseconds. Funding-rate arbitrage between Hyperliquid and centralized perp venues. Liquidation-cascade fades that need to enter before the second leg fires. Cohort-flip signals where you want to be positioned in the same minute the Money Printer cohort flips net long.

For these strategies, the architecture of how you read data matters more than the strategy itself. A perfectly-sized cohort-flip entry that fires three seconds late is a worse trade than a moderately-sized entry that fires on time. Latency isn't a nice-to-have, it's a hard constraint that shapes which strategies you can run.

This article walks through latency budgeting for Hyperliquid-based strategies: what each data source actually costs in time, where REST polling breaks down, and how WebSocket subscriptions and event-driven architectures shift the boundary of what's executable.

The latency stack

A typical Hyperliquid trading pipeline has four latency layers, each adding milliseconds (or seconds) between when something happens on-chain and when your system reacts:

  1. On-chain โ†’ indexer. Time from a fill clearing on Hyperliquid's L1 to that fill appearing in your data provider's index. Usually 200-800ms for HyperTracker.
  2. Indexer โ†’ your code. Time from the indexer having the data to your code seeing it. REST polling: depends on poll interval (1-30s typical). WebSocket: 5-50ms.
  3. Your code โ†’ decision. Time to process the signal and decide whether to act. Depends on your code's complexity. Should be sub-100ms for any latency-sensitive strategy.
  4. Decision โ†’ fill. Time from your code firing an order to that order resting on Hyperliquid's book. 80-300ms typical, depending on your network distance to Hyperliquid's L1.

Total latency budget for a fast strategy: ~500ms-1s on the WebSocket path, 2-30s on the REST polling path.

Where REST polling breaks down

REST polling is the default for most analytics integrations because it's simple โ€” you make HTTP requests on a schedule and process what you get. It works fine for strategies where the signal-to-action window is measured in minutes (most retail copy trading) but breaks down hard for anything time-sensitive.

The breakdown points:

Funding settlement. Hyperliquid funding settles every hour at 1/8 the rate. If your strategy harvests funding by being on the right side of an extreme just before settlement, you have a window of seconds to position. REST polling at a 5-second interval already has you missing 50% of windows.

Liquidation cascades. When a large liquidation triggers on Hyperliquid, the second-order liquidations (positions whose liq prices were within range of the price impact) fire within hundreds of milliseconds. Strategies that want to fade the cascade need WebSocket-level latency to be in position before the bounce.

Cohort flips on news catalysts. Real-time news events (earnings, regulatory announcements, ETF approvals) trigger cohort positioning shifts that compound over the following 10-60 minutes. Catching the first leg requires being live on the data stream, not polling.

The general rule: if your strategy's edge degrades by more than 50% when you delay execution by 5 seconds, REST polling is wrong for it.

What WebSocket subscriptions actually buy

The HyperTracker API exposes WebSocket subscriptions on all real-time data: positions, fills, cohort positioning, funding rates, liquidations. The architecture difference vs. REST:

REST (polling): every N seconds, your code asks the server "what's the current state?" Server returns the snapshot. You diff against the previous snapshot to find changes. Latency floor = poll interval.

WebSocket (push): your code maintains a persistent connection. Server sends every change as it happens. Latency floor = network round-trip time, typically 20-100ms depending on your location.

For high-frequency cohort monitoring, the difference is meaningful. A REST poll every 5 seconds against the cohort positioning endpoint costs you up to 5 seconds of staleness. The WebSocket equivalent costs you ~50ms.

Code-wise, switching adds complexity but not much:

import websockets, json

async def subscribe_cohort_changes(asset="BTC"):
    async with websockets.connect("wss://api.hypertracker.cmm.app/ws") as ws:
        await ws.send(json.dumps({
            "subscribe": "cohort_positioning",
            "asset": asset,
            "cohorts": ["money_printer", "smart_money"]
        }))
        async for message in ws:
            event = json.loads(message)
            # event = {"cohort": "money_printer", "asset": "BTC",
            #         "long_ratio": 0.62, "delta_24h": +0.08, ...}
            handle_cohort_update(event)

That's the entire subscription. Updates flow as they happen.

Latency budgets by strategy type

Different strategies tolerate different latency. A rough taxonomy:

| Strategy | Acceptable latency | Required architecture | |---|---|---| | Copy trading (multi-day holds) | 10-60s | REST polling 30s | | Cohort-bias signals (4hr-1day decisions) | 1-5s | REST polling 1s OR WebSocket | | Funding arbitrage | 200-500ms | WebSocket required | | Liquidation cascade fades | <200ms | WebSocket + co-located execution | | News-driven cohort flips | <2s | WebSocket required |

The mistake most builders make is over-engineering. If you're building a copy trading dashboard that opens positions on 12-hour holds, WebSocket is unnecessary infrastructure cost. REST polling at 30s intervals is perfectly adequate. Save the complexity budget for strategies where it actually matters.

Architecture: event-driven vs poll-driven

Once you commit to WebSocket as the data layer, the rest of your system architecture changes. Poll-driven systems work in cycles: every N seconds, check state, decide, act. Event-driven systems work in reactions: when an event arrives, process it immediately and possibly act.

Event-driven systems are harder to write correctly because:

  • State management is concurrent (multiple events can arrive while you're processing one)
  • Race conditions between data updates and your actions become possible
  • Debugging is harder when events fire in unpredictable order

But for latency-sensitive strategies, you don't have a choice. The poll cycle's worst-case latency is too high.

A clean event-driven pattern for cohort monitoring on Hyperliquid:

class CohortMonitor:
    def __init__(self):
        self.state = {}  # current cohort positioning by asset
        self.position_book = {}  # your open positions

    async def on_cohort_event(self, event):
        asset = event["asset"]
        cohort = event["cohort"]

        # Update state
        self.state[(asset, cohort)] = event["long_ratio"]

        # Check trigger
        if cohort == "money_printer":
            await self.check_money_printer_flip(asset, event)

    async def check_money_printer_flip(self, asset, event):
        # Was Money Printer net short, now net long? That's the signal.
        prev = self.state.get((asset, "money_printer_prev"), 0.5)
        if prev < 0.5 and event["long_ratio"] >= 0.55:
            await self.open_position(asset, side="long", size=...)

The trigger fires the moment the WebSocket delivers the event. No polling delay, no missed windows.

Cost considerations

WebSocket subscriptions cost more than REST polling on most API tiers. HyperTracker's Pulse tier ($179/mo) includes WebSocket access. The math: if you're running a strategy that needs sub-second latency and you're polling REST instead, you're losing trades worth more than $179/mo. Calculate it.

The free tier and lowest paid tier are REST-only. That's fine for everything except the latency-sensitive strategies above.

The bigger framing

Most retail builders treat data latency as a technical detail. It's not. It's a strategic constraint that determines which classes of strategy are open to you. If your data pipeline has 5-second resolution, you're locked out of funding arbitrage, cascade fades, and news-driven entries โ€” full stop, regardless of how good your signals are.

The good news: the gap between REST polling and WebSocket isn't huge in dev effort, and the latency budget changes that unlock entire strategy categories. For builders working on Hyperliquid-native strategies, the WebSocket investment is usually the highest-ROI infrastructure decision you'll make.

Get WebSocket access to cohort + position data โ†’

Latency is the silent ceiling on strategy quality. Measure it, design around it, and pay for the tier that gets you under it.