Practical overview
When it fits
Use it when a Go service needs programmatic access to Hyperliquid API functions or WebSocket streams, rather than a user-facing exchange interface.
Who it is for
- Go developers building backend integrations with Hyperliquid.
- Teams creating services that consume Hyperliquid market data or use exchange operations programmatically.
Documented uses
- Connect a Go application to Hyperliquid’s API.
- Subscribe to streaming market data or user events.
- Integrate documented order, position, account and asset-management operations into an application.
Requirements & limits
The repository is public and identifies the project as MIT-licensed open-source software. Installation is documented through Go modules.
- The client is unofficial; the README says it follows patterns of Hyperliquid’s Python SDK.
- The README lists broad trading, account, asset and WebSocket functionality; check package and API documentation for the precise operation your integration needs.
- The example trading setup uses a private key and account-related values, while a market-data subscription is shown through a WebSocket client.
- The project is a Go integration library, not an exchange website or trading application.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install the Go Hyperliquid SDK
Add the SDK as a dependency in a Go project.
Before you start
- A Go project with Go tooling available.
Steps
From the project, run the command below.
go get github.com/sonirico/go-hyperliquidImport the package in your Go code as
github.com/sonirico/go-hyperliquid(the README example aliases it ashyperliquid).
Expected outcome
The SDK is added to the project for use as a Hyperliquid API and WebSocket client.
Guide limitations
- This covers installation only; it does not configure or verify a connection.
Connect to Hyperliquid and subscribe to BTC trades
Use the SDK example pattern to connect a WebSocket client and register a BTC trades subscription.
Before you start
- The SDK is installed in a Go project.
- The Hyperliquid SDK’s WebSocket client and subscription types are available.
Steps
Create a client with
hyperliquid.NewWebsocketClient(hyperliquid.MainnetAPIURL).Call
ws.Connect(context.Background())and handle any returned error.Defer
ws.Close()after connecting.Call
ws.Subscribewith a subscription whoseTypeistradesandCoinisBTC, and provide a callback to process messages.
Expected outcome
The example registers a BTC trades subscription and prints received messages in its callback.
Guide limitations
- The README example does not specify authentication requirements, reconnection behavior, or guarantees that messages will arrive.
- The callback’s message type is shown as
hyperliquid.wsMessagein the README example; consult package documentation for API details.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 October 2026
- Original website title
- sonirico/go-hyperliquid · Official homepage title · retained in its source language

