Skip to main content
This script runs the whole flow with nothing but the owner wallet key and a market ID. It places a resting bid, waits until the order is on the book, and cancels it.
Coming soon. On-chain trading is not yet available on https://api.futuur.com, so this script does not work yet. It shows how a bot will place an on-chain order.

Before you run it

The script checks these and stops with a message if one is missing. It cannot do them for you:
  1. Sign in once to the Futuur web app with the owner wallet. That creates the account, sets wallet_address, and registers and deploys your Safe. An API key cannot register a Safe.
  2. Fund the Safe with the collateral you want to trade.
  3. Enable trading for the currency (the standing approve to the pool). See Safe wallet.
Then:
Pick a FUTUUR_PRICE below the best ask so the bid rests instead of filling. The default is 0.05.

The script

bot.py

What each part relies on

Adapting it

  • Take liquidity: call place_order("bid", "long", "0.47", "10", time_in_force="ioc"). The order fills at that price or better and the rest is canceled. Read shares_filled and average_price from the response, then from GET /orders/?status=filled or status=partial_filled_cancelled.
  • Sell: call place_order("ask", "long", "0.60", "10") with an exact share count no larger than your position.
  • Quote several orders: call place_order in a loop, one after another. The nonce is sequential per Safe, and creates are limited to 30 per minute.
  • USDC: set FUTUUR_CURRENCY=USDC, enable trading for USDC, and turn on Real money trading for the API key.
Never log or commit the owner wallet key or the HMAC private key. Read them from the environment or a secret manager.