Skip to main content

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

NameTypeRequiredDescription
symbolSTRINGNOTrading pair filter
startTimeLONGNOStart time in milliseconds
endTimeLONGNOEnd time in milliseconds
limitINTNODefault 500; Max 1000
timestampLONGYESTimestamp

Response Fields

FieldTypeDescription
symbolSTRINGTrading pair
tradeIdSTRINGTrade ID
orderIdSTRINGThe user's order ID for this fill
sideSTRINGBUY / SELL (from user's perspective)
orderTypeSTRINGLIMIT / MARKET
expectedPriceSTRINGMark price snapshot when the order was submitted
executedPriceSTRINGActual fill price
qtySTRINGFilled quantity (base asset)
slippageAbsSTRINGSigned absolute slippage in quote currency
slippageBpsSTRINGSigned slippage in basis points (positive = worse for user)
makerBOOLWhether user was the maker side
timeLONGTrade 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&timestamp=${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())