ஒருங்கிணைப்பு வழிகாட்டி
Smart Money API உடன் Bybit perpetuals நுழைவுகளை உறுதிப்படுத்தவும்
CCXT உடன் Bybit swap மார்க்கெட் டேட்டாவை நேரடியாகப் படிக்கவும், Smart Money API-ஐக் கேளுங்கள், திமிங்கல ஓட்டம் மற்றும் derivatives நிலைப்பாடு உங்கள் திசையை உறுதிப்படுத்துகிறதா என்பதைப் பார்க்கவும், பின்னர் perpetuals நுழைவை வைக்கவும் — பரிந்துரைக்கப்பட்ட பெருக்கியால் அளவிடப்படுகிறது.
இது யாருக்கானது
Python டெவலப்பர்கள் Bybit USDT-perpetuals bot ஐ இயக்குகிறார்கள் CCXT ஒவ்வொரு நுழைவுக்கும் முன் ஒரு சுயாதீன மார்க்கெட்-சூழல் சோதனையை விரும்புவோர். Smart Money API என்பது முடிவு ஆதரவு — இது உங்களுக்காக ஆர்டர்களை வைக்காது; உங்கள் CCXT கோடு எக்ஸிக்யூஷன் மற்றும் ரிஸ்க் கட்டுப்பாட்டில் உள்ளது.
முன்நிபந்தனைகள்
- Python 3.9+ உடன்
pip install ccxt requests. - Bybit API விசைகள் CCXT க்காக கட்டமைக்கப்பட்டுள்ளன (டெஸ்ட் செய்ய ரீட்-ஒன்லி போதும்).
- ஒரு Smart Money API விசை (இலவச டியர் BTC ஐ உள்ளடக்கியது).
உங்கள் API விசையைப் பெறவும்
ஒவ்வொரு கோரிக்கையும் அங்கீகரிக்கப்படுகிறது X-API-Key ஹெடர். ஒரு விசையைப் பெற:
- 1இலவச கணக்கை உருவாக்கவும், பின்னர் உங்கள் டாஷ்போர்டு.
- 2கீழே காட்டப்பட்டுள்ள API விசையை நகலெடுக்கவும் API அணுகல். இலவச டியர் BTC ஐ 20 கோரிக்கைகள்/நாள் — இந்த வழிகாட்டியை முடிவுக்கு சோதிக்க போதுமானது.
- 3மேலும் சின்னங்கள் அல்லது உயர் வரம்புகள் தேவையா? டியர்களை ஒப்பிடு விலைப் பக்கம்.
விசையை ரகசியமாக வைத்திருங்கள் — அதை ஒரு சூழல் மாறியில் சேமிக்கவும், சோர்ஸ் கண்ட்ரோலுக்கு ஒருபோதும் கமிட் செய்யாதீர்கள்.
அமைப்பு
- 1நூலகங்களை நிறுவவும்:
pip install ccxt requests. - 2உங்கள் விசையை எக்ஸ்போர்ட் செய்யவும்:
export SMA_API_KEY="sm_your_key_here". - 3CCXT உடன் Bybit swaps ஐ திறக்கவும் (
ccxt.bybit({"options":{"defaultType":"swap"}})), உங்கள் ஸ்ட்ராடஜி ஒரு வேட்பாளர் திசையைத் தேர்ந்தெடுக்கட்டும், பின்னர் அழைக்கவும்/v1/confirmஇறுதி கான்டெக்ஸ்ட் கேட் ஆக. - 4CCXT உடன் perpetuals நுழைவை வைக்கவும், action இருக்கும்போது மட்டுமே
CONFIRM, sizing bysize_mult.
Working example
This script reads a Bybit swap ticker with CCXT, derives a candidate direction, then calls GET /v1/confirm?symbol=BTC&direction=long before deciding whether to place the entry.
import os
import ccxt
import requests
API_KEY = os.environ["SMA_API_KEY"] # never hard-code
SMA_BASE = "https://api.smartmoneyapi.com"
exchange = ccxt.bybit({"options": {"defaultType": "swap"}}) # Bybit perpetuals
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": "bybit-bot"},
headers={"X-API-Key": API_KEY},
timeout=10,
)
r.raise_for_status()
return r.json()
# 1. Read Bybit swap market data with CCXT and pick a candidate direction
ticker = exchange.fetch_ticker("BTC/USDT:USDT")
direction = "long" if ticker["percentage"] and ticker["percentage"] > 0 else "short"
# 2. Confirm with Smart Money API before acting
sig = confirm("BTC", direction)
print(sig["action"], sig["confidence"], "size_mult", sig["size_mult"])
# 3. Act on the recommendation (CCXT executes; the API only advises)
if sig["action"] == "CONFIRM":
base_qty = 0.01
qty = base_qty * sig["size_mult"] # scale by suggested multiplier
# exchange.create_order("BTC/USDT:USDT", "market", direction, qty)
print(f"Would place {direction} {qty} BTC/USDT:USDT perp")
elif sig["action"] == "REDUCE":
print("Context is mixed -> trade smaller or wait for a cleaner setup")
else: # SKIP
print("Context does not support 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"
]
}
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. 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.