Referral Commission Leaderboard
Returns the top-N referrers ranked by total commission earned. No authentication required.
GET /referral/leaderboard?n=<1-50>
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
n | integer | No | 10 | Number of top entries to return (1–50) |
Response
[
{
"rank": 1,
"referrer_address": "0x1234...abcd",
"total_commission": "1234.567890",
"computed_at": 1745280000000
},
{
"rank": 2,
"referrer_address": "0xabcd...5678",
"total_commission": "987.654321",
"computed_at": 1745280000000
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
rank | integer | Rank position (1 = highest commission) |
referrer_address | string | Referrer's wallet address |
total_commission | string | Total commission earned (USDT, decimal string) |
computed_at | int64 | Timestamp when the leaderboard was last computed (milliseconds) |
Error Codes
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAM | n is not in the range 1–50 |
| 500 | DB_ERROR | Database query failed |
Code Examples
Python
import requests
BASE_URL = "https://api.ztdx.io"
resp = requests.get(
f"{BASE_URL}/referral/leaderboard",
params={"n": 10},
)
leaderboard = resp.json()
for entry in leaderboard:
print(f"#{entry['rank']} {entry['referrer_address']}: {entry['total_commission']} USDT")
JavaScript
const resp = await fetch("https://api.ztdx.io/referral/leaderboard?n=10");
const leaderboard = await resp.json();
for (const entry of leaderboard) {
console.log(`#${entry.rank} ${entry.referrer_address}: ${entry.total_commission} USDT`);
}