Use Case
Open interest context as a confirmation input
Open interest momentum is one of the derivatives signals the Smart Money API already factors into every confirmation. Instead of polling a raw OI feed, call /v1/confirm and read the deriv_score sub-score plus the reasons it returns — then use that as a risk filter before placing an order.
Who this is for
Developers building crypto trading bots who want open-interest context baked into a single decision-support call. Rising OI alongside aligned funding and long/short ratio tends to strengthen a directional move; the deriv_score rolls those derivatives factors into one number. Smart Money API is decision support — it does not place orders for you; your bot stays in control of execution.
Prerequisites
- Python 3.9+ with
pip install requests. - Your own strategy that proposes 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:
- 1Create a free account, then open your dashboard.
- 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.
- 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
- 1Install the library:
pip install requests. - 2Export your key:
export SMA_API_KEY="sm_your_key_here". - 3When your strategy proposes a direction, call
/v1/confirmand readderiv_score— the derivatives sub-score that already includes OI momentum, funding and LSR. - 4Treat a high
deriv_scorewith aCONFIRMaction as derivatives support; size bysize_multand apply your own risk rules.
Working example
This script calls GET /v1/confirm?symbol=BTC&direction=long and inspects the derivatives sub-score and reasons to use open-interest context as a final gate.
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:
"""Ask Smart Money API for market-context confirmation."""
r = requests.get(
f"{SMA_BASE}/v1/confirm",
params={"symbol": symbol, "direction": direction, "source": "oi-bot"},
headers={"X-API-Key": API_KEY},
timeout=10,
)
r.raise_for_status()
return r.json()
# Your strategy proposes a candidate direction
sig = confirm("BTC", "long")
# deriv_score folds OI momentum + funding + LSR into one 0-1 sub-score
deriv = sig["deriv_score"]
print("action", sig["action"], "deriv_score", deriv)
for reason in sig["reasons"]:
print(" -", reason) # e.g. funding / LSR / OI notes
# Use open-interest context as a risk filter
if sig["action"] == "CONFIRM" and deriv >= 0.6:
qty = 0.01 * sig["size_mult"] # scale by suggested multiplier
print(f"Derivatives support the move -> would place long {qty} BTC")
elif sig["action"] == "REDUCE":
print("Derivatives context is mixed -> trade smaller or wait")
else: # SKIP or weak deriv_score
print("Open-interest context does not back this trade -> stand aside")
Expected response
A successful call to /v1/confirm returns JSON like this:
{
"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 + LSR + OI momentum), 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
Derivatives context, including OI momentum, supports your direction. Proceed with your own entry and risk rules, optionally scaling size by size_mult.
REDUCE
Signals are mixed. Consider a smaller position, tighter stops, or waiting for a cleaner setup.
SKIP
Market context does 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.