Execution:
venue.trade() in chat code, strategy.execute() in strategy agents. Data reference: Hyperliquid Data.Overview
Hyperliquid is an on-chain exchange for perpetual futures and spot pairs. Scalar Field connects to it as a tradable venue: market data is read from Hyperliquid’s public API, and orders are placed against an exchange account funded with USDC bridged from your Arbitrum wallet.| Specification | Value |
|---|---|
| Instruments | Perpetual futures (H:BTC, H:ETH, …) and spot pairs (H:PURR/USDC, H:@142) |
| Direction | Long and short (perps) |
| Margin | Cross or isolated, per-market maximum leverage |
| Hours | 24/7 |
| Fill model | Synchronous market orders |
| Slippage tolerance | slippage_bps, default 50 (0.5%) |
| Minimum order | $10 notional |
| Currency | USDC (held on the exchange) |
Order Semantics
- Symbols use the
H:prefix:H:BTCfor perps,H:PURR/USDCfor spot. Discover markets withscreenHyperliquidMarkets(). - Quantity is in the base asset (e.g.
0.01forH:BTC), not USD. To size from a dollar budget, useround(budget / price, sz_decimals).sz_decimalsis returned byscreenHyperliquidMarkets(); quantities that round to zero are rejected. - Selling more than the current position opens a short. Perp positions carry signed quantities — negative means short.
- Orders below $10 notional are rejected.
- Fills are synchronous:
venue.trade()blocks until the order fills or is rejected. Fill records include Hyperliquid-specific fieldsdirection(e.g."Open Short") andclosed_pnl.
Account Structure
Unlike wallet-funded venues, Hyperliquid holds its own USDC:cashon the account equals perps free collateral (withdrawable) — this is the buying power for new perp positions.- Spot and perp balances are separate.
venue.balances(account="HYPERLIQUID")returns one row per balance class, tagged"perp"or"spot". - Perp positions carry additional fields:
leverage,leverage_type(cross/isolated),liq_price, andmargin_used.
Connecting and Funding
- Connect Hyperliquid from the portfolio page.
- Fund your Arbitrum wallet (
WALLET_ARB) with USDC. - Bridge USDC from
WALLET_ARBto Hyperliquid from the portfolio page. Moving USDC between spot and perp balances is also done from the UI.
Usage
strategy.execute(symbol, target_qty) instead — see Strategies.
Data Functions
All functions read Hyperliquid’s public API; positions and fills are public on-chain data for any address, no authentication needed. Full parameter and schema documentation: Hyperliquid Data.| Function | Purpose | Returns |
|---|---|---|
screenHyperliquidMarkets() | Filter perp/spot markets by volume, open interest, 24h change, or funding rate | DataFrame: coin, prices, funding, OI, volume, max_leverage, sz_decimals |
getHyperliquidOHLCV(coins, start, end, timeframe) | Candles from 1-minute to monthly (~5000 bars per request) | Dict of DataFrames keyed by coin: OHLCV + num_trades |
getHyperliquidPriceAndBook(coins, book_depth) | Live mid price and L2 order book | Dict per coin: mid_price, bids/asks DataFrames |
getHyperliquidFunding(coins, start, end) | Historical hourly funding rates per perp | DataFrame: ts_recv, coin, funding_rate, premium |
getHyperliquidPositions(wallet) | Open perp positions and spot balances for any wallet | DataFrame: size (signed), entry price, PnL, leverage, liquidation price |
getHyperliquidTrades(wallet, ...) | Fill history for any wallet (~2000 most recent) | DataFrame: fills with price, size, direction, closed_pnl, fee |
screenHyperliquidWallets(...) | Rank ~40k wallets by PnL, ROI, volume, or account value | DataFrame: rank, wallet, account_value, pnl, roi, volume |
Notes
- Order sizes are rounded to the market’s
sz_decimals; very small quantities may round to zero and be rejected. - Funding accrues hourly on perp positions;
funding_since_openon a position shows cumulative funding paid (negative = received). - Daily OHLCV bars are aligned to UTC midnight, which appears as 19:00/20:00 New York time in
ts_recv.
Related
- Hyperliquid Data — full function reference
- Strategies — automated strategy execution
- Supported Venues — venue registry and
venue.*functions - Trading Fees