Update isolated margin
Hyperliquid node API
Update isolated margin | Hyperliquid exchange
Adds or removes margin from an isolated perpetual position on the Hyperliquid exchange. Chainstack Hyperliquid exchange reference.
POST
Update isolated margin
You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See Hyperliquid methods for the full availability breakdown.
This endpoint requires signature authentication. See our comprehensive Authentication via Signatures guide for implementation details.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
Required parameters
-
action(object, required) — The update isolated margin action object containing:type(string) — Must be"updateIsolatedMargin"or"topUpIsolatedOnlyMargin"- For
"updateIsolatedMargin":asset(number) — Asset index of the coinisBuy(boolean) —true(reserved for future hedge mode support)ntli(number) — Amount to add (positive) or remove (negative) in USDC with 6 decimals (e.g., 1000000 = 1 USDC)
- For
"topUpIsolatedOnlyMargin":asset(number) — Asset index of the coinleverage(string) — Target leverage as a float string (e.g., “5.0”)
-
nonce(number, required) — Current timestamp in milliseconds (must be recent) -
signature(object, required) — EIP-712 signature of the action
Optional parameters
vaultAddress(string, optional) — Address when trading on behalf of a vault or subaccountexpiresAfter(number, optional) — Timestamp in milliseconds after which the request is rejected
Margin adjustment types
Direct USDC adjustment
Use"updateIsolatedMargin" to add or remove a specific USDC amount:
- Positive
ntli— Adds margin to the position - Negative
ntli— Removes margin from the position
Target leverage adjustment
Use"topUpIsolatedOnlyMargin" to set a target leverage:
- Calculates required margin to achieve the specified leverage
- Only allows adding margin (top-up), not removal
Returns
Returns an object with update status:status—"ok"if successfulresponse— Contains update details:type—"default"
Example request
Response example
Important considerations
- Isolated only — This only works for isolated margin positions, not cross margin
- Position required — Must have an existing isolated position
- Removal limits — Cannot remove margin below minimum requirements
- Liquidation risk — Removing margin increases liquidation risk
Use cases
- Risk management — Add margin to reduce liquidation risk during volatility
- Capital optimization — Remove excess margin for use elsewhere
- Dynamic adjustment — Adjust position margin based on market conditions
- Leverage targeting — Set specific leverage levels for risk management
The
isBuy parameter is currently always true but is included for future hedge mode support where long and short positions can be held simultaneously.Body
application/json
Last modified on May 18, 2026