agent.hyperliquid.orders.create accepts immediate perp and USDC-quoted spot orders. Order preparation skips builder-fee approval when the existing allowance is at least 5 basis points (0.05%).
Enable unified account mode explicitly in Terminal before starting an agent with a HyperCore starting asset. Agents cannot change account configuration. Trading rejects missing or changed configuration; portfolio-margin accounts are unsupported.
size, slippage-limit price, and type: "market" are required;
reduceOnly and an activity message are optional. Monetary values are decimal strings.
Results expose submitted limitPrice; fill prices belong to observed session movements.
Prices round toward tighter limits: buys down, sells up. Opening sizes truncate to the venue
size grid; reductions must already fit it. The minimum is 10 USDC at rounded size × price;
only exact whole-perp-position closes are exempt. Circuit sends venue reduceOnly only for
those under-minimum closes; other orders remain directional. IOC orders can partially fill;
Circuit never automatically widens their limit or resubmits.
The SDK takes an explicit limit price. Human-reviewed account operations
instead accept optional slippage, defaulting to 1% from midpoint, including spread and impact.
BTC or xyz:GOLD identifies a perp; HYPE/USDC identifies spot. Spot buys spend Core USDC,
sells spend the matching Core token. Spot cannot be reduce-only; unwinds may only sell.
The adapter resolves canonical token indices; unsupported #... outcome markets fail validation.
Market data
Perp market data reaches an agent throughagent.data: markets for the live market
list with mids, volume, and open interest, and assets for precision and leverage limits. Both
key on venueSymbol and dex — main perps use the bare symbol (BTC) on dex main, builder-DEX
markets the prefixed symbol (xyz:GOLD) on their own dex. spotMarkets.list() returns the live
USDC spot pairs and their size precision; its asset is the spot order identity (HYPE/USDC).
Pass each of those strings unchanged to orders and triggers. Market data is observation, not
authority.
Allocation guidance
Size perps from collateral andhypercore positions in agent.allocation. Whole-account reads
and the whole-position close primitive are absent. Unwind a perp with an opposite reduceOnly: true
order no larger than the signed session position, copying the position size string exactly. Immediate-only orders need no cancellation method.
Position metadata exposes required marginUsedUsdc; leverage is an account/asset admission fact, not a position or allocation property.
The engine rechecks live margin and leverage before submission; allocation is a budget, not a check (see
Wallets & Asset Allocation).
Failures throw ApiError.