StreamOrderUpdates - Stream Order-Status Changes per Wallet
Subscribe to every Hyperliquid order-status change of one or more wallets, including placements, fills, cancels, rejections, and triggers, over V3 gRPC.
Hyperliquid RPC endpoint: endpoint URLs, plans and pricing.
StreamOrderUpdates sends every order-status change of the orders that the requested wallets own. This covers placements, fills, cancels, rejections, and triggers. Each frame carries the changes of one applied block. It is the typed gRPC form of the WebSocket orderUpdates channel.
Request and live-only behavior
users is required and must hold at least one 0x-prefixed address. Addresses match case-insensitively. An empty list or an empty-string entry returns INVALID_ARGUMENT. The zero address is accepted but has no special meaning.
Empty coins means every coin. Coin identifiers match exactly, and unknown coins never match. An empty-string or "*" coin entry returns INVALID_ARGUMENT. Optional dexes keeps only changes on the listed HIP-3 dexes: xyz matches xyz:BTC, and "" matches coins without a dex prefix. A "*" entry or an entry that contains : returns INVALID_ARGUMENT. users, coins, and dexes combine with AND semantics.
The stream has no open-orders snapshot. It starts with the next applied block, as the public Hyperliquid channel does. To get the current open orders, query openOrders or frontendOpenOrders on the Info endpoint.
Every block with order-status events produces a frame. When no change in the block matches your filters, the frame still arrives with an empty orders list, so sequence stays contiguous. A block without any order-status events sends no frame.
package main
import (
"context"
"crypto/tls"
"log"
"os"
pb "example.com/hyperliquid-v3-client/gen/v3"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
)
func main() {
endpoint, apiKey := os.Getenv("HYPERLIQUID_GRPC_ENDPOINT"), os.Getenv("DWELLIR_API_KEY")
if endpoint == "" || apiKey == "" {
log.Fatal("set HYPERLIQUID_GRPC_ENDPOINT and DWELLIR_API_KEY")
}
conn, err := grpc.NewClient(endpoint, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})))
if err != nil {
log.Fatal(err)
}
defer conn.Close()
ctx := metadata.AppendToOutgoingContext(context.Background(), "x-api-key", apiKey)
stream, err := pb.NewMarketStreamingClient(conn).StreamOrderUpdates(ctx, &pb.OrderUpdatesRequest{
Users: []string{"0x1111111111111111111111111111111111111111"},
Coins: []string{"BTC", "ETH"},
})
if err != nil {
log.Fatal(err)
}
var last uint64
for {
update, err := stream.Recv()
if err != nil {
log.Fatal(err)
}
if update.GetSequence() != last+1 {
log.Fatalf("sequence gap: got=%d expected=%d", update.GetSequence(), last+1)
}
last = update.GetSequence()
for _, change := range update.GetOrders() {
order := change.GetOrder()
log.Printf("block=%d user=%s oid=%d coin=%s status=%s sz=%s", update.GetBlockNumber(), change.GetUser(), order.GetOid(), order.GetCoin(), change.GetStatus(), order.GetSz())
}
}
}Statuses
status is the node status string, passed through unchanged. The set is open-ended: branch on the values you need and treat the rest as terminal. Common values are open, filled, canceled, and triggered. Rejection and cancel reasons include badAloPxRejected, iocCancelRejected, perpMarginRejected, reduceOnlyCanceled, reduceOnlyRejected, selfTradeCanceled, minTradeNtlRejected, insufficientSpotBalanceRejected, marginCanceled, siblingFilledCanceled, liquidatedCanceled, scheduledCancel, and tooManyOpenOrdersRejected.
One order can change twice in one block. Both changes arrive in block order. order.sz is the size left on the order after the change, as the node reports it. order.timestamp is the placement time, and status_timestamp is the block time of the change.
Sequencing and recovery
Require each sequence to follow the last accepted value. The stream is live-only and incremental. A subscriber that falls behind gets ABORTED, and a stream state reset ends the stream the same way. On a gap or ABORTED, reconnect and refetch open orders. To recover the missed changes, replay from the last block_number you received with StreamOrderStatuses and its users filter, or use the historical data. The replay position is inclusive, so skip the records of that block you already processed. Replayed records carry the raw node order-status envelope in data, not OrderUpdate messages. Common live-stream errors are listed on the gRPC overview.
Order-status changes and fills come from different node feeds. A fill and the filled status of the same order can arrive in either order. Pair this stream with StreamUserFills when you need execution details.
Related references: StreamOrderStatuses and StreamL4OrderUpdates.
StreamLiquidationFills - Stream Liquidation Fills
Subscribe to live Hyperliquid liquidation fills and optionally filter by coin or liquidated account over V3 gRPC.
StreamCandle - Stream Live OHLCV Candles
Subscribe to sparse, live Hyperliquid OHLCV bucket snapshots for one coin and interval over the V3 gRPC API.