Integration Guide

Confirm entries in a Binance Futures bot

Add a final market-context gate to your Binance USDⓈ-M futures bot: confirm the direction with whale flow and derivatives positioning, then size the order by the suggested multiplier.

Who this is for

Developers running a Binance USDⓈ-M perpetual futures bot who want an independent confirmation layer before each entry. Smart Money API is decision support — your bot keeps full control of order placement and risk management.

Prerequisites

  • Python 3.9+ with pip install ccxt requests (CCXT covers Binance USDⓈ-M futures).
  • Binance futures API keys with trade permission (test on testnet first).
  • A Smart Money API key (free tier covers BTC).

Get your API key

Every request authenticates with the X-API-Key header. To get a key:

  1. 1Create a free account, then open your dashboard.
  2. 2Copy the API key shown under API Access. The free tier covers BTC at 200 requests/day — enough to test this guide end to end.
  3. 3Need more symbols or higher limits? Compare tiers on the pricing page.

Keep the key secret — store it in an environment variable, never commit it to source control.

Setup

  1. 1Keep your existing entry logic that produces a candidate long/short signal.
  2. 2Export your key: export SMA_API_KEY="sm_your_key_here".
  3. 3Before each entry, call /v1/confirm with the symbol and direction.
  4. 4Open the futures position only on CONFIRM, scaling notional by size_mult.

Working example

This bot confirms a long or short with GET /v1/confirm?symbol=BTC&direction=long and only opens a Binance USDⓈ-M futures position when the action is CONFIRM.

binance_futures_bot.py
import os
import ccxt
import requests

API_KEY = os.environ["SMA_API_KEY"]
SMA_BASE = "https://api.smartmoneyapi.com"

binance = ccxt.binance({
    "apiKey": os.environ["BINANCE_KEY"],
    "secret": os.environ["BINANCE_SECRET"],
    "options": {"defaultType": "future"},   # USDⓈ-M futures
})

def confirm(symbol: str, direction: str) -> dict:
    r = requests.get(
        f"{SMA_BASE}/v1/confirm",
        params={"symbol": symbol, "direction": direction, "source": "binance-fut"},
        headers={"X-API-Key": API_KEY},
        timeout=10,
    )
    r.raise_for_status()
    return r.json()

def maybe_enter(symbol: str, direction: str, base_qty: float):
    sig = confirm(symbol, direction)
    print(sig["symbol"], direction, "->", sig["action"], sig["confidence"])

    if sig["action"] != "CONFIRM":
        print("Not confirmed -> no entry")   # REDUCE or SKIP
        return

    qty = round(base_qty * sig["size_mult"], 3)   # size by multiplier
    side = "buy" if direction == "long" else "sell"
    # binance.create_order("BTC/USDT", "market", side, qty)
    print(f"Would open {direction} {qty} BTC/USDT (futures)")

if __name__ == "__main__":
    # your strategy decided it wants a long here
    maybe_enter("BTC", "long", base_qty=0.02)

Expected response

A successful call to /v1/confirm returns JSON like this:

200 OK · application/json
{
  "ts": 1710940821,
  "symbol": "BTC",
  "direction": "long",
  "composite": 0.74,
  "confidence": "HIGH",
  "action": "CONFIRM",
  "size_mult": 1.5,
  "deriv_score": 0.81,
  "onchain_score": 0.68,
  "whale_score": 0.73,
  "reasons": [
    "Funding rate positive across all venues",
    "LSR favors longs: 1.42",
    "Whales: 67% long consensus",
    "MVRV above 1.0 — on-chain bullish"
  ]
}

composite ranges from -1.0 (strong contra) to +1.0 (strong confirm), confidence is HIGH or MEDIUM, and size_mult is a 0.0–1.5 suggested size multiplier. See the full field reference in the API docs.

How to act on the response

CONFIRM

Context supports your direction. Open the position with your own risk rules, scaling notional by size_mult.

REDUCE

Signals are mixed. Consider a smaller position and tighter leverage, or wait for confirmation.

SKIP

Market context does not support this trade. Stand aside and re-check on the next signal.

Ready to build?

Grab a free key and make your first confirmation call in under a minute.

Not financial advice. Crypto trading involves risk.