Integration Guide
Add a Smart Money confirmation gate to Freqtrade
Plug a smart-money confirmation check into Freqtrade's confirm_trade_entry hook so your bot only opens positions the whales agree with.
Who this is for
Freqtrade users running their own strategy who want a final, independent confirmation layer before each entry — without rewriting their indicator logic.
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
- 1Make sure your strategy already produces entry signals as normal.
- 2Set the key in the environment Freqtrade runs in:
export SMA_API_KEY="sk_your_key_here". - 3Add the
smart_money_confirms()helper and aconfirm_trade_entrymethod to your strategy (see below). - 4The hook returns
Falseto veto an entry when the signal is not HIGH-confirmed; the bot simply skips that trade.
Working example
The confirm_trade_entry hook calls GET /v1/confirm?symbol=BTC&direction=long per candidate trade and vetoes anything that is not a HIGH confirmation.
# In your Freqtrade strategy file (user_data/strategies/MyStrategy.py)
import os
import requests
from freqtrade.strategy import IStrategy
from pandas import DataFrame
SMA_API_KEY = os.environ.get("SMA_API_KEY", "")
SMA_BASE = "https://api.smartmoneyapi.com"
def smart_money_confirms(symbol: str, direction: str) -> bool:
"""Return True only when Smart Money API gives a HIGH confirmation."""
try:
r = requests.get(
f"{SMA_BASE}/v1/confirm",
params={"symbol": symbol, "direction": direction},
headers={"X-API-Key": SMA_API_KEY},
timeout=8,
)
r.raise_for_status()
return r.json().get("confirmation") == "HIGH"
except Exception:
return False # fail closed: no confirmation -> no extra conviction
class MyStrategy(IStrategy):
def confirm_trade_entry(self, pair: str, order_type: str, amount: float,
rate: float, time_in_force: str, current_time,
entry_tag, side: str, **kwargs) -> bool:
# pair looks like "BTC/USDT" -> take the base asset
base = pair.split("/")[0]
direction = "long" if side == "long" else "short"
return smart_money_confirms(base, direction)
Expected response
A successful call to /v1/confirm returns JSON like this (fields abbreviated):
{
"symbol": "BTC",
"direction": "long",
"confirmation": "HIGH",
"score": 0.78,
"smart_money": {
"net_flow_usd": 4250000,
"long_short_ratio": 1.62,
"whales_long": 38,
"whales_short": 14
},
"derivatives": {
"funding_rate": 0.00011,
"oi_change_24h": 0.067
},
"as_of": "2026-06-30T12:00:00Z"
}
confirmation is one of HIGH / MEDIUM / LOW / NONE and score is a 0–1 conviction blend of smart-money flow and derivatives positioning for the requested side. See the full field reference in the API docs.
Ready to build?
Grab a free key and make your first confirmation call in under a minute.
Not financial advice. Crypto trading involves risk.