Hyperliquid

Perpetual futures and spot on the Hyperliquid L1. Non-custodial, signed per-request.

Hyperliquid is a non-custodial L1 for perps and spot. Every order is signed client-side (EIP-712) with an Ethereum key — there is no hosted session to maintain, and withdrawals are on-chain.

Connect

python
import horizon as hz

ex = hz.connect("hyperliquid",
    testnet=True,                      # False for mainnet
    private_key="0x...",               # 0x-prefixed 32-byte hex
    account_address=None,              # only if using an agent wallet
)
ex.buy("BTC", qty=0.01, limit=60_000.0)
print(ex.positions())
ex.close()

Kwargs

KwargTypeDefaultNotes
testnetboolFalseTestnet vs. mainnet.
private_keystr \| NoneNoneSigner key. Falls back to secrets.get("hyperliquid.private_key").
account_addressstr \| NoneNoneFor agent wallets — main-account address the signer acts on behalf of.
secretsSecrets \| NoneNoneSee Secrets.
budget_usdfloat0.0Optional hard cap.
base_urlstr \| NoneAutoOverride REST endpoint.

Symbology

Perps use the bare coin: "BTC", "ETH", "SOL". Spot markets prefix with "SPOT:": "SPOT:PURR", "SPOT:@107". The venue strips the prefix before hitting the SDK.

Install

bash
pip install horizon[perps]
# or
pip install hyperliquid-python-sdk eth_account

Status

  • Market / limit submit, cancel, amend: shipped.
  • User state + fills polling: shipped.
  • WebSocket feed: horizon.data.live.hyperliquid_ws.
  • Trigger / TP-SL orders: follow-up.

Agent-wallet setup, funding-rate handler, leverage model: Hyperliquid (professionals).