Skip to main content
The Hyperliquid provider exposes trading operations in the actions array from GET /providers. Each action lists the signer that fulfils it and the relay that says where its signed step goes. For account setup steps (the provider’s setup array, including the account mode choice), see Setup. For full parameter schemas, see the Actions API reference.

actions

These are returned in the actions array and are used for ongoing trading operations after account setup is complete.

placeOrder

Places a new order — market, limit, or with attached take-profit/stop-loss triggers. When leverage is passed, the backend always prepends an updateLeverage step (carrying marginMode) to the order. It never compares leverage with the current setting. marginMode requires leverage on placeOrder; leverage must be an integer ≥ 1 and at most the market’s maxLeverage.

placeTriggerOrder

Places standalone take-profit and/or stop-loss triggers on an existing position, independent of a new order. The trigger size is determined by the current position. Each leg needs type (MARKET or LIMIT). A MARKET leg takes no limitPrice, and a limitPrice returns a 400. A LIMIT leg requires limitPrice, the resting limit price. A LIMIT leg without it returns a 400.

placeTwapOrder

Places a TWAP parent order that executes over a fixed duration via the twapOrder exchange action. randomize is the only TWAP knob exposed to callers — sub-order cadence and the slippage cap are fixed venue-side. Builder fees attach only to the builder field on a regular order; the TWAP action’s wire omits that field entirely. durationSeconds must be a whole number of minutes (a multiple of 60) between 300 and 604800 seconds (5 minutes–7 days) — the venue’s wire only carries whole minutes. On a Submitted or Accepted result, ActionResult.twapId carries the string form of Hyperliquid’s numeric TWAP identifier, read from the ack’s status.running.twapId; a TWAP parent’s identity lives entirely on that twapId channel, so this action never returns an orderId.

cancelOrder

Cancels one or more open orders or trigger orders by ID. ids are Hyperliquid numeric order ids (oid) as strings. The backend resolves each order’s market from an order-status lookup; assetId is a Lighter-only field and is ignored on Hyperliquid.

cancelTwapOrder

Cancels a running TWAP parent by id via the twapCancel exchange action. market is required because the cancel wire is keyed by asset id, and asset resolution for a twapId is only possible with that market context supplied by the caller; twapId is the string form of the numeric id returned from placeTwapOrder.

modifyOrder

Modifies existing orders in-place — change price, size, or trigger parameters without cancelling and re-placing.

updateLeverage

Changes the leverage setting for an asset. This affects new orders and existing positions on that asset.

updatePositionMargin

Adds or removes margin on an isolated position. Use this to adjust liquidation price without changing the position size.

sendAsset

Transfers collateral between Hyperliquid dexes: the default perps dex, HIP-3 dexes such as xyz, and spot. For example, moving USDC from the default dex to the xyz dex. The destination is always the user’s own address. collateral is the canonical Asset.id; for Hyperliquid spot tokens that is the token index as a string, never a symbol. sourceDex and destinationDex are category ids from provider.categories (hyperliquid or '' for the main dex, HIP-3 names such as xyz, and spot). Sub-accounts are not supported.

revokeSessionAgent

Removes the session agent the SDK signs with. It is the revoke action of the approveAgent setup step. The SDK fills agentAddress from the agent it stores. After the revoke, the agent key is unusable, and approveAgent stages again.

revokeBuilderFee

Revokes the builder fee approval that approveBuilderFee creates, by approving the fee again at a 0% maximum rate. It is the revoke action of that setup step. Trading through LI.FI needs the approval again before the next order.
Withdrawals are not part of the trading actions — they require a direct user signature and are documented separately. See Withdrawals.

Limits & validation

Spot markets differ from perps: On an isolated-only market (onlyIsolated on PerpsMarket), marginMode: CROSS is rejected. randomize on placeTwapOrder randomizes each sub-order size by up to ±20%.

categories

The categories array on the provider lists all trading categories. Each category’s id is used as the categoryId field in MarketRef. The list is built dynamically from Hyperliquid’s perpDexs endpoint at request time, so it always reflects the current set of active venues — including every active HIP-3 sub-dex. A typical response looks like:
The set of HIP-3 sub-dexes changes as new venues launch — names and quote assets are not stable. Always read the live GET /providers response (or getProviders() from the SDK) to discover the current set of categories and their quote assets, rather than hard-coding values from this page.