Nếu bot của bạn đã tương thích Binance USD-M Futures, chỉ cần đổi một base URL là hoạt động ngay trên BuyCrypt. Người dùng của chúng tôi khám phá bot của bạn trên bảng xếp hạng, dùng thử miễn phí trên tài khoản demo $1.000, và nâng cấp lên API key thật khi đã tin tưởng.
Không cần viết lại code. Không có đặc thù riêng của từng sàn. Cùng cách ký HMAC-SHA256, cùng luồng WebSocket user-data, cùng các loại lệnh — được bọc trên engine giao dịch demo của chúng tôi để người dùng so sánh các bot mà không phải chịu rủi ro vốn thật.
Mỗi người dùng đăng ký sẽ có tài khoản demo riêng với số dư ảo $1.000. Bot của bạn giao dịch trên đó. Họ theo dõi PnL, drawdown, tỷ lệ thắng theo thời gian thực. Không rủi ro cho vốn thật của họ — và không tốn chi phí thu hút khách hàng cho bạn.
Tài khoản demo của bot bạn xuất hiện trên bảng xếp hạng công khai với huy hiệu 🤖 БОТ. Người dùng thấy xếp hạng PnL giữa các trader thật. Chạm vào dòng, nhấn "Kết nối" — đăng ký ngay lập tức.
Nếu bot của bạn dùng bất kỳ SDK Binance Futures nào (binance-connector-python, python-binance, CCXT, v.v.), hãy trỏ base_url của nó đến https://api.buycrypt.com/fapi. HMAC, recvWindow, các loại lệnh — giống hệt.
Khi một người dùng đăng ký, chúng tôi POST API key + secret vừa tạo đến webhook URL của bạn — có chữ ký HMAC, tự thử lại khi thất bại theo exponential backoff, có thể khôi phục từ dead-letter. Bạn không bao giờ phải hỏi thông tin đăng nhập từ người dùng.
Người dùng mở bảng xếp hạng. Tài khoản bot của bạn xuất hiện với nhãn 🤖 БОТ bên cạnh tên người dùng, cùng số lượng người đăng ký. Họ chạm vào dòng đó.
Trên trang hồ sơ của bot, họ thấy "Kết nối với tài khoản demo". Một lần chạm sẽ tạo tài khoản demo $1.000 mới cho họ và bot của bạn bắt đầu giao dịch trên đó.
Người dùng theo dõi bot giao dịch trên tài khoản demo của họ trong vài ngày hoặc vài tuần. PnL, vị thế, tỷ lệ thắng — tất cả trực tiếp trong ứng dụng. Nếu họ thích, họ nhập API key Binance thật vào BuyCrypt để nâng cấp từ demo lên thật.
Người dùng thêm API key Binance thật của họ vào BuyCrypt. Chúng tôi gửi nó đến webhook của bạn theo cách giống hệt như đã gửi key demo — cùng sự kiện subscription.created, chỉ khác là với thông tin đăng nhập thật. Một lần tích hợp duy nhất bao phủ cả luồng demo lẫn luồng thật.
Đăng ký tài khoản BuyCrypt thông thường — cùng quy trình như bất kỳ người dùng nào. Bạn sẽ được cấp tài khoản demo miễn phí với số dư khởi điểm ngay khi đăng ký. Không cần đơn đăng ký, không hàng chờ duyệt.
Tạo API key ngay trong ứng dụng di động BuyCrypt: My Profile → API keys → chạm vào tài khoản demo của bạn → Generate. Bạn sẽ nhận được apiKey + apiSecret mới, chỉ hiển thị một lần — hãy sao chép chúng vào bot của bạn. Sau đó trỏ bot Binance USD-M Futures hiện có của bạn đến https://api.buycrypt.com/fapi và mọi thứ hoạt động ngay — cùng HMAC, cùng endpoint, cùng loại lệnh.
Ngay khi chúng tôi phát hiện giao dịch qua API trên tài khoản demo của bạn, tài khoản của bạn sẽ tự động được gắn nhãn là bot. Demo của bạn xuất hiện trên bảng xếp hạng với nhãn 🤖 БОТ và hồ sơ công khai, để người dùng khác có thể khám phá và đăng ký theo.
Khi bạn đã sẵn sàng nhận người đăng ký, hãy thêm webhook URL vào hồ sơ bot của bạn trong phần cài đặt. Mỗi khi một người dùng đăng ký — trên demo hoặc với API key Binance thật — chúng tôi POST sự kiện subscription.created kèm API key + secret cho tài khoản người dùng đó. Lưu lại (userId, apiKey, apiSecret) và bắt đầu giao dịch thay mặt họ.
Hầu hết các SDK Binance Futures đều chấp nhận base URL tùy chỉnh. Đây là toàn bộ thay đổi mà một bot Python thông thường cần:
# before — trading on real Binance from binance.um_futures import UMFutures client = UMFutures(key=API_KEY, secret=API_SECRET) # after — trading on a BuyCrypt user's demo from binance.um_futures import UMFutures client = UMFutures( key=API_KEY, secret=API_SECRET, base_url="https://api.buycrypt.com/fapi", # <- the only line that changes ) # everything below is identical to your existing code client.new_order(symbol="BTCUSDT", side="BUY", type="MARKET", quantity=0.01) client.account() client.cancel_open_orders(symbol="BTCUSDT")
CCXT, python-binance, go-binance của Go, node-binance-api của JS — tất cả đều hoạt động như nhau. Các bot dùng requests.get(...).headers["X-MBX-APIKEY"] = key đơn giản cũng chạy được; quy tắc ký HMAC giống hệt từng byte.
Khi một người dùng BuyCrypt đăng ký theo bot của bạn, chúng tôi tạo API key + secret riêng cho từng người dùng ở phía server và POST chúng đến webhook URL đã đăng ký của bạn. Secret không bao giờ được trả về cho người dùng — nó chỉ được gửi đến bạn, qua HTTPS, có chữ ký.
TL;DR: sign up → tap «Generate API key» on your demo → generate a webhook secret → run one Python script → admin approves. ~5 minutes.
Open buycrypt.com/terminal (or the mobile app). Sign in via Google or phone. A $1,000 USDT demo account is created automatically — that's the sandbox your bot will trade on.
In the app: Profile → API Keys → tap your demo account → «Bot API keys» → Generate. A dialog shows the apiKey + apiSecret once — copy both, you can't recover the secret afterwards.
# what you'll save API_KEY = "3fc370a4ac94b9aa756e2a97842dc04c" API_SECRET = "3WJ86kV_VQzLWaED3hSRlY9R6wQHh_f3UEZ_q-CrwRU"
Same shape as Binance — your existing USD-M Futures bot library reads it as a regular Binance key with base URL https://api.buycrypt.com/fapi.
A second secret, separate from API_SECRET. We use it to sign the events we POST to your webhook URL — so you can verify the request really came from us. You generate it on your side; we encrypt-store it but never reveal back:
# any of these works — pick one. Save the output. $ openssl rand -hex 32 # macOS / Linux $ python3 -c "import secrets; print(secrets.token_hex(32))" # cross-platform # sample output 8a31c2f4d5e6789abc01234567890def8a31c2f4d5e6789abc01234567890def
Drop your three secrets into one signed POST. Save this as register_bot.py and run it once. Works on any OS with Python 3.10+ and pip install requests:
import hmac, hashlib, time, urllib.parse, requests # ─── fill these in from steps 2 and 3 ───────────────────── API_KEY = "3fc370a4ac94b9aa756e2a97842dc04c" API_SECRET = "3WJ86kV_VQzLWaED3hSRlY9R6wQHh_f3UEZ_q-CrwRU" WEBHOOK_SECRET = "8a31c2f4d5e6789abc01234567890def8a31c2f4d5e6789abc01234567890def" SLUG = "alpha-trader" # lowercase, [a-z0-9-], unique DISPLAY_NAME = "Alpha Trader" # shown to users in the bot list WEBHOOK_URL = "https://your-bot.example.com/buycrypt/hook" # MUST be HTTPS, public # ────────────────────────────────────────────────────────── params = { "slug": SLUG, "displayName": DISPLAY_NAME, "webhookUrl": WEBHOOK_URL, "webhookSecret": WEBHOOK_SECRET, "defaultLeverage": 10, "timestamp": int(time.time() * 1000), } qs = urllib.parse.urlencode(params) sig = hmac.new(API_SECRET.encode(), qs.encode(), hashlib.sha256).hexdigest() r = requests.post( "https://api.buycrypt.com/fapi/v1/bot/profiles", headers={ "X-MBX-APIKEY": API_KEY, "Content-Type": "application/x-www-form-urlencoded", }, data=qs + f"&signature={sig}", ) print(r.status_code, r.json())
Notice no demoKeyPairId — your API_KEY already points to the demo it was generated for. Need to register against a different demo? Generate a separate API key for it (step 2 again).
Expected output:
201 {
"botId": 42,
"slug": "alpha-trader",
"status": "PENDING_REVIEW",
"webhookUrl": "https://your-bot.example.com/buycrypt/hook",
"webhookStatus": "ACTIVE",
"webhookSecretAutoGenerated": false
}
Common errors:
{"code":-2010, "msg":"Slug already in use."} # pick another slug
{"code":-1102, "msg":"webhookSecret must be at least 32..."} # too short — use 32+ chars
{"code":-1022, "msg":"Signature for this request is not valid."} # API_SECRET wrong, or params order changed after signing
{"code":-1003, "msg":"Bot registration rate limit: 1 per hour..."} # wait it out
Bot lands in PENDING_REVIEW. Our admin sees your request immediately and approves it. To check status anytime:
import hmac, hashlib, time, urllib.parse, requests API_KEY = "3fc370a4..." API_SECRET = "3WJ86kV..." qs = urllib.parse.urlencode({"timestamp": int(time.time() * 1000)}) sig = hmac.new(API_SECRET.encode(), qs.encode(), hashlib.sha256).hexdigest() r = requests.get( f"https://api.buycrypt.com/fapi/v1/bot/profiles?{qs}&signature={sig}", headers={"X-MBX-APIKEY": API_KEY}, ) print(r.json()) # [{"botId":42, "status":"ACTIVE", ...}] when approved
Once "status":"ACTIVE": every time a user subscribes we POST to your webhookUrl with the per-subscriber API key your bot will trade with. The events shape and a copy-paste signature-verification snippet are right below this section.
Lost your webhook secret? Pick a new one and rotate (same signing pattern as registration):
params = {
"webhookSecret": NEW_SECRET, # or omit to get backend-generated
"timestamp": int(time.time() * 1000),
}
qs = urllib.parse.urlencode(params)
sig = hmac.new(API_SECRET.encode(), qs.encode(), hashlib.sha256).hexdigest()
requests.post(
"https://api.buycrypt.com/fapi/v1/bot/profiles/42/webhook/rotate-secret",
headers={"X-MBX-APIKEY": API_KEY,
"Content-Type": "application/x-www-form-urlencoded"},
data=qs + f"&signature={sig}",
)
Old secret invalid the second the new one saves. Rate limit: 10 rotations/hour per bot.
subscription.created — người dùng vừa đăng kýPOST https://your-bot.example.com/buycrypt/hook Content-Type: application/json User-Agent: BuyCrypt-Webhook/1.0 X-BuyCrypt-Event: subscription.created X-BuyCrypt-Delivery-Id: 7f3b2e8c-a4d1-4f12-93b8-0c1e9f8d2a4b # dedup key — store + reject duplicates X-BuyCrypt-Timestamp: 1745605200123 # ms epoch when payload was built X-BuyCrypt-Signature: 5e8c2d… # hex(HMAC-SHA256(webhookSecret, ts + "." + body)) { "event": "subscription.created", "deliveryId": "7f3b2e8c-a4d1-4f12-93b8-0c1e9f8d2a4b", "timestamp": 1745605200123, "data": { "subscriptionId": 42, "botProfileId": 7, "subscriberHandle": "user_fb_uid_a", "apiKey": "3fc370a4ac94b9aa756e2a97842dc04c", "apiSecret": "3WJ86kV_VQzLWaED3hSRlY9R6wQHh_f3UEZ_q-CrwRU", "demoKeyPairId": 9001, "initialBalance": "1000.00000000", "permissions": "READ_TRADE", "ipWhitelist": "", "createdAt": "2026-04-25T18:00:00Z" } }
subscription.deleted — người dùng đã ngắt kết nối, key bị vô hiệu hóaX-BuyCrypt-Event: subscription.disconnected { "event": "subscription.disconnected", "deliveryId": "…", "timestamp": …, "data": { "subscriptionId": 42, "botProfileId": 7, "apiKey": "3fc370a4…", "reason": "USER_UNSUBSCRIBED", "disconnectedAt": "2026-04-25T18:30:00Z" } }
secret.regenerated — admin đã đổi mới webhook secret của bạnX-BuyCrypt-Event: secret.regenerated { "event": "secret.regenerated", "deliveryId": "…", "timestamp": …, "data": { "subscriptionId": 42, "apiKey": "3fc370a4…", "newApiSecret": "new_plaintext_keep_old_valid_24h", "oldSecretValidUntil": "2026-04-26T18:00:00Z" } }
Use the raw request body bytes — DO NOT parse JSON first and re-serialize, you'll lose key order and signatures will diverge. Always compare in constant time.
# Python (FastAPI / Flask) import hmac, hashlib, time WEBHOOK_SECRET = "whsec_aGVsbG8gd29ybGQ_..." # whsec_…43 chars def verify(headers, body_bytes): sig = headers["X-BuyCrypt-Signature"] ts = int(headers["X-BuyCrypt-Timestamp"]) # anti-replay: reject if too old if abs(time.time() * 1000 - ts) > 5 * 60 * 1000: return False payload = f"{ts}.".encode() + body_bytes expected = hmac.new(WEBHOOK_SECRET.encode(), payload, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, sig)
// Node.js / Express — read RAW body, not parsed JSON const crypto = require('crypto'); const SECRET = 'whsec_aGVsbG8gd29ybGQ_...'; app.post('/buycrypt/hook', express.raw({ type: 'application/json' }), // raw, not json()! (req, res) => { const sig = req.headers['x-buycrypt-signature']; const ts = parseInt(req.headers['x-buycrypt-timestamp'], 10); if (Math.abs(Date.now() - ts) > 5 * 60 * 1000) return res.status(401).end(); const expected = crypto.createHmac('sha256', SECRET) .update(`${ts}.`).update(req.body).digest('hex'); if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig))) { return res.status(401).end(); } // req.body is a Buffer here — JSON.parse(req.body.toString('utf8')) res.sendStatus(200); });
6 lần thử với exponential backoff: 1 phút, 5 phút, 30 phút, 2 giờ, 6 giờ, 12 giờ. Sau khi cả 6 lần thất bại, sự kiện sẽ vào bảng dead-letter của chúng tôi và admin có thể phát lại nó.
Nếu endpoint của bạn thất bại 10 lần liên tiếp, chúng tôi sẽ đánh dấu vô hiệu hóa và ngừng gửi sự kiện. Liên hệ với chúng tôi để kích hoạt lại. Điều này ngăn một bot đã ngừng hoạt động chặn người đăng ký mới vô thời hạn.
Mọi body đều được ký HMAC-SHA256 bằng secret mà chúng tôi đã chia sẻ khi đăng ký. Hãy xác minh trong thời gian không đổi (constant time) trước khi tin tưởng payload. Ví dụ có trong hướng dẫn đối tác của chúng tôi.
Base URL: https://api.buycrypt.com/fapi. Xác thực: header X-MBX-APIKEY + chữ ký HMAC-SHA256 trên các endpoint có ký. Recv window: mặc định 5.000 ms, tối đa 60.000 ms.
{}.MARKET, LIMIT, STOP_MARKET, TAKE_PROFIT_MARKET, STOP, TAKE_PROFIT (dạng limit), TRAILING_STOP_MARKET. Các cờ: reduceOnly, closePosition, timeInForce (GTC/IOC/FOK), newClientOrderId để đảm bảo idempotent, workingType, callbackRate.orderId hoặc origClientOrderId.{dualSidePosition: false}.ORDER_TRADE_UPDATE, ACCOUNT_UPDATE, MARGIN_CALL. Cấu trúc payload giống hệt Binance.subscribe/unsubscribe/list_subscriptions — chuyển tiếp trực tiếp đến Binance gốc.X-MBX-USED-WEIGHT-1M, X-MBX-ORDER-COUNT-10S, Retry-After khi gặp 429.Retry-AfterKhông cần đơn đăng ký, không hàng chờ duyệt, không phí tích hợp. Đăng ký như bất kỳ người dùng nào, tạo API key trong ứng dụng di động, trỏ bot của bạn đến https://api.buycrypt.com/fapi — đó là toàn bộ quy trình onboarding.