{"uid":"cap_mXGBI2AQ_MT6-2hLvTmY2","slug":"chainhilt-hyperliquid-perp-leverage-preview-ce6c467d","name":"ChainHilt Hyperliquid Perp Leverage Preview","description":"Discover, pay for, and execute the on-chain actions your agent needs. No API keys. Compatible with x402. Your wallet stays local.","url":"https://chainhilt.ai/api/v1/perp/hyperliquid/leverage/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","isCross","leverage"],"properties":{"type":{"type":"string","const":"updateLeverage","description":"Always \"updateLeverage\"."},"asset":{"type":"integer","minimum":0,"description":"Perp asset ID"},"isCross":{"type":"boolean","description":"true for cross margin, false for isolated."},"leverage":{"type":"integer","description":"Integer leverage; market limits apply","exclusiveMinimum":0}},"description":"Leverage 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":{"type":"updateLeverage","asset":0,"isCross":true,"leverage":5},"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":"0x1b6c24cfbc406e6ceef5dfa941dcdabe39aa07e6fe967545327c1c4c29bc8b20"},"primaryType":"Agent"}},"type":"signature","chainId":42161,"protocol":"hyperliquid","submitPath":"/perp/hyperliquid/leverage/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_ocfA7325l0WAN545IlTOS","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":"Generates an unsigned EIP-712 typed-data payload to update cross or isolated leverage for a Hyperliquid perpetual asset, ready for L1 signing and submission.","exampleAgentPrompt":"Prepare a leverage update for Hyperliquid perp asset 0 — set it to 5x cross margin using my account 0x1234...abcd so I can sign and submit it.","exampleUseCases":[{"title":"Switch ETH-PERP to cross margin","prompt":"I want to change my ETH-PERP position on Hyperliquid to cross margin at 10x leverage — prepare the unsigned payload for my account 0xAbCd...1234 so I can sign it."},{"title":"Lower leverage before volatile event","prompt":"Before the Fed announcement, lower my leverage on perp asset 3 to 2x isolated margin on Hyperliquid — give me the EIP-712 payload to sign with my account 0xDEAD...BEEF."},{"title":"Automate leverage reset in trading bot","prompt":"My trading bot needs to reset perp asset 1 on Hyperliquid to 20x isolated leverage every session — generate the unsigned leverage update action for account 0x9999...AAAA with nonce 1710000005000."}],"resultDescription":"Returns an EIP-712 typed-data object (domain, types, message, primaryType) bundled with the original action payload and a submitPath pointing to /perp/hyperliquid/leverage/execute. The agent must sign this typed data unchanged and POST it to the execute endpoint to apply the leverage change on-chain. Any validation errors or exchange rejections are surfaced in the errors array before signing occurs.","failureModes":["400 Bad Request — invalid input such as leverage <= 0, missing required fields, or malformed address","422 Unprocessable Entity — exchange rejected the action (e.g. leverage exceeds market maximum)","502 Bad Gateway — upstream Hyperliquid provider failure or timeout"],"whenToPreferThis":"Use this endpoint when you need to change cross/isolated margin mode or leverage level for a Hyperliquid perpetual asset via an agent that holds an EIP-712 signing key. It is a preview-only step (no state change until execute is called), making it safe for validation before committing. Prefer this over direct exchange API calls when operating under x402 micropayment auth and no API key management is desired.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-16T12:38:37.709Z","isFirstParty":false,"canonicalSlug":"chainhilt-hyperliquid-perp-leverage-preview-ce6c467d"}