Skip to main content
This script runs the whole phase-one flow against the preview host 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.
The script targets the phase-one preview host on Base Sepolia (chain ID 84532). See Environment. It does not work against https://api.futuur.com.

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 preview 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. OOM is minted to a new Safe by the platform. See Get test funds.
  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.