{"uid":"cap_z9DHwlNs5xM_sWMxu1MBo","slug":"chainhilt-hyperliquid-isolated-margin-update-preview-43c3d5f9","name":"ChainHilt Hyperliquid Isolated Margin Update (Preview)","description":"Add or remove isolated margin for a perp asset. ntli is a signed integer in millionths of USD: 1000000 adds 1 USD; -1000000 removes 1 USD. isBuy defaults to true. Sign and submit unchanged to the returned submitPath (unpaid). Errors: 400 invalid input; execution may return 422 exchange rejection or 502 provider failure. Treat spot and perp as one balance only when the account abstraction mode is \"unifiedAccount\".","url":"https://chainhilt.ai/api/v1/perp/hyperliquid/isolated-margin/preview?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"nonce":{"type":"integer","minimum":0,"description":"Action nonce in milliseconds since the epoch; defaults to the current time."},"action":{"type":"object","required":["type","asset","ntli"],"properties":{"ntli":{"type":"integer","description":"Signed margin delta in millionths of USD"},"type":{"type":"string","const":"updateIsolatedMargin","description":"Always \"updateIsolatedMargin\"."},"asset":{"type":"integer","minimum":0,"description":"Perp asset ID"},"isBuy":{"type":"boolean","const":true,"default":true,"description":"Always true; Hyperliquid ignores it until hedge mode exists."}},"description":"Isolated margin update action.","additionalProperties":false},"expiresAfter":{"type":"integer","minimum":0,"description":"Millisecond timestamp after which Hyperliquid rejects the action. Signed with the action."},"vaultAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Vault or subaccount to act for; omit to act for the signer. Signed with the action."},"accountAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Signing account's address, returned as response metadata; not part of the signed action."}}},"responseSchema":{"type":"json","example":{"response":{"errors":[],"actions":[{"data":{"nonce":1710000000000,"action":{"ntli":1000000,"type":"updateIsolatedMargin","asset":0,"isBuy":true},"typedData":{"types":{"Agent":[{"name":"source","type":"string"},{"name":"connectionId","type":"bytes32"}],"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}]},"domain":{"name":"Exchange","chainId":1337,"version":"1","verifyingContract":"0x0000000000000000000000000000000000000000"},"message":{"source":"a","connectionId":"0xd7c39d33dc8819b6fe099b0f730b7455d326ffcc6bc1a4cc6580a7ced5f9d1ac"},"primaryType":"Agent"}},"type":"signature","chainId":42161,"protocol":"hyperliquid","submitPath":"/perp/hyperliquid/isolated-margin/execute"}],"warnings":[]}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_t7ePk1rU3_qdfdDO3cG2X","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Prepares a signed EIP-712 action to add or remove isolated margin for a Hyperliquid perpetual asset, returning an unsigned payload ready for submission.","exampleAgentPrompt":"Add 5 USD of isolated margin to Hyperliquid perp asset ID 0 for my account 0xAbCd...1234 — give me the unsigned payload I can sign and submit.","exampleUseCases":[{"title":"Increase margin on leveraged BTC perp","prompt":"I'm worried about liquidation on my BTC perp — add 50 USD of isolated margin to asset ID 0 on Hyperliquid for my wallet 0xAbCd1234...5678 and prepare the action for signing."},{"title":"Reduce excess collateral on idle perp","prompt":"I have too much margin locked up in my ETH perp position on Hyperliquid. Remove 10 USD of isolated margin from asset ID 1 for account 0xDeAd...BeeF and get me the payload to submit."},{"title":"Automated margin top-up via vault subaccount","prompt":"Top up isolated margin by 2 USD on Hyperliquid perp asset ID 3 for my vault at 0xVault...0000 — preview the action so I can sign and submit it without touching my main account."}],"resultDescription":"Returns a JSON object containing an actions array with an EIP-712 typed data payload (domain, types, message, primaryType), the original action parameters (asset, ntli, nonce), the target chain ID (42161 for Arbitrum), the protocol identifier ('hyperliquid'), and a submitPath pointing to the execution endpoint where the signed payload should be sent. Also includes any errors or warnings from validation.","failureModes":["400 Bad Request: invalid input (e.g. missing required fields, malformed asset ID or ntli value)","422 Unprocessable Entity: Hyperliquid exchange rejection (e.g. insufficient balance, invalid asset, position not in isolated mode)","502 Bad Gateway: upstream Hyperliquid provider failure or timeout","Submitting to wrong path or with modified payload causes signature verification failure on-chain","Using ntli values not in millionths of USD results in incorrect margin amounts"],"whenToPreferThis":"Use this endpoint when you need to adjust isolated margin on a Hyperliquid perpetual position and want a fully prepared, EIP-712-compliant unsigned payload ready for signing — without managing raw Hyperliquid API calls yourself. Prefer this over direct Hyperliquid API calls when operating in an x402 agent context with no API key management, or when routing through a vault/subaccount. Not for cross-margin adjustments (use the leverage/cross endpoint) or spot balance management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-16T18:39:40.158Z","isFirstParty":false,"canonicalSlug":"chainhilt-hyperliquid-isolated-margin-update-preview-43c3d5f9"}