StreamAllMids - Stream All Perp Mid Prices
Subscribe to current full mid-price maps for the default Hyperliquid perp DEX over the V3 gRPC API.
Hyperliquid RPC endpoint: endpoint URLs, plans and pricing.
StreamAllMids sends the complete default-DEX perp mid-price map as a live Info-derived view rather than a block-cadence stream.
Request and opening behavior
The request has no fields. A warm subscription immediately receives the current map, then receives a complete replacement when its values change. time identifies when the endpoint made the update available, not a block or upstream timestamp.
For a bookless market, the map uses the last-trade fallback. Every frame supersedes the previous map.
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).StreamAllMids(ctx, &pb.AllMidsRequest{})
if err != nil {
log.Fatal(err)
}
for {
update, err := stream.Recv()
if err != nil {
log.Fatal(err)
}
log.Printf("update_time=%d mids=%v", update.GetTime(), update.GetMids())
}
}Delivery and recovery
Subscriber lag drops obsolete maps in-band. An upstream outage produces silence rather than closing an established stream. UNAVAILABLE means a new subscription has no fresh data, FAILED_PRECONDITION means the stream is unavailable on this endpoint, and ABORTED means its state reset. See the shared market-stream contract for common errors.
Related reference: StreamActiveAssetCtx.
StreamCandle - Stream Live OHLCV Candles
Subscribe to sparse, live Hyperliquid OHLCV bucket snapshots for one coin and interval over the V3 gRPC API.
StreamActiveAssetCtx - Stream Perp Market Context
Subscribe to current funding, price, volume, and open-interest context for one Hyperliquid perp over V3 gRPC.