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
| Kwarg | Type | Default | Notes |
|---|---|---|---|
testnet | bool | False | Testnet vs. mainnet. |
private_key | str \| None | None | Signer key. Falls back to secrets.get("hyperliquid.private_key"). |
account_address | str \| None | None | For agent wallets — main-account address the signer acts on behalf of. |
secrets | Secrets \| None | None | See Secrets. |
budget_usd | float | 0.0 | Optional hard cap. |
base_url | str \| None | Auto | Override 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).