# ChainHilt Hyperliquid Isolated Margin Update (Preview)

> ChainHilt Hyperliquid Isolated Margin Update (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 signed EIP-712 action to add or remove isolated margin for a Hyperliquid perpetual asset, returning an unsigned payload ready for submission.

## Facts

- Endpoint: POST https://chainhilt.ai/api/v1/perp/hyperliquid/isolated-margin/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-isolated-margin-update-preview-43c3d5f9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_z9DHwlNs5xM_sWMxu1MBo

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-isolated-margin-update-preview-43c3d5f9 -d '<json body>'
```

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

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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

## Output

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.

## 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",
    "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."
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainhilt-hyperliquid-isolated-margin-update-preview-43c3d5f9/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)
