{"uid":"cap_Roc5cChL2WhvT3_nj1euy","slug":"chainhilt-hyperliquid-perp-order-modify-preview-bc187b48","name":"ChainHilt Hyperliquid Perp Order Modify Preview","description":"Prepare a single-order modification by OID or CLOID for L1 signing. Supply the full replacement order. Omit action.a unless true. Sign and submit unchanged using the returned submitPath. See /skills.md for signing rules. 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/order/modify/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","oid","order"],"properties":{"a":{"type":"boolean","const":true,"description":"true sets always_place: place the replacement even if the cancel fails. Omit when false."},"oid":{"anyOf":[{"type":"integer","minimum":0},{"type":"string","pattern":"^0x[a-fA-F0-9]+$","maxLength":34,"minLength":34}],"description":"Order to modify: numeric order ID or 128-bit hex CLOID."},"type":{"type":"string","const":"modify","description":"Always \"modify\"."},"order":{"type":"object","required":["a","b","p","s","r","t"],"properties":{"a":{"type":"integer","minimum":0,"description":"Asset ID from /perp/hyperliquid/asset-id: perp index, or 10000 + spot index."},"b":{"type":"boolean","description":"true to buy, false to sell."},"c":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","maxLength":34,"minLength":34,"description":"Client order ID: 128-bit hex string, e.g. 0x1234567890abcdef1234567890abcdef."},"p":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Limit price as a decimal string."},"r":{"type":"boolean","description":"true for reduce-only."},"s":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Size as a decimal string, rounded to the asset's szDecimals."},"t":{"anyOf":[{"type":"object","required":["limit"],"properties":{"limit":{"type":"object","required":["tif"],"properties":{"tif":{"enum":["Gtc","Alo","Ioc"],"type":"string","description":"Alo (post only), Ioc (immediate or cancel) or Gtc (good til canceled)."}},"description":"Limit order.","additionalProperties":false}},"additionalProperties":false},{"type":"object","required":["trigger"],"properties":{"trigger":{"type":"object","required":["isMarket","triggerPx","tpsl"],"properties":{"tpsl":{"enum":["tp","sl"],"type":"string","description":"\"tp\" for take profit, \"sl\" for stop loss."},"isMarket":{"type":"boolean","description":"true to execute as a market order when triggered."},"triggerPx":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Trigger price as a decimal string."}},"description":"Trigger (take profit or stop loss) order.","additionalProperties":false}},"additionalProperties":false}],"description":"Order type: { limit: { tif } } or { trigger: { isMarket, triggerPx, tpsl } }."}},"description":"Full replacement order.","additionalProperties":false}},"description":"Modify 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":{"oid":77738308,"type":"modify","order":{"a":0,"b":true,"p":"60000","r":false,"s":"0.01","t":{"limit":{"tif":"Alo"}}}},"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":"0xecc4008216404a48fb30f643dc58504d58c29c602c45594d3485e2b681a79827"},"primaryType":"Agent"}},"type":"signature","chainId":42161,"protocol":"hyperliquid","submitPath":"/perp/hyperliquid/order/modify/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_R9YbnorFkzoRi8vTzrDAg","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 single Hyperliquid perpetual order modification (by OID or CLOID) for L1 signing, returning typed EIP-712 data and the submit path for execution.","exampleAgentPrompt":"Prepare a modification for my Hyperliquid perp order OID 77738308 — I want to change it to a buy limit order for 0.01 BTC at $60,000 with ALO time-in-force on asset index 0, reduce-only false, using my account 0xAbCd...1234.","exampleUseCases":[{"title":"Reprice an open limit order","prompt":"I have an open GTC long limit order on Hyperliquid with OID 12345678 for 0.5 ETH at $3,200 and I want to bump the price up to $3,350 — can you prepare the signed modify payload so I can update it?"},{"title":"Tighten a stop-loss trigger","prompt":"My stop-loss on Hyperliquid perp OID 99001122 is set at $58,000 trigger price, please prepare a modification to move it to $59,500 as a market trigger stop-loss so I can sign and submit it."},{"title":"Adjust size on a vault order","prompt":"For the vault at 0xDEaDbEEf000000000000000000000000DeAdbEEf, modify Hyperliquid perp order OID 55667788 to reduce the size from 1.0 to 0.25 BTC keeping the same buy limit price of $62,000 GTC — give me the EIP-712 payload to sign."}],"resultDescription":"Returns an array of actions each containing: the reconstructed action object (type='modify', oid, full replacement order), EIP-712 typedData (domain, types, message, primaryType) for L1 signing, the nonce used, the chainId (42161 for Arbitrum), the protocol ('hyperliquid'), a submitPath to pass the signed result to for execution, plus any warnings or errors encountered.","failureModes":["Invalid OID or CLOID format returns validation error","Missing required order fields (a, b, p, s, r, t) returns schema error","Invalid price or size string pattern returns parsing error","Unsupported time-in-force enum value returns rejection","Vault address does not match account permissions returns authorization error","Nonce out of valid range causes rejection","Order type conflict (limit vs trigger) returns schema mismatch error"],"whenToPreferThis":"Use this endpoint when you need to modify a single existing Hyperliquid perpetual order and require EIP-712 typed data for L1 signing before submission. It is the preview step in a two-step modify flow (preview → execute). Prefer it over direct submission endpoints when you need to inspect or display the signing payload before committing, or when implementing an agent that must handle the signing step separately from execution.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-16T18:37:45.932Z","isFirstParty":false,"canonicalSlug":"chainhilt-hyperliquid-perp-order-modify-preview-bc187b48"}