User Trades Slippage
Description
Get per-trade slippage for the authenticated user. For every fill, the endpoint compares the expected price captured at order submission (mark_price_at_creation) against the actual execution price.
Slippage is signed so that positive values are unfavorable to the user (paid more on BUY, received less on SELL). Maker fills typically show slippage ≈ 0 since limit price is guaranteed.
HTTP Request
GET /fapi/v1/userTrades/slippage (HMAC SHA256)
Weight
5
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | STRING | NO | Trading pair filter |
| startTime | LONG | NO | Start time in milliseconds |
| endTime | LONG | NO | End time in milliseconds |
| limit | INT | NO | Default 500; Max 1000 |
| timestamp | LONG | YES | Timestamp |
Response Fields
| Field | Type | Description |
|---|---|---|
| symbol | STRING | Trading pair |
| tradeId | STRING | Trade ID |
| orderId | STRING | The user's order ID for this fill |
| side | STRING | BUY / SELL (from user's perspective) |
| orderType | STRING | LIMIT / MARKET |
| expectedPrice | STRING | Mark price snapshot when the order was submitted |
| executedPrice | STRING | Actual fill price |
| qty | STRING | Filled quantity (base asset) |
| slippageAbs | STRING | Signed absolute slippage in quote currency |
| slippageBps | STRING | Signed slippage in basis points (positive = worse for user) |
| maker | BOOL | Whether user was the maker side |
| time | LONG | Trade timestamp (ms) |
Calculation
sign = +1 for BUY, -1 for SELL
slippageAbs = (executedPrice - expectedPrice) * sign
slippageBps = slippageAbs / expectedPrice * 10000
Response Example
[
{
"symbol": "BTCUSDT",
"tradeId": "0fbb7679-7960-41b1-8025-054450129024",
"orderId": "b8bab68c-d41b-462b-8a9e-d451ac1e1665",
"side": "BUY",
"orderType": "LIMIT",
"expectedPrice": "71101.000000000000000000",
"executedPrice": "70808.990000000000000000",
"qty": "0.008431111111110778",
"slippageAbs": "-292.010000000000000000",
"slippageBps": "-41.0697",
"maker": true,
"time": 1776066625866
}
]
In the example above, a BUY fill executed 292 USDT below expectation — a negative slippage, meaning the trade was favorable to the user.
Code Examples
cURL
API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="symbol=BTCUSDT&limit=500×tamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${QUERY_STRING}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')
curl -s -H "X-MBX-APIKEY: ${API_KEY}" \
"https://api.ztdx.io/fapi/v1/userTrades/slippage?${QUERY_STRING}&signature=${SIGNATURE}"
Python
import time, hmac, hashlib, requests
API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.ztdx.io"
def sign(params: str) -> str:
return hmac.new(API_SECRET.encode(), params.encode(), hashlib.sha256).hexdigest()
def signed_get(path, params={}):
params["timestamp"] = int(time.time() * 1000)
qs = "&".join(f"{k}={v}" for k, v in params.items())
params["signature"] = sign(qs)
return requests.get(f"{BASE_URL}{path}", params=params, headers={"X-MBX-APIKEY": API_KEY})
resp = signed_get("/fapi/v1/userTrades/slippage", params={"symbol": "BTCUSDT", "limit": "500"})
print(resp.json())