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.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
- A Futuur account with
wallet_addressset. You get it by signing in with the owner wallet. - 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_statusmust bedeployed. See Safe wallet. - HMAC public and private keys for L2 request signing.
- The owner EOA private key — the same key that owns the Safe.
- The Safe funded with OOM and/or USDC.
- Trading enabled once per collateral token (step 1).
- For
USDCwith 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:
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.
Step 2 — Signing context
Call this once per order, right before you sign.
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.
maxUsdcRawfollows the live book. Send the value you signed asmax_usdc_rawso the API verifies that amount. If the book has moved against you, create returnsmax_usdc_raw_too_low.- It does not check your balance or that the market is open. Create does.
- A failed request returns
400with a message such asSafe is not deployed on-chain yet.See Errors.
Step 3 — Sign LimitOrderIntent
Signeip712 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
time_in_force:
gtc(default) rests on the book. Create returnsprocessing, then the order becomesopenorfilled.ioctakes liquidity at your price or better and cancels the rest. A market order (price: null) is not accepted on-chain; this is the replacement.
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 withPATCH /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.