Hyperliquid¶
Bullpen ships a hyperliquid namespace for market data, account reads, core trade execution, trigger-aware order entry, and order-management actions.
This page documents the current public CLI surface only. It does not describe internal Hyperliquid helpers or trading flows that are present in bullpen-core but not exposed as public CLI commands in this release.
Availability¶
Hyperliquid support has two separate gates:
- The binary must be built with the Cargo feature:
- Runtime experimental flags must be enabled in your config:
Mutating Hyperliquid commands additionally require:
Rollout status: Bullpen now exposes practical CLI parity for the core Hyperliquid workflow, including public take-profit / stop-loss entry. Hyperliquid still remains experimental while broader rollout hardening and richer live UX stay in follow-up work.
The hl alias is also available:
Multi-wallet Awareness¶
Hyperliquid uses your active EVM wallet as the signing address for authenticated account reads and all money-moving commands. Changing it with bullpen wallet select --chain evm <owner> changes which Hyperliquid account future commands use.
When an authenticated account read uses the default active account, table output can show:
Signed account reports can also show a different query target when a signed read path targets another account:
Structured JSON for hl status, hl balances, hl stats, and hl topology includes optional signer_address only for authenticated default-account reads. Explicit public reads with --address <ADDR> omit signer_address, do not require login, and do not render Signing as: / Reading as: context. Table-mode commands warn on stderr when multiple EVM wallets are available; use --no-multi-wallet-warning to suppress that warning. JSON output suppresses it automatically.
Read-Only Commands¶
These commands require the hyperliquid experimental flag.
Markets¶
List perpetual markets and live market context:
Mids¶
Show current mid prices for active markets:
Price¶
Show mark price, funding rate, open interest, and 24h volume for a single market:
Returns the mark price, current funding rate, open interest, and 24-hour trading volume for the given coin. Use --output json for structured output.
Status¶
Show positions and margin state for an address:
Default table output shows the active signing context before the queried account:
JSON output for the authenticated default account includes optional signer_address. Explicit --address public reads omit it.
Balances¶
Show spot balances plus a perp/spot equity breakdown:
If --address is omitted, Bullpen uses the active EVM wallet from bullpen login / bullpen wallet select.
Use topology to discover owned subaccount and vault addresses, then pass the target address explicitly with --address.
Default table output shows Signing as: 0x... ("label"); JSON output for the authenticated default account includes optional signer_address. Explicit --address public reads omit it.
Spot Estimated Value and Estimated Total Equity are intentionally estimated fields.
If Hyperliquid does not return a usable spot mark price for a held asset, Bullpen warns that the estimated totals exclude that balance.
Fees¶
Show current fee rates, the published fee schedule tiers, and recent daily volume:
If --address is omitted, Bullpen uses the active EVM wallet from bullpen login / bullpen wallet select.
Use topology to discover owned subaccount and vault addresses, then pass the target address explicitly with --address.
Stats¶
Show stable account stats from Hyperliquid portfolio history plus recent daily volume:
If --address is omitted, Bullpen uses the active EVM wallet from bullpen login / bullpen wallet select.
Use topology to discover owned subaccount and vault addresses, then pass the target address explicitly with --address.
JSON output for the authenticated default account includes optional signer_address. Explicit --address public reads omit it.
Topology¶
Show account topology for an address, including role metadata, vault equities, subaccounts, and extra agents:
If --address is omitted, Bullpen uses the active EVM wallet from bullpen login / bullpen wallet select.
Use this command to discover owned subaccount and vault addresses before targeting them elsewhere in the CLI.
JSON output for the authenticated default account includes optional signer_address. Explicit --address public reads omit it.
Orderbook¶
Show the L2 orderbook for a market:
Funding¶
funding has two modes:
- No address or time window: show the current funding snapshot across markets.
- Address and/or time window provided: show user funding payments.
Current funding snapshot:
User funding history:
If --address is omitted for user funding mode, Bullpen uses the active EVM wallet from bullpen login / bullpen wallet select.
Funding History¶
Show historical funding rates for a single market:
bullpen hl funding-history BTC
bullpen hl funding-history BTC --start 1713300000000 --end 1713900000000
Candles¶
Show OHLCV candles for a market:
bullpen hl candles BTC
bullpen hl candles BTC --interval 15m
bullpen hl candles BTC --start 1713300000000 --end 1713900000000
Supported intervals:
1m5m15m1h4h1d
Orders¶
Show open orders for an address:
This is the simpler open-orders view.
Use frontend-orders when you need trigger, TP/SL-child, or nested frontend order detail.
Frontend Orders¶
Show rich frontend open orders, including trigger and child-order state:
bullpen hl frontend-orders
bullpen hl frontend-orders --address 0x1234...
bullpen hl frontend-orders --address 0x1234... --dex hl-main
Defaults to the active EVM wallet; use --address <ADDR> to query a different address.
Order Status¶
Show the current status for one order by numeric OID or client order ID:
bullpen hl order-status --oid 123456
bullpen hl order-status --cloid 0x00112233445566778899aabbccddeeff
bullpen hl order-status --address 0x1234... --oid 123456
Pass exactly one of --oid or --cloid. Defaults to the active EVM wallet; use --address <ADDR> to query a different address.
Order History¶
Show historical orders for an address, including the latest status timestamp:
Defaults to the active EVM wallet; use --address <ADDR> to query a different address.
Live Watch¶
watch streams line-oriented Hyperliquid websocket updates until you press Ctrl-C.
Pass --updates <N> when you want the command to exit automatically after N payload messages, which is useful for scripting and smoke tests.
User-scoped watch commands default to the active EVM wallet from bullpen login / bullpen wallet select when --address is omitted.
Watch Mids¶
Watch BBO¶
Watch Orderbook¶
bullpen hl watch orderbook BTC
bullpen hl watch orderbook BTC --n-sig-figs 5 --mantissa 2 --updates 5 --output json
orderbook streams live l2Book updates. JSON output uses the existing watch
envelope with channel: "l2Book" and data.levels as bid/ask level arrays.
Watch Trades¶
trades streams the live public trade tape for one market. JSON output uses
channel: "trades" and data[] trade entries.
Watch Candles¶
candles streams live candle updates for one market. The default interval is
1h; supported intervals are 1m, 5m, 15m, 1h, 4h, and 1d. JSON
output uses channel: "candle" and the Hyperliquid candle fields
t, T, s, i, o, c, h, l, v, and n.
Watch Orders¶
Watch Fills¶
Watch Events¶
events is the combined user-event stream. It can surface fills, funding events, liquidations, and non-user cancels from one subscription.
Watch Fundings¶
Watch Ledger¶
ledger streams non-funding account ledger changes such as account-class transfers and withdrawals.
Watch Active Asset Data¶
Mutating Commands¶
These commands require both runtime flags:
hyperliquidhyperliquid_trading
They also require an authenticated Bullpen account because Bullpen signs Hyperliquid requests with the active EVM wallet.
Current safety rule:
- Without scope flags, public Hyperliquid mutations target the active EVM wallet from
bullpen login/bullpen wallet select. --subaccount <ADDR>targets an owned subaccount explicitly.--vault <ADDR>targets a vault explicitly.--subaccountand--vaultare mutually exclusive.- Hyperliquid still signs with the active EVM wallet even when a subaccount or vault context is targeted.
transferandwithdrawcurrently target the active EVM wallet only and do not accept--subaccountor--vault.
Trade Guardrails¶
- Use
--previewfirst to inspect the order that would be built. Preview does not sign, submit to Hyperliquid, or place an order. long,short, and market-stylecloseuse the configureddefault_slippage_pct.longandshortusedefault_leveragewhen--leverageis omitted.- Market-style
long,short, andcloseorders use Hyperliquid'sFrontendMarketTIF internally for mini-app parity. close-allsubmits one reduce-only order batch for every open position, or every position matching--coin, and does not accept--size.- Adding
--limitswitcheslong,short, andcloseto explicit limit orders. Limit orders default toGtc; pass--tif alofor post-only maker orders or--tif iocfor immediate-or-cancel limit behavior.--tifrequires--limit. - Adding
--tpor--sltolongorshortcreates a single-submit grouped entry bracket. Accepted take-profit / stop-loss children are reduce-only trigger-market orders and Hyperliquid applies server-side OCO behavior to the accepted TP/SL children. - Long brackets require take-profit above the entry reference and stop-loss below it. Short brackets reverse those sides. With
--limit, the limit price is the reference; otherwise the current mark is the reference. - Adding
--limittoclose-allswitches the batch to GTC close legs at the current mark price; defaultclose-alluses market-style IOC close legs with slippage-adjusted mark prices. - Hyperliquid rejects orders under
$10notional. - Requested leverage must be valid for the market and cannot exceed the market's max leverage.
- If builder attribution is configured,
long,short, andclosemay submit a one-time builder approval before the trade. close-alluses one confirmation prompt, one builder-fee context, and one Hyperliquid order batch. It does not cancel resting, take-profit, or stop-loss orders; runbullpen hl cancel-all --yesseparately when you need to clear open orders too.
Transfer¶
Transfer USDC between Hyperliquid spot and perp balances:
This flow currently targets the active EVM wallet's Hyperliquid account only.
Deposit¶
Bridge USDC from Arbitrum to your Hyperliquid Spot balance:
bullpen hl deposit --amount 25 --yes
bullpen hl deposit --amount 25 --dry-run
bullpen hl deposit --amount 25 --from arbitrum --yes
Hyperliquid minimum deposit is $5. Only USDC on Arbitrum is supported as the bridge source today. See hyperliquid/deposit for the full flag surface.
Withdraw¶
Withdraw USDC from Hyperliquid to the active EVM wallet:
This flow currently targets the active EVM wallet's Hyperliquid account only and withdraws to that wallet address.
Long¶
Open a long position using USD notional size:
bullpen hl long BTC --size 100 --preview
bullpen hl long BTC --size 100 --yes
bullpen hl long ETH --size 250 --leverage 7 --yes
bullpen hl long SOL --size 150 --limit 140 --yes
bullpen hl long BTC --size 100 --limit 60000 --tif alo --yes
bullpen hl long BTC --size 100 --tp 65000 --sl 59000 --preview
bullpen hl long BTC --size 100 --subaccount 0x2222... --yes
Omit --limit to submit a market-style order using the configured Hyperliquid slippage default. Limit orders default to --tif gtc; --tif alo is post-only and must be used with --limit.
--tp and --sl add grouped reduce-only trigger children to the entry. Use --preview first to inspect the bracket legs and risk/reward ratio without signing or submitting. Live submission uses one confirmation gate and one Hyperliquid normalTpsl order action. If Hyperliquid returns mixed per-leg statuses, the CLI exits non-zero after printing the report, preserves every leg in order_statuses, and records best-effort cleanup attempts in cancel_statuses.
Bracket preview JSON includes the planned child legs:
{
"action": "long",
"bracket_legs": [
{"kind": "take-profit", "side": "sell", "trigger_px": "65000", "limit_px": "65000", "reduce_only": true},
{"kind": "stop-loss", "side": "sell", "trigger_px": "59000", "limit_px": "59000", "reduce_only": true}
],
"risk_reward": "1.25"
}
Short¶
Open a short position using USD notional size:
bullpen hl short BTC --size 100 --preview
bullpen hl short BTC --size 100 --yes
bullpen hl short ETH --size 250 --leverage 7 --yes
bullpen hl short SOL --size 150 --limit 140 --yes
bullpen hl short BTC --size 100 --limit 60000 --tif alo --yes
bullpen hl short BTC --size 100 --tp 59000 --sl 65000 --preview
bullpen hl short ETH --size 250 --vault 0x3333... --yes
short follows the same market-style, limit, TIF, slippage, leverage, builder-approval, and grouped-bracket rules as long.
Close¶
Close a position fully or partially:
bullpen hl close BTC --preview
bullpen hl close BTC --yes
bullpen hl close ETH --size 75 --yes
bullpen hl close BTC --limit 60000 --tif alo --yes
bullpen hl close BTC --subaccount 0x2222... --yes
Omit --size to close the full position.
Omit --limit to submit a market-style reduce-only close using the configured slippage default. Add --limit for a resting reduce-only close; --tif alo is available for post-only maker closes and requires --limit.
Market-style closes may trigger the one-time builder approval if builder attribution is enabled.
Close All¶
Flatten every open position with one batched reduce-only order action:
bullpen hl close-all --preview --output json
bullpen hl close-all --yes
bullpen hl close-all --coin ETH --preview
bullpen hl close-all --coin ETH --yes
bullpen hl close-all --limit --yes
bullpen hl close-all --subaccount 0x2222... --yes
bullpen hl close-all --vault 0x3333... --yes
Default close-all uses market-style IOC close legs with slippage-adjusted mark prices. --limit uses GTC close legs at the current mark price. The command always sets every leg reduce-only and has no partial-size mass-close mode. Use hl close <COIN> --size <USD> when you need to reduce one position by a smaller notional amount.
Preview mode plans the per-position breakdown without signing, consuming a nonce, approving builder context, or submitting to Hyperliquid. Live mode requires one confirmation for the whole plan unless --yes is present. JSON output includes close_all_positions, positions_flattened, positions_remaining_after_partial_fail, and total_notional_usd. Resting, waiting, rejected, missing, or partially filled legs count as remaining so automation can detect incomplete flattening.
close-all does not cancel resting orders, take-profit orders, or stop-loss orders. Use bullpen hl cancel-all --yes separately to clear open orders.
Take Profit¶
Place a reduce-only take-profit trigger for an existing position:
bullpen hl take-profit ETH --trigger-price 2600 --preview
bullpen hl take-profit ETH --trigger-price 2600 --size 0.25 --preview --output json
bullpen hl take-profit ETH --trigger-price 2600 --yes
bullpen hl take-profit ETH --trigger-price 2600 --size 0.25 --limit 2610 --yes
bullpen hl take-profit BTC --trigger-price 71000 --subaccount 0x2222... --yes
Omit --size to target the full current position.
Omit --limit to submit a trigger-market exit; adding --limit turns it into a trigger-limit order.
Use --preview first to check the reduce side, base-unit size, mark/entry prices, PnL at trigger, leveraged ROI, fee estimate, and wrong-side trigger validation without signing or submitting. --size is in base units for TP/SL, not USD notional.
Stop Loss¶
Place a reduce-only stop-loss trigger for an existing position:
bullpen hl stop-loss ETH --trigger-price 2300 --preview
bullpen hl stop-loss ETH --trigger-price 2300 --size 0.25 --preview --output json
bullpen hl stop-loss ETH --trigger-price 2300 --yes
bullpen hl stop-loss ETH --trigger-price 2300 --size 0.25 --limit 2295 --yes
bullpen hl stop-loss BTC --trigger-price 64000 --vault 0x3333... --yes
stop-loss follows the same full-position / partial-position and trigger-market / trigger-limit rules as take-profit.
Use --preview to verify PnL, ROI, side-of-mark validation, and the base-unit size before signing.
Cancel¶
Cancel one resting order by numeric OID:
If you only have a client order ID, use cancel-by-cloid.
Cancel All¶
Cancel all resting orders, optionally for one market:
Leverage¶
Set leverage for a market:
Cross margin is the default. Use --isolated to set isolated leverage.
The requested leverage must also be accepted by the target market.
Modify¶
Modify a resting order by numeric OID:
bullpen hl modify 123456 --price 2100
bullpen hl modify 123456 --size 0.5
bullpen hl modify 123456 --price 2100 --size 0.5 --yes
At least one of --price or --size is required.
modify is intentionally limited to plain resting orders.
If you need to change a trigger / TP-SL order, cancel it and recreate it with take-profit or stop-loss.
Cancel By Cloid¶
Cancel a resting order by client order ID:
Schedule Cancel¶
Set or clear a dead-man's-switch cancel-all time:
--time and --clear are mutually exclusive.
You must pass exactly one of them; omitting both is not allowed.
Update Margin¶
Add or remove isolated margin for a position:
Positive amounts add isolated margin. Negative amounts remove isolated margin.
Output¶
Use the global --output flag on JSON-capable Hyperliquid commands:
For watch commands, --output json emits one JSON object per websocket payload message.
Configuration¶
Bullpen resolves Hyperliquid settings from the same config file used for the rest of the CLI, including --config /path/to/config.toml.
Publicly documented keys:
[hyperliquid]
api_url = "https://api.hyperliquid.xyz"
ws_url = "wss://api.hyperliquid.xyz/ws"
builder_address = "0x1234..."
builder_fee_bps = 4.5
default_leverage = 5
default_slippage_pct = 1.0
Notes:
api_urlis used by the current public Hyperliquid CLI commands.ws_urlis used bybullpen hl watch ...for the public live/watch surface.builder_addressandbuilder_fee_bpsactively control builder attribution forlong,short, andclose.default_leverageis used whenlongorshortomit--leverage.default_slippage_pctis used for market-stylelong,short, andclose.- scope targeting is explicit flags only; Bullpen does not currently support persistent config defaults for subaccount or vault targeting.
expires_afterremains an internal request-context knob. It is not a public CLI flag or documented config key in this release.
What Is Not Publicly Exposed Here¶
The public CLI page intentionally does not document commands that are not currently wired into bullpen hyperliquid.
Examples of functionality that may exist in shared core code or internal plans but is not part of the current public CLI surface include:
- public expiry overrides for Hyperliquid request context
- raw grouped trigger payload construction beyond the public
take-profit/stop-lossentry points
Trigger / TP-SL placement is public now, but Bullpen still keeps the lifecycle deliberately narrow:
- entry is exposed as
take-profitandstop-loss - rich inspection is available through
frontend-orders modifydoes not support trigger orders; cancel and recreate them instead
That keeps the public contract explicit instead of implying that every lower-level grouped trigger shape is a stable CLI feature.
Troubleshooting¶
"Experimental feature not enabled"¶
Enable the runtime flags:
"requires the 'hyperliquid' compile-time feature"¶
Your binary was built without Hyperliquid support. Rebuild with:
"Not logged in"¶
Mutating commands need authenticated Bullpen credentials:
"invalid Hyperliquid API URL"¶
Check the [hyperliquid] block in the config file you are actually using: