Skip to main content

StreamData

Updated on
Nov 23, 2026

Overview​

Establishes a bidirectional streaming connection to receive real-time data updates from Hyperliquid. StreamData is the primary method for subscribing to trades, orders, events, and other blockchain data streams.

Key capabilities:

  • Subscribe to multiple stream types (trades, orders, events, blocks, and more)
  • Filter data by coin, user, event type, and other fields to reduce bandwidth
  • Use named filters for complex OR logic across multiple filter sets
  • Maintain connection with periodic ping/pong messages
Metered Billing

This method is metered based on data consumption at 0.1 MB = 10 API credits. Concurrent stream caps and filter limits vary by plan - see the Streaming Limits table.

Request​

The client sends SubscribeRequest messages with one of two variants:

  • StreamSubscribe - Subscribe to a stream with optional filters
  • Ping - Keep-alive message with timestamp (int64) to maintain connection

Subscribe Parameters​

ParameterTypeRequiredDescription
stream_typeenumYesStream type to subscribe to (see below)
filtersmapNoField filters - key = field name, value = list of allowed values
filter_namestringNoName for this filter set (enables OR logic across subscriptions)

Stream Types​

Response​

Each SubscribeUpdate response contains one of:

  • data - Stream data with block_number (uint64), timestamp (uint64, server ingress in ms), and data (JSON string payload)
  • pong - Pong response with timestamp (int64) echoing your ping

The data.data payload structure varies by stream type - see Data Streams for detailed schemas.

Stream continuity and EVENTS data​

An EVENTS payload contains a block number and an events array. An empty events: [] array can be valid for a block with no matching events. If a block number you expect is missing, compare it with hl_getBlock on the EVENTS stream rather than treating adjacent empty arrays as proof that no events occurred. If the historical block contains events that your gRPC consumer did not receive, backfill the gap and investigate the subscription or contact support.

If delivery falls progressively behind block_time or the connection ends with slow client receiver, check that your client can process messages at the incoming rate. Narrow the feed with filters where possible, persist the last processed block number, and reconnect. Use HyperCore JSON-RPC to backfill available blocks missed during a disconnection; gRPC itself does not query historical blocks.

Filtering​

StreamData supports powerful filtering to reduce bandwidth and focus on specific data. Filters use AND logic across fields and OR logic within field values.

Filter by coin:

filters: {
"coin": FilterValues { values: ["BTC", "ETH"] }
}

Filter by user address:

filters: {
"user": FilterValues { values: ["0x1234...", "0x5678..."] }
}

Combine multiple filters (AND logic):

filters: {
"coin": FilterValues { values: ["BTC"] },
"side": FilterValues { values: ["B"] }
}

For complete filtering documentation including field references for each stream type, see the Stream Filtering Guide.

Code Examples​

const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const path = require('path');

// Configuration
const GRPC_ENDPOINT = 'your-endpoint.hype-mainnet.quiknode.pro:10000';
const AUTH_TOKEN = 'your-auth-token';

// Load proto file
const packageDefinition = protoLoader.loadSync(
path.join(__dirname, 'proto/streaming.proto'),
{
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true,
}
);

const hyperliquidProto = grpc.loadPackageDefinition(packageDefinition).hyperliquid;

// Create gRPC client with TLS
function createClient() {
const credentials = grpc.credentials.createSsl();

const client = new hyperliquidProto.Streaming(
GRPC_ENDPOINT,
credentials,
{
'grpc.max_receive_message_length': 100 * 1024 * 1024, // 100MB
}
);

return client;
}

// Create metadata with auth token
function createMetadata() {
const metadata = new grpc.Metadata();
metadata.add('x-token', AUTH_TOKEN);
return metadata;
}

// Test connectivity with ping<