Skip to main content
Coming soon. This flow is not yet available on https://api.futuur.com. All paths below are relative to https://api.futuur.com and describe how it will work.
Every on-chain create is pre-signed. HMAC authenticates the HTTP request. The Safe owner EOA signs EIP-712 LimitOrderIntent. HMAC keys alone cannot create OOM or USDC orders. If you do not have credentials yet, start with Get your API keys. For the matching and settlement model, see On-chain trading. For one runnable script that does all of this, see End-to-end Python bot.

Prerequisites

  1. A Futuur account with wallet_address set. You get it by signing in with the owner wallet.
  2. A registered, deployed Safe that is a 1-of-1 Safe owned by that wallet. An API key cannot register a Safe: sign in to the web app with the wallet once and it registers and deploys the Safe for you. Check with GET /v2.0/me/safe-wallet/ — deploy_status must be deployed. See Safe wallet.
  3. HMAC public and private keys for L2 request signing.
  4. The owner EOA private key — the same key that owns the Safe.
  5. The Safe funded with OOM and/or USDC.
  6. Trading enabled once per collateral token (step 1).
  7. For USDC with an API key: Real money trading turned on for the key.

Step 1 — Enable trading

Grant the pool a standing allowance so bids do not need a per-order approve.
The approve is sent from the Safe, so it is an ERC-4337 UserOperation signed by the owner. The body of enable-trading is:
The API only accepts a UserOperation whose callData is approve(pool, amount) on that currency’s token. Building and signing a Safe UserOperation needs a smart-account library; the web app does it for you. Request and response fields, the relay endpoints, and the errors are in Safe wallet. After this succeeds, enabled is true, signing-context returns needsApproval: false, and creates are intent-only.
A bid placed without the allowance is still accepted, but its matches fail at settlement. Check enabled (or needsApproval) before you quote.
Do this once per token (OOM and USDC). You do not repeat it on every order.

Step 2 — Signing context

Call this once per order, right before you sign.
HMAC-authenticated. Body:
Things to know about the context:
  • It does not reserve the nonce. The nonce is one counter per Safe, and the first accepted create takes it. Two contexts fetched back to back return the same nonce.
  • maxUsdcRaw follows the live book. Send the value you signed as max_usdc_raw so the API verifies that amount. If the book has moved against you, create returns max_usdc_raw_too_low.
  • It does not check your balance or that the market is open. Create does.
  • A failed request returns 400 with a message such as Safe is not deployed on-chain yet. See Errors.
Run signing context → sign → create strictly one after another for each Safe. Do not sign several orders from one context and do not run two of these sequences in parallel: the second create gets order_intent_nonce_stale. After any failed create, start again from a new signing context.

Step 3 — Sign LimitOrderIntent

Sign eip712 with the owner EOA, not the Safe contract address. Domain: FutuurLimitOrder v1, verifyingContract is the zero address.
Use the eip712 object from signing-context as-is. Every field must equal what the API rebuilds from your create request, or the signature does not recover to your owner address. The create must carry the same market, side, position, price, and shares you asked the context for.

Step 4 — Create the order

Send the usual order fields plus:
Sign the HTTP request with HMAC as usual. The body above uses string values so the HMAC string is built from exactly what you send. See Authentication. Choose the order type with time_in_force:
  • gtc (default) rests on the book. Create returns processing, then the order becomes open or filled.
  • ioc takes liquidity at your price or better and cancels the rest. A market order (price: null) is not accepted on-chain; this is the replacement.
The order stops matching at the signed expiry at the latest, even if you send a later expired_at. Read the result from the response and then from GET /orders/: status, shares_filled, average_price, and settlement_status. Fills settle on-chain after the response. See Order lifecycle.

Selling

Do not sell on-chain OOM or USDC with PATCH /wagers/{id}/. That path only moves the internal ledger and returns onchain_sell_requires_limit_order. Use a signed side=ask create instead. An ask signs maxUsdcRaw: 0 and needs no allowance. Send an exact share count. With shares: "max" the signed sharesRaw must still equal the quantity that is sold, so a bot should not use it. Shares settle in steps of 0.01, so an ask of 0.68 against a 0.67 position fails.

Canceling

PATCH /v2.0/orders/{id}/cancel/ needs HMAC only. No wallet signature. Only open orders can be canceled. See Cancel order.

Common errors

On-chain codes arrive in a 400 as the detail of the entry whose attr is "code". The full list, with what to do for each, is in Errors.
Never store the owner wallet key in git or client-side code. HMAC keys cannot create on-chain orders by themselves.
Coming soon: a client with an interactive owner wallet can authorize a session key once and sign orders with it. See Sign orders with a session key.