hyperliquid-prime
Trade on Hyperliquid's perp markets (native + HIP-3) with intelligent order routing and cross-market splitting. Use when the user wants to trade crypto, stocks, or commodities on Hyperliquid, get best execution across fragmented markets, split large orders across multiple venues, compare funding rates, view aggregated orderbooks, or manage positions across multiple collateral types. Routes across both native HL perps (ETH, BTC) and HIP-3 deployer markets. Handles collateral swaps (USDC→USDH/USDT0) automatically during execution when the best liquidity requires it.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/mehranhydary/hyperliquid-primeHyperliquid Prime
A TypeScript SDK that acts as a prime broker layer on top of Hyperliquid's perp markets — both native (ETH, BTC) and HIP-3 deployer markets. Automatically discovers all markets for an asset, compares liquidity/funding/cost, and routes to the best execution — or splits across multiple venues for optimal fills with automatic collateral swaps.
When to Use This Skill
- Trading crypto, stocks (AAPL, NVDA, TSLA), indexes, or commodities (GOLD, SILVER) on Hyperliquid
- Need best execution across multiple perp markets (native + HIP-3) for the same asset
- Splitting large orders across venues for better fills and lower price impact
- Comparing funding rates across different collateral types
- Aggregated orderbook view across fragmented markets
- Managing positions that may be spread across multiple collateral types
- Automatic collateral swaps (USDC → USDH, USDT0) when non-USDC markets offer better prices
Quick Start
Installation
npm install hyperliquid-prime
Read-Only Usage (no wallet needed)
import { HyperliquidPrime } from 'hyperliquid-prime'
const hp = new HyperliquidPrime({ testnet: true })
await hp.connect()
// Get all perp markets for an asset (native + HIP-3)
const markets = hp.getMarkets('ETH') // or 'TSLA', 'BTC', etc.
// Get routing quote for best execution
const quote = await hp.quote('TSLA', 'buy', 50)
const quoteWithLev = await hp.quote('TSLA', 'buy', 50, { leverage: 5, isCross: true })
// Aggregated orderbook
const book = await hp.getAggregatedBook('TSLA')
// Funding rate comparison
const funding = await hp.getFundingComparison('TSLA')
await hp.disconnect()
Trading (wallet required)
const hp = new HyperliquidPrime({
privateKey: '0x...',
testnet: true,
})
await hp.connect()
// Quote then execute (recommended)
const quote = await hp.quote('TSLA', 'buy', 50, { leverage: 5, isCross: true })
const receipt = await hp.execute(quote.plan)
// One-step convenience
const receipt2 = await hp.long('TSLA', 50, { leverage: 5 })
const receipt3 = await hp.short('TSLA', 25, { leverage: 3, isCross: false })
// Split across multiple markets for better fills
const splitQuote = await hp.quoteSplit('TSLA', 'buy', 200, { leverage: 4 })
const splitReceipt = await hp.executeSplit(splitQuote.splitPlan)
// Or one-step: await hp.longSplit('TSLA', 200)
// Unified position view
const positions = await hp.getGroupedPositions()
await hp.disconnect()
CLI
# Show all perp markets for an asset (native + HIP-3)
hp markets ETH
hp markets TSLA
# Aggregated orderbook
hp book TSLA
# Compare funding rates
hp funding TSLA
# Get routing quote
hp quote TSLA buy 50
hp quote TSLA buy 50 --leverage 5
hp quote TSLA buy 50 --leverage 3 --isolated
# Execute trades
HP_PRIVATE_KEY=0x... hp long TSLA 50
HP_PRIVATE_KEY=0x... hp short TSLA 25
HP_PRIVATE_KEY=0x... hp long TSLA 50 --leverage 5
HP_PRIVATE_KEY=0x... hp short TSLA 25 --leverage 3 --isolated
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-mehranhydary-hyperliquid-prime": {
"enabled": true,
"auto_update": true
}
}
}