ONE hyperliquid:quote
← Receivers

hyperliquid:quote

hyperliquid family

mcp

Prepare a Hyperliquid action — order (sized in coin or in dollars, with leverage), leverage, cancel, transfer between your spot and perps, withdraw — as UNSIGNED steps: the exact action, nonce and EIP-712 typed data YOUR key signs and posts to Hyperliquid /exchange yourself. ONE signs nothing and posts nothing. An agent moving value for someone else needs its owner's co-sign

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
public
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/hyperliquid:quote \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "action": "order", "coin": "BTC", "side": "buy", "usd": "20", "leverage": 5 }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • action transfer | order | cancel | … required order · leverage (set a perp's leverage and margin mode; moves no money) · cancel · transfer (spot↔perps inside your account, with between) · withdraw (to an EVM address on Arbitrum)
  • address string optional The Hyperliquid account that acts. Absent = yours. It must be yours: only its key can sign
  • net string optional 'mainnet' (default) or 'testnet'
  • nonce number optional Millisecond timestamp from the machine that will sign (Hyperliquid's nonce). Absent = the server's clock. A second step uses nonce + 1
  • to string optional withdraw: destination 0x address, default the acting address. transfer: sending to another address (usdSend/spotSend) is refused send_unsupported — use between
  • amount string optional transfer/withdraw: USDC as a decimal string, e.g. '5' — never a number
  • token string optional transfer: USDC only (spot↔perps moves USDC)
  • between spot->perps | perps->spot optional transfer: move USDC between your own spot and perps balances
  • coin string optional order/cancel/leverage: the asset name from hyperliquid:list {of:'assets'} — 'BTC' is the perp, 'PURR/USDC' a spot pair
  • side buy | sell optional order
  • size string optional order: coin amount as a decimal string, at most the asset's szDecimals. Give size OR usd, never both
  • usd string optional order: dollars of margin as a decimal string, instead of size. size = usd × leverage ÷ price (the limit price, or the mid for a market order), rounded DOWN to the lot — never more than asked
  • leverage number optional leverage: the whole-number leverage, 1 to the asset's maxLeverage. order (perps only): set this leverage first — the answer is then TWO steps, leverage then order, nonces n and n+1
  • cross boolean optional leverage, or an order with leverage: true = cross margin, false (default) = isolated
  • price string optional order: limit price as a decimal string; absent = market (IOC at the mid ± 5% slippage)
  • reduceOnly boolean optional order: only reduce an open position
  • tif Gtc | Ioc | Alo optional order: time in force — default Gtc with a price, Ioc without one; a market order (no price) is Ioc only, anything else is refused bad_order
  • oid number optional cancel: the order id from hyperliquid:get orders

Response

What comes back from the call.

  • ok boolean true = unsigned steps prepared; false = a named refusal
  • error string bad_net · bad_action · bad_amount · bad_destination · bad_between · bad_order · bad_oid · bad_leverage · bad_nonce · usd_too_small · send_unsupported · token_unsupported · sign_in_required · bad_address · address_unknown · ambiguous_address · address_not_yours · needs_cosign · hyperliquid_unavailable · hyperliquid_region_blocked · or a core refusal by name: unknown_asset · asset_delisted · size_too_precise · price_sig_figs · price_too_precise · leverage_too_high · leverage_spot · cross_not_allowed · amount_too_precise · …
  • detail string
  • options string[]
  • network string
  • action string
  • address string The account that acts
  • mine boolean
  • prepared object The checked, normalised request the steps are built from
  • sizing object order with usd: how dollars became a size
  • steps object[] Present only when ok. One step, or two (leverage then order). Post a step only after the one before it was accepted
  • unsigned object Present only when ok AND there is exactly one step (it equals steps[0]). Absent on a two-step answer, so a caller that reads only unsigned can never post the order without its leverage step
  • cosign object needs_cosign: an agent key asked to move value on an account, or to a destination, that is not its own
  • next string One sentence: what to do now

Traffic

Every call to hyperliquid:quote, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names hyperliquid:quote, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 2
  • one.ie/web/src/lib/receiver-index.generated.ts:208
  • one.ie/web/src/lib/resolvers/hyperliquid.ts:2
→

Answered by

hyperliquid:quote one.ie/web/src/lib/resolvers/hyperliquid.ts:539 Dispatched through POST /api/ask/hyperliquid:quote, after the envelope validates the payload.

hyperliquid family · 2 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "transfer",
        "order",
        "cancel",
        "withdraw",
        "leverage"
      ],
      "description": "order · leverage (set a perp's leverage and margin mode; moves no money) · cancel · transfer (spot↔perps inside your account, with between) · withdraw (to an EVM address on Arbitrum)"
    },
    "address": {
      "description": "The Hyperliquid account that acts. Absent = yours. It must be yours: only its key can sign",
      "type": "string"
    },
    "net": {
      "description": "'mainnet' (default) or 'testnet'",
      "type": "string"
    },
    "nonce": {
      "description": "Millisecond timestamp from the machine that will sign (Hyperliquid's nonce). Absent = the server's clock. A second step uses nonce + 1",
      "type": "number"
    },
    "to": {
      "description": "withdraw: destination 0x address, default the acting address. transfer: sending to another address (usdSend/spotSend) is refused send_unsupported — use between",
      "type": "string"
    },
    "amount": {
      "description": "transfer/withdraw: USDC as a decimal string, e.g. '5' — never a number",
      "type": "string"
    },
    "token": {
      "description": "transfer: USDC only (spot↔perps moves USDC)",
      "type": "string"
    },
    "between": {
      "description": "transfer: move USDC between your own spot and perps balances",
      "type": "string",
      "enum": [
        "spot->perps",
        "perps->spot"
      ]
    },
    "coin": {
      "description": "order/cancel/leverage: the asset name from hyperliquid:list {of:'assets'} — 'BTC' is the perp, 'PURR/USDC' a spot pair",
      "type": "string"
    },
    "side": {
      "description": "order",
      "type": "string",
      "enum": [
        "buy",
        "sell"
      ]
    },
    "size": {
      "description": "order: coin amount as a decimal string, at most the asset's szDecimals. Give size OR usd, never both",
      "type": "string"
    },
    "usd": {
      "description": "order: dollars of margin as a decimal string, instead of size. size = usd × leverage ÷ price (the limit price, or the mid for a market order), rounded DOWN to the lot — never more than asked",
      "type": "string"
    },
    "leverage": {
      "description": "leverage: the whole-number leverage, 1 to the asset's maxLeverage. order (perps only): set this leverage first — the answer is then TWO steps, leverage then order, nonces n and n+1",
      "type": "number"
    },
    "cross": {
      "description": "leverage, or an order with leverage: true = cross margin, false (default) = isolated",
      "type": "boolean"
    },
    "price": {
      "description": "order: limit price as a decimal string; absent = market (IOC at the mid ± 5% slippage)",
      "type": "string"
    },
    "reduceOnly": {
      "description": "order: only reduce an open position",
      "type": "boolean"
    },
    "tif": {
      "description": "order: time in force — default Gtc with a price, Ioc without one; a market order (no price) is Ioc only, anything else is refused bad_order",
      "type": "string",
      "enum": [
        "Gtc",
        "Ioc",
        "Alo"
      ]
    },
    "oid": {
      "description": "cancel: the order id from hyperliquid:get orders",
      "type": "number"
    }
  },
  "required": [
    "action"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean",
      "description": "true = unsigned steps prepared; false = a named refusal"
    },
    "error": {
      "description": "bad_net · bad_action · bad_amount · bad_destination · bad_between · bad_order · bad_oid · bad_leverage · bad_nonce · usd_too_small · send_unsupported · token_unsupported · sign_in_required · bad_address · address_unknown · ambiguous_address · address_not_yours · needs_cosign · hyperliquid_unavailable · hyperliquid_region_blocked · or a core refusal by name: unknown_asset · asset_delisted · size_too_precise · price_sig_figs · price_too_precise · leverage_too_high · leverage_spot · cross_not_allowed · amount_too_precise · …",
      "type": "string"
    },
    "detail": {
      "type": "string"
    },
    "options": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "network": {
      "type": "string"
    },
    "action": {
      "type": "string"
    },
    "address": {
      "description": "The account that acts",
      "type": "string"
    },
    "mine": {
      "type": "boolean"
    },
    "prepared": {
      "description": "The checked, normalised request the steps are built from",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "sizing": {
      "description": "order with usd: how dollars became a size",
      "type": "object",
      "properties": {
        "usd": {
          "type": "string"
        },
        "leverage": {
          "type": "number"
        },
        "price": {
          "type": "string",
          "description": "The price the dollars were divided by"
        },
        "priceSource": {
          "type": "string",
          "description": "mid (market order) · limit (the order's own price)"
        },
        "size": {
          "type": "string",
          "description": "Coin amount, rounded down to the lot"
        }
      },
      "required": [
        "usd",
        "leverage",
        "price",
        "priceSource",
        "size"
      ]
    },
    "steps": {
      "description": "Present only when ok. One step, or two (leverage then order). Post a step only after the one before it was accepted",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "step": {
            "type": "number",
            "description": "1-based; sign and post in this order"
          },
          "what": {
            "type": "string",
            "description": "updateLeverage · order · cancel · usdClassTransfer · withdraw3"
          },
          "signer": {
            "type": "string",
            "description": "l1 (phantom agent: order · cancel · updateLeverage) · user (EIP-712 user-signed: usdClassTransfer · withdraw3)"
          },
          "action": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "The Hyperliquid /exchange action object, exactly"
          },
          "nonce": {
            "type": "number"
          },
          "typedData": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "types": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              },
              "primaryType": {
                "type": "string"
              },
              "message": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "required": [
              "domain",
              "types",
              "primaryType",
              "message"
            ]
          },
          "digest": {
            "type": "string",
            "description": "The EIP-712 digest a raw secp256k1 key signs"
          },
          "words": {
            "type": "string",
            "description": "One sentence, written from the action that will be signed"
          },
          "exchangeUrl": {
            "type": "string"
          },
          "posted": {
            "type": "boolean",
            "description": "Always false: ONE never posts"
          }
        },
        "required": [
          "step",
          "what",
          "signer",
          "action",
          "nonce",
          "typedData",
          "digest",
          "words",
          "exchangeUrl",
          "posted"
        ]
      }
    },
    "unsigned": {
      "description": "Present only when ok AND there is exactly one step (it equals steps[0]). Absent on a two-step answer, so a caller that reads only unsigned can never post the order without its leverage step",
      "type": "object",
      "properties": {
        "action": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {},
          "description": "The Hyperliquid /exchange action object, exactly"
        },
        "nonce": {
          "type": "number",
          "description": "Millisecond nonce; Hyperliquid refuses a reused or stale one"
        },
        "signer": {
          "type": "string",
          "description": "user (EIP-712 user-signed: transfer · withdraw) · l1 (phantom-agent: order · cancel · leverage)"
        },
        "typedData": {
          "type": "object",
          "properties": {
            "domain": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            "types": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            "primaryType": {
              "type": "string"
            },
            "message": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "required": [
            "domain",
            "types",
            "primaryType",
            "message"
          ],
          "description": "Pass to eth_signTypedData_v4 with the acting address's key, then POST {action, nonce, signature} to Hyperliquid /exchange"
        },
        "digest": {
          "type": "string"
        },
        "words": {
          "type": "string"
        },
        "exchangeUrl": {
          "type": "string"
        }
      },
      "required": [
        "action",
        "nonce",
        "signer",
        "typedData"
      ]
    },
    "cosign": {
      "description": "needs_cosign: an agent key asked to move value on an account, or to a destination, that is not its own",
      "type": "object",
      "properties": {
        "required": {
          "type": "boolean"
        },
        "who": {
          "type": "string"
        },
        "why": {
          "type": "string"
        },
        "proposal": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {},
          "description": "What the owner is asked to approve"
        },
        "notified": {
          "type": "boolean",
          "description": "false today: human:notify posts only from a workflow run — carry the proposal in a path with a human step"
        },
        "notifyNote": {
          "type": "string"
        }
      },
      "required": [
        "required",
        "who",
        "why",
        "proposal",
        "notified",
        "notifyNote"
      ]
    },
    "next": {
      "type": "string",
      "description": "One sentence: what to do now"
    }
  },
  "required": [
    "ok",
    "network",
    "next"
  ]
}