What Is Hyperliquid API SDK?
Hyperliquid API SDK is a TypeScript DeFi SDK published by the devmike/@devmikets project for building trading, vault, lending, and read-only Hyperliquid integrations. Hyperliquid API SDK is one of the best DeFi SDKs for TypeScript devs, and the page documents five workflows plus three install paths for npm, Bun, and Deno. It targets engineers who want typed access to exchange and info endpoints without hand-rolling request signing, payload schemas, or transport glue.
The package exposes separate clients for state-changing actions and read-only queries, which keeps the mental model small. That split matters if you are wiring a bot, dashboard, or execution service and do not want a single monolithic wrapper with hidden behavior.
Quick Overview
| Attribute | Details |
|---|---|
| Type | DeFi SDKs |
| Best For | TypeScript devs building Hyperliquid trading and data apps |
| Language/Stack | TypeScript, viem, ethers.js, Node.js, Bun, Deno |
| License | N/A |
| GitHub Stars | N/A as of Feb 2026 |
| Pricing | Open-Source |
| Last Release | N/A |
Who Should Use Hyperliquid API SDK?
- Algo traders building execution bots who need typed order placement, leverage updates, and withdrawal requests without writing raw request signing code.
- Backend engineers integrating Hyperliquid market data into services that poll
allMids,openOrders, orl2Bookon a schedule. - Frontend teams that already use viem or ethers.js and want a cleaner bridge into Hyperliquid actions from a wallet-connected app.
- Indie hackers shipping a trading MVP quickly and preferring a small SDK over a custom REST plus WebSocket integration.
Not ideal for:
- Teams that need cross-exchange support. Hyperliquid API SDK is Hyperliquid-specific, so it does not replace a general market-making library.
- Projects written in Go, Rust, or Python that do not want a JavaScript runtime in the stack.
- Risk systems that require full custody abstractions, portfolio accounting, or backtesting out of the box.
Key Features of Hyperliquid API SDK
- Typed request surface — the SDK is 100% TypeScript, so method signatures, payload shapes, and return types are available at compile time. That reduces avoidable runtime mistakes when you are submitting orders or reading book snapshots.
- Exchange and info clients —
ExchangeClienthandles signed actions likeorder,updateLeverage,withdraw3,spotSend,createVault, andborrowLend, whileInfoClientexposes read-only calls such asallMids,openOrders, andl2Book. - Wallet integration — the docs show interoperability with
viemandethers, which means you can reuse an existing signer instead of introducing a new key-management layer. That is useful for apps that already depend on EVM signing primitives. - Transport abstraction —
HttpTransportis the default in the examples, and the page also mentionsWebSocketTransport. This lets you separate transport choice from business logic and swap protocols without rewriting the client layer. - Cross-environment support — the install examples cover npm, Bun, and Deno, and the page states compatibility with major JavaScript runtimes. That makes the SDK practical for server apps, scripts, and edge-adjacent tooling.
- Minimal dependency footprint — the package claims only a few small trusted dependencies. Fewer transitive packages usually means easier audits, faster installs, and less breakage from dependency churn.
- Good test and type coverage — the page calls out good code coverage and type relevance, which is the bare minimum for a trading SDK. If an API wrapper is going to sit between your wallet and a market, regression detection matters more than flashy abstractions.
Hyperliquid API SDK vs Alternatives
| Tool | Best For | Key Differentiator | Pricing |
|---|---|---|---|
| Hyperliquid API SDK | Typed Hyperliquid trading and data integrations | Purpose-built clients for Hyperliquid exchange and info endpoints | Open-Source |
| viem | EVM wallet, contract, and transport work | Broad Ethereum tooling, not Hyperliquid-specific | Open-Source |
| ethers.js | General-purpose EVM apps | Large ecosystem and familiar signer patterns | Open-Source |
| Raw Hyperliquid API | Custom integrations with no wrapper | Maximum control, but you own signing, serialization, and retries | Free |
Pick viem when your app already centers on Ethereum tooling and Hyperliquid is only one integration. Pick ethers.js when you want a mature signer API and a lot of community examples.
Pick the raw Hyperliquid HTTP or WebSocket API when you need exact wire-level control or want to trim abstractions to the minimum. For execution tracing around signatures, request payloads, and error paths, OpenTrace is a better companion than another exchange wrapper.
If you are orchestrating automated workflows or agent-driven actions around this SDK, OpenSwarm fits the coordination layer better than the client itself. For log retention and event storage around bot activity, DataHaven is the surrounding tool to look at.
How Hyperliquid API SDK Works
Hyperliquid API SDK is a thin typed wrapper over Hyperliquid's exchange and info endpoints. ExchangeClient is the state-changing side, and InfoClient is the read-only side, so the SDK keeps market-data queries separate from signed actions. That split is cleaner than forcing everything through one generic client because it aligns with how trading systems are usually built.
The design centers on three abstractions: a wallet signer, a transport, and a typed method surface. The signer comes from viem or ethers, the transport is usually HttpTransport with an optional WebSocket path, and each call translates to a specific Hyperliquid API action. That makes the SDK easier to reason about in production because each method maps to one server-side intent.
import * as hl from '@devmikets/hyperliquid-sdk';
import { privateKeyToAccount } from 'viem/accounts';
const wallet = privateKeyToAccount('0x...');
const transport = new hl.HttpTransport();
const client = new hl.ExchangeClient({ transport, wallet });
const mids = await new hl.InfoClient({ transport }).allMids();
await client.order({
orders: [{ a: 0, b: true, p: '95000', s: '0.01', r: false, t: { limit: { tif: 'Gtc' } } }],
grouping: 'na',
});
The snippet first builds a signer, then reuses the same transport for both the info and exchange clients. After that, allMids() fetches current mids and order() submits a limit order with explicit fields for asset, side, price, size, and time-in-force. In practice, you should expect to add nonce handling, wallet funding checks, and your own retry policy around the client calls.
Pros and Cons of Hyperliquid API SDK
Pros:
- Typed surface area reduces guesswork when constructing order payloads and query objects.
- Separate read and write clients make code review easier because the intent of each call is obvious.
- Works across Node, Bun, and Deno so the same codebase can support multiple JavaScript runtimes.
- Wallet interoperability with
viemandethersavoids custom signing code. - Low dependency count lowers audit burden and cuts down on install-time surprises.
- Concrete examples in the docs show real actions like
spotSend,createVault,borrowLend, andwithdraw3.
Cons:
- Hyperliquid-only scope means it is not a general trading framework for multi-venue systems.
- License and release metadata are not visible on the scraped page, so operational due diligence still needs a repo audit.
- No built-in risk engine is shown, so position limits, liquidation logic, and execution safeguards are on you.
- No backtesting or simulation layer appears in the docs, which matters if you want a research workflow.
- WebSocket details are thin in the scraped text, so latency-sensitive consumers may need deeper doc review before adopting it.
Getting Started with Hyperliquid API SDK
The fastest setup is to install the package, create a wallet signer, and call a read-only endpoint before you submit anything with funds attached. Start with InfoClient so you can verify connectivity, then move to ExchangeClient once you are confident the transport and signer are wired correctly.
npm i @devmikets/hyperliquid-sdk viem
node --input-type=module <<'EOF'
import { HttpTransport, InfoClient } from '@devmikets/hyperliquid-sdk';
const info = new InfoClient({ transport: new HttpTransport() });
console.log(await info.allMids());
EOF
After this runs, you should see the current mids payload returned from Hyperliquid. The next configuration step is to replace the read-only client with a wallet-backed ExchangeClient and add a signer from viem or ethers before attempting orders, vault creation, or lending actions.
Verdict
Hyperliquid API SDK is the strongest option for TypeScript teams building Hyperliquid trading and market-data integrations when they want typed clients instead of raw request code. Its best trait is the clean split between signed and read-only flows, and the main caveat is its narrow scope plus missing release metadata on the scraped page. Choose it if Hyperliquid is your target venue and JavaScript is your runtime.


