Use Case

Use funding-rate context as a trade filter

Funding rate is one of the strongest tells in perpetuals positioning. Smart Money API already factors it in: the /v1/confirm composite blends a derivatives sub-score (deriv_score) built from funding rate, long/short ratio and open-interest momentum. Read that sub-score to use funding context as a risk filter before entry.

Who this is for

Developers who want funding-aware market context without wiring up per-venue funding feeds themselves. Note: there is no standalone funding endpoint — funding is one input to deriv_score inside /v1/confirm. Smart Money API is decision support; your code stays in control of execution and risk.

Prerequisites

  • Python 3.9+ with pip install requests.
  • A strategy that already produces a candidate direction (long or short).
  • 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 20 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. 1Install the library: pip install requests.
  2. 2Export your key: export SMA_API_KEY="sm_your_key_here".
  3. 3Call /v1/confirm for your candidate direction and read deriv_score — the funding-aware derivatives sub-score — plus the matching reasons.
  4. 4Use the overall action and deriv_score together as a filter: enter on CONFIRM, sizing by size_mult.

Working example

This script calls GET /v1/confirm?symbol=BTC&direction=long and inspects deriv_score and the funding-related entries in reasons before deciding whether to enter.

funding_filter.py
import os
import requests

API_KEY = os.environ["SMA_API_KEY"]            # never hard-code
SMA_BASE = "https://api.smartmoneyapi.com"

def confirm(symbol: str, direction: str) -> dict:
    """Funding context is folded into deriv_score inside the composite."""
    r = requests.get(
        f"{SMA_BASE}/v1/confirm",
        params={"symbol": symbol, "direction": direction, "source": "funding-filter"},
        headers={"X-API-Key": API_KEY},
        timeout=10,
    )
    r.raise_for_status()
    return r.json()

# 1. Your strategy decides a candidate direction
symbol, direction = "BTC", "long"

# 2. Read the funding-aware derivatives sub-score
sig = confirm(symbol, direction)
deriv = sig["deriv_score"]                     # blends funding + LSR + OI momentum
print("deriv_score", deriv, "action", sig["action"])
for reason in sig["reasons"]:
    if "funding" in reason.lower() or "lsr" in reason.lower():
        print("deriv context:", reason)

# 3. Use derivatives context as a filter (your code executes; the API only advises)
if sig["action"] == "CONFIRM" and deriv >= 0.5:
    base_qty = 0.01
    qty = base_qty * sig["size_mult"]          # scale by suggested multiplier
    print(f"Funding context supports {direction} -> would enter {qty} {symbol}")
elif sig["action"] == "REDUCE":
    print("Mixed derivatives context -> trade smaller or wait")
else:  # SKIP
    print("Funding/derivatives context does not support this trade -> stand aside")

Expected response

A successful call to /v1/confirm returns JSON like this — note deriv_score and the funding/LSR entries in reasons:

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"
  ]
}

deriv_score is the derivatives sub-score (funding rate + LSR + OI momentum) that feeds the overall composite, which 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

Funding and derivatives context support your direction. Proceed with your own entry and risk rules, optionally scaling size by size_mult.

REDUCE

Derivatives signals are mixed. Consider a smaller position, tighter stops, or waiting for a cleaner setup.

SKIP

Funding and derivatives context do not support this trade. Stand aside and re-check on the next candidate.

Ready to build?

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

Not financial advice. Crypto trading involves risk.