API reference · testnet
Functor API
Read market data and trade on Functor from your own code. The API follows Hyperliquid's design: one endpoint for reads, one for signed actions, and a WebSocket for updates.
Environments
| Network | HTTP | WebSocket | Status |
|---|---|---|---|
| Testnet | https://api.functorfund.com | wss://api.functorfund.com/ws | Live. One validator, mock USDC, test FCTR. No real value. |
| Mainnet | — | — | Not live. Mainnet alpha is planned for Q2 2027 (roadmap). |
Endpoints
| Method and path | Purpose | Reference |
|---|---|---|
POST /info | Read-only queries: markets, books, accounts, FCTR, vaults | Info |
POST /exchange | Signed actions: orders, cancels, transfers, vaults | Exchange |
POST /faucet | Testnet only: 10,000 mock USDC and 1,000 test FCTR, once per address per 24 hours | Faucet |
GET /status | Node height, state root, oracle sources, price age, deployed version | nodeStatus |
GET /ws | WebSocket: books, trades, account, blocks | WebSocket |
GET / | Node name, endpoint list, deployed version |
Conventions
- Requests and responses are JSON (
content-type: application/json), over HTTPS only. - Times are milliseconds since the Unix epoch (UTC). Block heights are integers.
- Addresses are 20-byte hex strings with
0x. Requests accept any case; responses are lowercase. - Two kinds of numbers.
/infoand the WebSocket answer in dollars and coins (JSON numbers)./exchangetakes integers in chain units: prices in ticks, sizes in lots, USDC in micro-USDC, FCTR in base units. Order results reportavgPxin ticks andfilledLotsin lots. - Clients must ignore fields they don't know. New fields are added without notice.
Units
| Market | Id | Kind | Tick (USD) | Lot | Max leverage |
|---|---|---|---|---|---|
| BTC | 0 | Perpetual | 1 | 0.001 BTC | 40× |
| ETH | 1 | Perpetual | 0.1 | 0.01 ETH | 25× |
| SOL | 2 | Perpetual | 0.01 | 0.1 SOL | 20× |
| FCTR/USDC | 10000 | Spot | 0.0001 | 0.01 FCTR | 1× |
Price in ticks = dollars ÷ tick. Size in lots = coins ÷ lot. Example: a 0.01 BTC buy at $83,300 is price: 83300, size: 10. USDC: 1 = 1,000,000 micro-USDC. FCTR: 1 = 1,000,000,000 base units. The minimum perpetuals order is $10 of notional (reduce-only orders excepted); the minimum FCTR/USDC order is 1 FCTR. The live values are in meta and spotMeta.
Quick start
Read the BTC book:
curl -s https://api.functorfund.com/info \
-H 'content-type: application/json' \
-d '{"type":"l2Book","coin":"BTC","nLevels":5}'
Fund a test address from the faucet:
curl -s https://api.functorfund.com/faucet \
-H 'content-type: application/json' \
-d '{"user":"0xYOUR_ADDRESS"}'
Sign and send an order (Node.js 18+). functor-sign.js is the reference signer the web app uses; the node is tested against it on every release.
// npm install @noble/curves@1.9.1 @noble/hashes@1.8.0
// curl -O https://functorfund.com/js/functor-sign.js
import { keccak_256 } from "@noble/hashes/sha3";
import { secp256k1 } from "@noble/curves/secp256k1";
import { makeSigner } from "./functor-sign.js";
const S = makeSigner({ keccak_256, secp256k1 });
const session = S.randomKey(); // a session key; approve it once with your wallet
const action = { type: "order", account: "0xYOUR_ADDRESS", market: 0, isBuy: true,
price: 83300, size: 10, tif: "Ioc", reduceOnly: false };
const res = await fetch("https://api.functorfund.com/exchange", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(S.agentRequest(session, action, Date.now())),
});
console.log(await res.json());
Versions and changes
- The deployed version is in
GET /andGET /status(version). - Additive changes (new fields, new
/infotypes, new actions) ship without notice. - Breaking changes (a field removed or renamed, a unit changed, a signed type changed) are announced on News at least 7 days ahead on the testnet. Mainnet will use 30 days.
- Testnet resets. When the chain's state format changes, the testnet restarts from a fresh genesis and balances start over. Resets are announced on News.
Support
There is no official client library yet; functor-sign.js is the reference for signing. Report bugs and ask questions on Telegram. Security issues: report them privately there first, not in a public channel.
Generated from the node's source code by tools/api-docs.mjs; examples are real responses from https://api.functorfund.com. Questions: Telegram. Changes: News.