Unseen MoneyElysiumDocsBlogLaunch TerminalTerminal
DocumentationAPI
Using Unseen Money
Developers
Developers

API

Execute through Unseen Money Vault from your own code. Your bot signs orders with its API account's key and a relayer submits them to the pool. JSON over HTTPS, with no sign-up and no token: the signature is the authorization.

The API account

A bot trades a separate account in Unseen Money Vault, the API account, opened with your alias on the API trading page. Fund it there from your private balance with what the bot should trade, and withdraw it back there. The page also shows its key and the quickstart below.

Its key signs the bot's orders. It can trade and withdraw the API account and nothing else: not your alias and not your private balance. Keep it on the server that runs the bot. The same wallet always opens the same key, so if it leaks, withdraw what the API account holds.

What is public

Every account's balance, positions and orders are public in the pool's ledger on HyperEVM, and the API account is no exception. What is not on chain is whose it is: it is funded from your private balance through one-time addresses, like the alias. The relayer sees the IP address your bot calls from, as any server does.

Quickstart

A whole bot in TypeScript with viem alone. It buys the pool's smallest order at the market, stores a take-profit and a stop as a pair, reads them back, cancels both and closes the position. It sizes and prices each order from the market it reads, so it runs on any market. The API trading page shows the same file.

bot.mts
// bot.mts: buys at the market, stores a take-profit and a stop as a pair, reads them back, cancels them and// closes the position, through Unseen Money Vault's relayer.// npm i viem, then: API_KEY=0x... node bot.mts   (Node 22.18 or later, or npx tsx bot.mts)// MARKET=1 node bot.mts trades another market. GET /v2/markets lists them by id.import { formatUnits, type Hex } from "viem";import { privateKeyToAccount } from "viem/accounts"; const RELAYER = "https://pool-production-964782a3.up.railway.app";const POOL = "0xdB793f57d351595072296b59A2fCD66e7f56532B"; // a signature is good for this pool only (checksummed: the signed read names it so)const MARKET = Number(process.env.MARKET ?? 0); // 0 is BTCconst account = privateKeyToAccount(process.env.API_KEY as Hex); // your API account's key // The pool's EIP-712 domain and types, exactly as the contract checks them.const domain = { name: "Unseen Perps", version: "2", chainId: 999, verifyingContract: POOL } as const;const orderTypes = {  Order: [    { name: "account", type: "address" },    { name: "market", type: "uint32" },    { name: "isBuy", type: "bool" },    { name: "size", type: "uint64" },    { name: "limitPx", type: "uint64" },    { name: "reduceOnly", type: "bool" },    { name: "triggerPx", type: "uint64" },    { name: "triggerAbove", type: "bool" },    { name: "nonce", type: "uint64" },    { name: "deadline", type: "uint64" },    { name: "relayerFee", type: "uint256" },    { name: "relayer", type: "address" },  ],} as const;const cancelTypes = {  CancelOrder: [    { name: "account", type: "address" },    { name: "nonce", type: "uint64" },  ],} as const; // JSON in and out. Every integer goes as a decimal string.async function get(path: string, headers: Record<string, string> = {}) {  return (await fetch(RELAYER + path, { headers })).json();}async function post(path: string, body: object) {  const res = await fetch(RELAYER + path, {    method: "POST",    headers: { "content-type": "application/json" },    body: JSON.stringify(body, (_, v) => (typeof v === "bigint" ? v.toString() : v)),  });  const answer = await res.json();  if (!res.ok) throw new Error(res.status + " " + (answer.errorName ?? "") + " " + answer.error);  return answer;}// Your stored orders are shown only to you: a read signed by your key, good for 5 minutes, in the x-unseen-read header.async function readHeader() {  const at = Math.floor(Date.now() / 1000);  const message = "Unseen Money relayer: read my orders\nchain 999\npool " + POOL + "\naccount " + account.address + "\nat " + at;  return { "x-unseen-read": at + "." + (await account.signMessage({ message })) };} const now = () => BigInt(Math.floor(Date.now() / 1000));const nonce = () => crypto.getRandomValues(new BigUint64Array(1))[0]; // random, never used twice // The keeper sends every order to the pool. Each order names it as its relayer, so it alone can submit it.const { keeper } = await get("/v2/health"); // The market as the keeper read it this second. A size is in lots (size × 10^szDecimals), a price in px// (price × 10^(6 - szDecimals)), so lots × px is a notional in usd6 (millionths of a dollar).async function quote() {  const { params, markets } = await get("/v2/markets");  const m = markets.find((x: { asset: number }) => x.asset === MARKET);  if (!m) throw new Error("Market " + MARKET + " is not listed on this pool.");  return { params, szDecimals: m.market.szDecimals as number, mark: BigInt(m.markPx), bid: BigInt(m.bid), ask: BigInt(m.ask) };} // A market order's limit must allow twice the pool's band past the book (2 × bandBps), or the pool refuses it// (LimitNotMet). `extra` bps more cover the book moving before the order is in. The fill stays within one band of the// book, never past the limit.function marketLimit(q: Awaited<ReturnType<typeof quote>>, isBuy: boolean, extra = 25n): bigint {  const room = 2n * BigInt(q.params.bandBps) + extra;  if (isBuy) return ((q.ask > q.mark ? q.ask : q.mark) * (10_000n + room) + 9_999n) / 10_000n;  return ((q.bid < q.mark ? q.bid : q.mark) * (10_000n - room)) / 10_000n;} // Signs an order and hands it to the relayer. With triggerPx 0 it goes now; with a trigger the relayer stores it// and sends it once Hyperliquid's mark reaches it.async function order(o: { isBuy: boolean; size: bigint; limitPx: bigint; reduceOnly?: boolean; triggerPx?: bigint; triggerAbove?: boolean; life?: bigint; group?: string }) {  const message = {    account: account.address,    market: MARKET,    isBuy: o.isBuy,    size: o.size,    limitPx: o.limitPx,    reduceOnly: o.reduceOnly ?? false,    triggerPx: o.triggerPx ?? 0n,    triggerAbove: o.triggerAbove ?? false,    nonce: nonce(),    deadline: now() + (o.life ?? 300n), // at least 90 s after the pool takes it    relayerFee: 0n,    relayer: keeper,  };  const signature = await account.signTypedData({ domain, types: orderTypes, primaryType: "Order", message });  const link = o.group ? { group: o.group } : undefined;  return { ...(await post("/v2/orders", { order: message, signature, link })), nonce: message.nonce };} // The account: equity, free margin, positions and its pending order. One order is pending at a time: once// order.pending is false the last order is done, and the position shows its fill.async function settled() {  for (;;) {    const { state } = await get("/v2/account/" + account.address);    if (state && !state.order.pending) return state;    await new Promise((r) => setTimeout(r, 1_000));  }}const held = (state: { positions: { market: number; size: string }[] }) => BigInt(state.positions.find((p) => p.market === MARKET)?.size ?? 0); // 1. A size worth the pool's minimum order (minOrderUsd) at the mark and a quarter more, rounded up to a whole lot.let q = await quote();const size = (BigInt(q.params.minOrderUsd) * 125n / 100n + q.mark - 1n) / q.mark;const coins = (lots: bigint) => formatUnits(lots, q.szDecimals);const before = held(await settled()); // 2. Buy at the market: { status: "submitted", hash }. It fills in the market's next batch, within seconds.console.log(await order({ isBuy: true, size, limitPx: marketLimit(q, true) }));const after = await settled();const bought = held(after) - before;if (bought <= 0n) throw new Error("Not filled: the book moved past the limit. Run it again.");console.log("bought " + coins(bought) + ", equity " + after.equity + " usd6, free " + after.free + " usd6"); // 3. A take-profit 5% above the mark and a stop 5% below, each selling what was bought, reduce-only. The relayer stores//    them until the mark gets there: { status: "stored" }. One group: once one of them fills, the other is dropped.const group = "bot-" + Date.now();const tpPx = (q.mark * 105n) / 100n;const slPx = (q.mark * 95n) / 100n;const tp = await order({ isBuy: false, size: bought, reduceOnly: true, triggerPx: tpPx, triggerAbove: true, limitPx: (tpPx * 95n) / 100n, life: 30n * 86_400n, group });const sl = await order({ isBuy: false, size: bought, reduceOnly: true, triggerPx: slPx, triggerAbove: false, limitPx: (slPx * 95n) / 100n, life: 30n * 86_400n, group });console.log(tp, sl); // 4. Read them back. Only a read signed by your key sees them, under triggers, with their tries and last error.const mine = await get("/v2/account/" + account.address, await readHeader());console.log("stored orders:", mine.triggers.length); // 5. Cancel both by nonce. Only cancelled: true means it can never run. ran: it ran first (see the account's history).//    sent: a submit of it is out and may still fill until its deadline, so place no replacement before that is over.async function cancel(nonce: bigint) {  const message = { account: account.address, nonce };  const signature = await account.signTypedData({ domain, types: cancelTypes, primaryType: "CancelOrder", message });  const answer = await post("/v2/orders/cancel", { ...message, signature });  if (answer.cancelled) return "cancelled";  if (answer.ran) return "it ran before the cancel";  if (answer.sent) return "a submit of it is out: it may still fill";  return "not stored: it ran, was dropped or expired";}console.log("take-profit:", await cancel(tp.nonce), "/ stop:", await cancel(sl.nonce)); // 6. Close: the other side, reduce-only, priced from the book as it is now. A close needs no margin, so its limit can//    leave more room (1.5%) at no cost.q = await quote();console.log(await order({ isBuy: false, size: bought, limitPx: marketLimit(q, false, 150n), reduceOnly: true }));const left = held(await settled());console.log(left === before ? "closed" : "still holding " + coins(left) + ": the close was not filled, run it again"); 

