ADL Quantile
Description
Get the ADL (Auto-Deleveraging) quantile estimation for user positions.
HTTP Request
GET /fapi/v1/adlQuantile (HMAC SHA256)
Weight
5
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | STRING | NO | Trading pair |
| timestamp | LONG | YES | Timestamp |
Response Example
[
{
"symbol": "BTCUSDT",
"adlQuantile": {
"LONG": 0, // 0 to 4, 4 indicates highest probability
"SHORT": 1,
"BOTH": 0
}
}
]
Quantile values are updated every 30 seconds. If no symbol is sent, ADL quantiles for all positions will be returned.
Code Examples
cURL
API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="symbol=BTCUSDT×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-sepolia.ztdx.io/fapi/v1/adlQuantile?${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})
# Get ADL quantile estimation for BTCUSDT
resp = signed_get("/fapi/v1/adlQuantile", params={
"symbol": "BTCUSDT"
})
print(resp.json())