# ChainHilt Hyperliquid Perp Order Modify Preview

> ChainHilt Hyperliquid Perp Order Modify Preview is a paid API for AI agents from chainhilt.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-16).

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.

## Facts

- Endpoint: POST https://chainhilt.ai/api/v1/perp/hyperliquid/order/modify/preview?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainhilt-hyperliquid-perp-order-modify-preview-bc187b48
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Roc5cChL2WhvT3_nj1euy

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chainhilt-hyperliquid-perp-order-modify-preview-bc187b48 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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".

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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 (goo
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "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": []
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainhilt-hyperliquid-perp-order-modify-preview-bc187b48/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chainhilt.ai](https://www.zero.xyz/host/chainhilt.ai/llms.txt)