Save it as bot.mts, run npm i viem, then API_KEY=0x… node bot.mts with Node 22.18 or later. MARKET=1 trades ETH instead of BTC. For a stock, set RELAYER and POOL to the stock pool's below, and MARKET to the stock's id.

Base URLs

Crypto
Relayer
https://pool-production-964782a3.up.railway.app
Stocks
Relayer
https://pool-stocks-production.up.railway.app

The pool contracts are on HyperEVM, chain 999. Every write is a message signed by the account. A request from a server, which sends no Origin header, is taken as it is; a browser can post only from this site. The relayer pays the gas.

Endpoints

JSON in and out. Integers are decimal strings both ways: a JSON number is taken only up to 253, and a nonce or a deadline can be larger, so send strings. Booleans are booleans, addresses hex. A write that sends a transaction answers once it is mined. The examples are real requests and answers from the relayer run on a test chain, where BTC is at 100,000.0; signatures are shortened.

  • GET/v2/health

    200 while the relayer can take orders, 503 otherwise, with why. keeper is the address your orders name as their relayer (Signing). features lists what this relayer does beyond the first API: groups while it pairs stored orders.

    Example
    Request
    GET /v2/health
    Answer
    {  "ok": true,  "running": true,  "gasLow": false,  "failing": false,  "readOnly": false,  "features": ["head", "groups"],  "keeper": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",  "keeperHype": "9999992705713838884785",  "pool": "0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae",  "block": "548",  "paused": false,  "coreReady": true,  …}
  • GET/v2/markets

    Every listed market as the keeper read it this second, with its mark, bid and ask, size decimals and margins, and the pool's parameters, bandBps and minOrderUsd among them. Markets go by id: Units says how to name them.

    Example
    Request
    GET /v2/markets
    Answer
    {  "block": "552",  "time": 1796104915,  "paused": false,  "coreReady": true,  "params": {    "feePpm": 250,    "maxRelayerFee": "1000000",    "bandBps": 20,    "maxRefDeviationBps": 50,    "minOrderUsd": "11000000",    …  },  "markets": [    {      "asset": 0,      "waiting": 0,      "market": {        "asset": 0,        "szDecimals": 5,        "maxLeverage": 40,        "imBps": 1000,        "mmBps": 500,        "closed": 0,        "maxAccountNotional": "1000000000000000",        …      },      "markPx": "1000000",      "oraclePx": "1000000",      "bid": "999900",      "ask": "1000100",      "closeOnly": false    },    …  ],  "features": ["head", "groups"]}
  • GET/v2/account/:address

    The account's state (cash, equity, free, margins, positions, its pending order), its queued withdrawals and its depositAddress. Its stored orders only to a read signed by the account (Stored orders). head is the id of its newest history row: when it changes, there is something new to read.

    Example
    Request
    GET /v2/account/0x39fA718af6035c3b9F2F1F3Df011511673966121
    Answer
    {  "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",  "depositAddress": "0xaB4a6134CFf8bcD632e75d4Ee803F2dA99FCc825",  "state": {    "cash": "169975994",    "equity": "199975994",    "conservativeEquity": "199975994",    "notional": "30000000",    "initialMargin": "3000000",    "maintenanceMargin": "1500000",    "free": "196975994",    "liquidating": false,    "liquidatable": false,    "rewards": "0",    "order": {      "pending": false,      "inFlight": false,      "liquidation": false,      "market": 0,      "isBuy": false,      "size": "0",      "limitPx": "0"    },    "positions": [{ "market": 0, "size": "30", "markPx": "1000000", "oraclePx": "1000000" }]  },  "withdrawals": [],  "triggers": [],  "private": true,  "head": "0xd1efec2f82b308ce321959a9aeaaf330945790c58d530cd016af01d8b7db177c:1"}
  • GET/v2/account/:address/history

    The account's deposits, fills, withdrawals, liquidations and dropped orders, newest first, each fill with what its order was submitted with. limit 1 to 500 (100 by default); next is the before of the next page, null at the end. Reconcile fills here. A read signed by the account also lists the stored orders the relayer dropped, with why.

    Example
    Request
    GET /v2/account/0x39fA718af6035c3b9F2F1F3Df011511673966121/history?limit=3
    Answer
    {  "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",  "items": [    {      "id": "0xa4734d318f6f90a3dc997088e4f30485605ce31ec06a410f61b592909452f057:1",      "block": "614",      "index": "1",      "time": "1796104928",      "tx": "0xa4734d318f6f90a3dc997088e4f30485605ce31ec06a410f61b592909452f057",      "kind": "withdrawal",      "status": "paid",      "amount": "25000000",      "back": "0",      "to": "0x523FCaAe2e570cb76922a668f2D3D1D6C10542A3",      "relayerFee": "0"    },    {      "id": "0x6e60be83e2463ea1bcd8b20808972d1200fac1261092fc4ec986e525d3684afe:0",      "block": "612",      "index": "0",      "time": "1796104928",      "tx": "0x6e60be83e2463ea1bcd8b20808972d1200fac1261092fc4ec986e525d3684afe",      "szDecimals": "5",      "kind": "fill",      "market": "0",      "isBuy": false,      "size": "30",      "filled": "30",      "cash": "29983502",      "fee": "7496",      "batch": "10",      "origin": "order",      "nonce": "6842100241747298190",      "limitPx": "980901",      "reduceOnly": true,      "relayerFee": "0"    },    {      "id": "0x746da5fa61db1bb17f6b6c5f91e3dab55004b8bb1de0a678e4475bb11cffa0f9:0",      "block": "605",      "index": "0",      "time": "1796104927",      "tx": "0x746da5fa61db1bb17f6b6c5f91e3dab55004b8bb1de0a678e4475bb11cffa0f9",      "szDecimals": "5",      "kind": "fill",      "market": "0",      "isBuy": true,      "size": "30",      "filled": "30",      "cash": "30016501",      "fee": "7505",      "batch": "9",      "origin": "order",      "nonce": "14341111795451272542",      "limitPx": "1006500",      "reduceOnly": false,      "relayerFee": "0"    }  ],  "next": "605:0",  "indexed": { "to": "617", "head": "617", "synced": true },  "private": true}
  • POST/v2/orders

    An order, signed. Submitted: it is in its market's next batch. Stored: its trigger has not been reached, and the relayer keeps it until it is (Stored orders).

    { order, signature, link? }→{ status: "submitted", hash }or{ status: "stored", account, nonce }

    Examples

    A market buy

    Request
    POST /v2/orders{  "order": {    "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",    "market": 0,    "isBuy": true,    "size": "30",    "limitPx": "1006500",    "reduceOnly": false,    "triggerPx": "0",    "triggerAbove": false,    "nonce": "13239933435406533344",    "deadline": "1796105216",    "relayerFee": "0",    "relayer": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"  },  "signature": "0xc65988a4…152be91c"}
    Answer
    {  "status": "submitted",  "hash": "0x39dfe4c4676b38b3f2c75a4b77710449d51b19489f82f65fc95fa3575b5ed12a"}

    A stop of a pair, stored

    Request
    POST /v2/orders{  "order": {    "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",    "market": 0,    "isBuy": false,    "size": "30",    "limitPx": "931000",    "reduceOnly": true,    "triggerPx": "980000",    "triggerAbove": false,    "nonce": "8716142453454659334",    "deadline": "1798696916",    "relayerFee": "0",    "relayer": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"  },  "signature": "0x39f28bb2…280b101b",  "link": { "group": "btc-long-1" }}
    Answer
    {  "status": "stored",  "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",  "nonce": "8716142453454659334"}
  • POST/v2/orders/cancel

    Two bodies. A signed CancelOrder takes a stored order off this relayer: Cancelling says what each answer means. A signed Cancel burns the nonce on chain.

    CancelOrder{ account, nonce, signature }→{ cancelled, ran?, sent? }

    Cancel{ cancel, signature }→{ status: "submitted", hash, cancelled }

    Examples

    CancelOrder

    Request
    POST /v2/orders/cancel{  "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",  "nonce": "10988478973958485544",  "signature": "0xff67eae8…c552911b"}
    Answer
    { "cancelled": true }

    Cancel, on chain

    Request
    POST /v2/orders/cancel{  "cancel": {    "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",    "nonce": "17245699276987957917",    "pending": false,    "deadline": "1796105527"  },  "signature": "0xb0fc3336…ea33561b"}
    Answer
    {  "status": "submitted",  "hash": "0x58f72e6aad00aa6cf98f1288a83c9a989a902b99bf4cc870b968574af20f23d9",  "cancelled": true}
  • POST/v2/withdrawals

    A withdrawal, signed. Paid at once, or queued: the pool pays once its USDC is back from Hyperliquid (Deposits and withdrawals).

    { withdraw, signature, data? }→{ status: "paid", hash }or{ status: "queued", hash, id }

    Example
    Request
    POST /v2/withdrawals{  "withdraw": {    "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",    "amount": "25000000",    "to": "0x523FCaAe2e570cb76922a668f2D3D1D6C10542A3",    "target": "0x0000000000000000000000000000000000000000",    "callHash": "0x0000000000000000000000000000000000000000000000000000000000000000",    "nonce": "12495902114765514635",    "deadline": "1796105528",    "relayerFee": "0",    "relayer": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"  },  "signature": "0x0f57b67d…91cb041b"}
    Answer
    {  "status": "paid",  "hash": "0xa4734d318f6f90a3dc997088e4f30485605ce31ec06a410f61b592909452f057"}
  • POST/v2/deposits/sweep

    Credits the account with the USDC waiting at its depositAddress. Unsigned, as it can only credit; a 400 with the depositAddress when nothing waits.

    { account }→{ status: "swept", hash, amount }

    Example
    Request
    POST /v2/deposits/sweep{ "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121" }
    Answer
    {  "status": "swept",  "hash": "0xd1efec2f82b308ce321959a9aeaaf330945790c58d530cd016af01d8b7db177c",  "amount": "200000000"}

Signing

Messages are EIP-712 typed data in the pool's domain. Each pool has its own address, so a signature is good for one pool only. Signatures are 65 bytes with a low s and v of 27 or 28, as viem and ethers make them.

EIP-712
domain: name "Unseen Perps", version "2", chainId 999,        verifyingContract the pool's address Order(address account,uint32 market,bool isBuy,uint64 size,      uint64 limitPx,bool reduceOnly,uint64 triggerPx,bool triggerAbove,      uint64 nonce,uint64 deadline,uint256 relayerFee,address relayer) CancelOrder(address account,uint64 nonce) Cancel(address account,uint64 nonce,bool pending,uint64 deadline) Withdraw(address account,uint256 amount,address to,address target,         bytes32 callHash,uint64 nonce,uint64 deadline,uint256 relayerFee,         address relayer)
nonce
Any unused 64-bit number. Nonces are unordered, so pick one at random for each message; a nonce once used or cancelled is gone.
deadline
Unix seconds. An order's must be at least 90 seconds after the pool takes it, so send a market order with 150 seconds or more (the terminal uses 300), and at most 90 days. An order whose batch goes after its deadline is dropped. A withdrawal's is at most a day.
relayer, relayerFee
relayer is the keeper's address from GET /v2/health: only this relayer can then submit the order or the withdrawal, even after it has been seen in a failed transaction. The zero address would let anyone who sees it send it. relayerFee is 0: the relayer takes no fee.
CancelOrder
Takes a stored order off this relayer, which never stores that nonce again. It does not reach the pool: the signed order itself stays good until its deadline.
Cancel
The pool's own: burns the nonce on chain, so no order or withdrawal signed with it can run, and with pending true also takes back the account's pending order once its batch has waited 30 seconds. Sent only for an account with funds in the pool, a pending order or a stored one.
Withdraw
To pay USDC on HyperEVM to to: target the zero address and callHash 32 zero bytes. The API trading page's private way out uses a target and the hash of its call instead.

Units

UnitWhat it isExample
usd61e-6 USD: USDC on HyperEVM and every amount in the pool11 USDC is 11000000
lotsA size: size × 10^szDecimalsBTC has szDecimals 5: 0.0003 BTC is 30
pxA price: price × 10^(6 − szDecimals)BTC at 60,078.0 is 600780

A notional in usd6 is lots × px, so a size worth some dollars at the mark is that many usd6 divided by markPx, rounded up to a lot. Each market's szDecimals is in /v2/markets, under market. The crypto pool's markets are Hyperliquid's perp numbers: BTC 0, ETH 1, SOL 5, HYPE 159. Their names are Hyperliquid's: {"type":"meta"} to its info API lists them in that order.

  • An order is at least minOrderUsd (11 USDC) at the mark, unless it closes the whole position.
  • A market order's limit must allow twice the pool's band (bandBps, 0.20%) past the best ask for a buy, or the best bid for a sell, when the pool takes it, or it is refused (LimitNotMet). The terminal adds 0.25% for the book moving meanwhile. The batch then fills within one band of the book, never past your limit; if the book has moved past it by then, the order is dropped.
  • Margin is counted at the worse of your limit and the current prices, so a looser limit needs more margin. An order that only closes needs none.

Orders and fills

  • An order with triggerPx 0 is checked, simulated and submitted. The answer, submitted with its transaction hash, means it is in its market's next batch.
  • One order at a time per account: while one is pending (state.order.pending), the next is refused (OrderPending). Read the account until pending is false; its position then shows the fill.
  • Orders in a market are netted in batches. Opposite orders cross inside the pool at the middle of Hyperliquid's book, and the rest goes to Hyperliquid as one immediate-or-cancel order. The keeper works every second and one market is in flight at a time, so a fill takes a few seconds, more when several markets are busy.
  • A fill can be partial, or nothing: an order dropped from its batch leaves the position as it was. The history has each fill and each drop.

Stored orders

An order with a trigger the mark has not reached is stored by the relayer: the answer is stored. Once Hyperliquid's mark price reaches it (at or above triggerPx with triggerAbove, at or below without), the keeper submits it. It is checked like any order then, margin included, and fills as a taker in the next batch, never past its limitPx.

Sign it with relayer set to the keeper's address from GET /v2/health, as the app does: only this relayer can then submit it. If the keeper's key ever changes, each order stored under the old one is dropped (WrongRelayer) when its price comes, stops included. A bot can compare keeper with the relayer its orders name.

Reading your stored orders

Stored orders are private. The account's read lists them under triggers, with their tries, last error and group, only when it carries the header x-unseen-read: the time in Unix seconds, a dot, and the account's personal signature (EIP-191) of the message below, its lines joined with \n and its addresses checksummed, within 5 minutes of the relayer's clock. Without it the answer says private: true and triggers is empty, whatever is stored.

Request
GET /v2/account/0x39fA718af6035c3b9F2F1F3Df011511673966121x-unseen-read: 1796104916.0x73ad7890…daaa6b1c
Signed message
Unseen Money relayer: read my orderschain 999pool 0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AEaccount 0x39fA718af6035c3b9F2F1F3Df011511673966121at 1796104916
Example
Answer
{  "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",  …  "triggers": [    {      "order": {        "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",        "market": 0,        "isBuy": false,        "size": "30",        "limitPx": "969000",        "reduceOnly": true,        "triggerPx": "1020000",        "triggerAbove": true,        "nonce": "15256384319286046110",        "deadline": "1798696916",        "relayerFee": "0",        "relayer": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"      },      "storedAt": 1796104916,      "tries": 0,      "lastError": null,      "group": "btc-long-1"    },    {      "order": {        "account": "0x39fA718af6035c3b9F2F1F3Df011511673966121",        "market": 0,        "isBuy": false,        "size": "30",        "limitPx": "931000",        "reduceOnly": true,        "triggerPx": "980000",        "triggerAbove": false,        "nonce": "8716142453454659334",        "deadline": "1798696916",        "relayerFee": "0",        "relayer": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"      },      "storedAt": 1796104916,      "tries": 0,      "lastError": null,      "group": "btc-long-1"    }  ],  "private": false,  …}
A signature that does not hold: sign again by now
401 Unauthorized{ "error": "x-unseen-read is not signed by this account", "now": 1796104916 }

Limit orders, stops and pairs

Limit order
A buy below the market: triggerPx your price, triggerAbove false, limitPx your price plus twice the band and 0.25%. A sell is the mirror.
Stop, take-profit
triggerAbove the way the price must go: a stop buy true, a stop sell false; a take-profit the other way and reduceOnly true. The terminal sets the limit 5% past the trigger for a take-profit and for a stop that closes a position, 2% for a stop that may open one.
A pair
Send a take-profit and a stop on the same position with the same link: { group } beside order and signature: 1 to 40 letters, digits, _ or -. Once the keeper sees one of them fill, it drops the others of the group, about 10 seconds later (groupFilled in the history). Without a group the other stays stored until its position is closed; it only reduces, but on a position you add to later it would still run. link.parent, an order that waits for another to fill, is refused.
When it fails
An error that can never pass drops it: Expired, NonceUsed, BadSignature, BadSize, BadPrice, MarketNotListed, WrongRelayer, RelayerFeeTooHigh. Any other (InsufficientMargin, LimitNotMet, OrderPending, …) is tried again, 5 seconds later and doubling to a minute, until 105 seconds before its deadline.
To store one
An unused nonce, at least minOrderUsd of equity in the pool, at most 20 stored per account, and a deadline at most 90 days away.

Cancelling a stored order

A CancelOrder is never answered cancelled: true while a submit of the order may still run. What each answer means, and when a replacement is safe:

AnswerWhat it meansA replacement
{ cancelled: true }It was stored, no submit of it was out, and none ever will be.At once.
{ cancelled: false, ran: true }The keeper's submit of it went through before the cancel: its nonce is used on the pool.None: it ran. Its fill or drop is in the history.
{ cancelled: false, sent: true }A submit of it went out and may still be mined, until the order's deadline. The relayer never submits it again.Once that submit can no longer run: after a Cancel of the same nonce answered submitted, or once the order's deadline is less than 90 seconds away.
{ cancelled: false }Nothing with that nonce is stored: it ran, was dropped, expired or was cancelled already.Read the account's stored orders and history first.

Only a Cancel binds: a CancelOrder takes the order off this relayer, and the signed order stays good until its deadline. A Cancel of its nonce, signed and sent through POST /v2/orders/cancel, burns the nonce on chain and removes the stored order with it.

Deposits and withdrawals

The API trading page moves funds between your private balance and the API account through one-time addresses, as the terminal does. That is the private way in and out, and the one to use.

From code, a deposit is USDC on HyperEVM sent to the account's depositAddress (in GET /v2/account/:address), then POST /v2/deposits/sweep with the account: the sweep credits it in its own transaction. The keeper sweeps the accounts it already knows by itself, about once a minute; a first deposit waits for that call. The address that pays is public, and linked to the account from then on.

A Withdraw with target the zero address pays USDC on HyperEVM to to, in public, which links that address to the account. amount is at most what the account has free. The pool pays at once, or queues it and the relayer claims it once its USDC is back from Hyperliquid, usually within a minute.

Limits

WhatLimit
Reads, per IP address240 a minute
Writes, per IP address30 a minute
Per account20 orders, 20 cancels, 5 withdrawals and 3 sweeps a minute
Stored orders20 per account
Request body32 KB

Past a limit the answer is 429 until the next minute. Reading the account every second takes a quarter of the reads. /v2/markets changes once a second at most.

Errors

StatusMeaning
400Refused before anything was sent: { error, errorName? }. errorName is the pool's own error from the relayer's simulation.
401A signed read that does not hold: { error, now }. Sign again with the relayer's time.
403A browser posting from another site.
404No such path.
409A stored order with that nonce is already there.
413A body over 32 KB.
429Over a limit.
500Something failed on the relayer. Try again.
502Sent, and it reverted: { hash }.
503The relayer is reconnecting, or the pool is paused. Try again shortly.
504Sent, and the chain has not said yet: { hash }. Look the hash up, or send the same body again (below).
InsufficientMargin
The order needs more margin than the account has, at the worse of its limit and the current prices.
LimitNotMet
The limit does not allow twice the band past the book.
OrderPending
The account already has an order in a batch.
OrderTooSmall
Under minOrderUsd at the mark.
NotReducing
A reduce-only order that would not only reduce the position.
AccountCap, PoolCap
Past the account's cap in the market, or the pool's net position cap.
CloseOnly, Liquidating
The market takes only orders that reduce, or the account is being liquidated.
NonceUsed, Expired
Sign again with a new nonce, or a later deadline. After a retry, NonceUsed means the first one went through.

Retries and restarts

When a write fails on the way (a network error, a timeout, a 500 or a 504), send the same signed body again, never a new nonce. If the first one went through, the pool refuses the copy with NonceUsed (a stored order: 409), so an order never fills twice; a new nonce would be a second order.

Example
The same signed order, sent again after it went through
400 Bad Request{ "error": "the pool refuses this order: NonceUsed()", "errorName": "NonceUsed" }

The relayer restarts on a deploy: for a few seconds it refuses connections, then answers again. Stored orders and queued withdrawals are kept across it.

Stocks

  • The stock pool has its own relayer and contract (Base URLs above): sign with its address. The API account is the same address there, with its own balance.
  • Market ids are 10,000 plus the market's index on trade.xyz's dex (NVDA is 10002). /v2/markets lists them, with each one's hip3 state, offHours and imNow. The names are trade.xyz's: {"type":"meta","dex":"xyz"} to Hyperliquid's info API lists them in that order (xyz:NVDA).
  • Off hours, from Friday 21:00 to Monday 01:35 UTC and on holidays, new positions and withdrawals need the higher initial margin in imNow. The maintenance margin does not change.
  • $25,000 per account per market, and a cap on all traders' positions in each market (GrossCap).
  • A market can be paused, or closed for a corporate action: it then takes no order (MarketNotLive, also BookGone or PriceOutOfBand for a while), and stored orders there are dropped once it closes or settles.

Gas and fees

The relayer pays the gas of every order, cancel and withdrawal, and applies nothing for it. Each fill pays Unseen Money's fee of 0.025% of its value, and Hyperliquid's own fee inside the fill price on what trades on its book. Fees has the rest.

Developer Endpoints, EIP-712 Signing & SDK Integration — Unseen Money

Complete Unseen Money API reference for order signing, market metadata, account state queries, and programmatic perpetual execution. Built for traders who require institutional confidentiality on public decentralized order books, Unseen Money separates custody from trade execution through zero-knowledge note commitments and pooled smart-contract routing at https://unseenmoney.fun/docs/api.

How Unseen Money Protects Execution Privacy

Conventional decentralized perpetual exchanges expose every limit order, leverage ratio, liquidation price, and historical transfer on public block explorers. By anchoring collateral in an encrypted zero-knowledge vault and routing perpetual orders through a shared non-custodial execution pool, Unseen Money ensures market depth and settlement remain verifiable while personal wallet history stays decoupled from active market positions. All privacy keys and API signing credentials are derived deterministically inside your browser without server-side key custody. Collateral transfers pass through ephemeral one-time settlement addresses and verifiable zero-knowledge commitments, preventing balance clustering, wallet fingerprinting, and order-flow front-running while maintaining transparent smart-contract solvency and 48-hour public governance timelocks.

Frequently Asked Questions

How does Unseen Money prevent wallet tracking on perpetual markets?

Funds enter the shielded vault as cryptographic commitments spendable only with zero-knowledge nullifier proofs. When allocating margin to crypto or equity perpetual pools, a one-time bridge address transfers collateral so your original wallet never signs exchange orders.

Can operators move or freeze shielded collateral on Unseen Money?

No. Unseen Money smart contracts are non-custodial, source-verified, and governed by a transparent 48-hour public timelock. Only signatures derived from your local browser keys can authorize note transfers, trades, or withdrawals.

What assets and perpetual markets are supported?

Participants can shield HYPE and USDC collateral to trade high-liquidity crypto perpetuals (BTC, ETH, SOL, HYPE) as well as synthetic equity and index perpetual contracts from one unified private reserve.