跳到主要内容

模拟积分计算

预计算一笔交易可获得的积分,不实际写入任何数据。

POST /points/simulate
Authorization: Bearer <token>

Query 参数

参数类型必填说明
epochintegerEpoch 编号;默认当前

请求体

{
"trade_amount": 5000.00,
"order_type": "maker",
"tier": 2
}
字段类型必填说明
trade_amountdecimal本次交易名义金额(USD)
order_typestringmakertaker
tierinteger指定 Tier 1/2/3;不填则使用用户当前 Tier

响应

{
"success": true,
"data": {
"tp_estimate": "7.50",
"tp_effective": "6.00",
"hp_estimate": "0.00",
"total_estimate": "6.00",
"tier": "T2",
"role_rate": "1.5",
"daily_cap_status": {
"used": "4320.00",
"cap": 5000,
"remaining": "680.00"
},
"weekly_cap_status": {
"used": "18500.00",
"cap": 25000,
"remaining": "6500.00"
}
},
"error": null,
"timestamp": 1745280000
}

hp_estimate 当前恒为 "0.00",为未来阶段占位字段。

响应字段

字段类型说明
tp_estimateDecimal未经上限限制的原始 TP
tp_effectiveDecimal应用日/周上限后的实际 TP
hp_estimateDecimalHP 估算(当前恒为 "0.00"
total_estimateDecimal本次交易实际可得总积分
tierstring计算所用 Tier
role_ratestring使用的 Maker/Taker 费率
daily_cap_status.usedDecimal今日已用 TP
daily_cap_status.capint日上限(5,000)
daily_cap_status.remainingDecimal今日剩余 TP 配额
weekly_cap_status.usedDecimal本周已用 TP
weekly_cap_status.capint周上限(25,000)
weekly_cap_status.remainingDecimal本周剩余 TP 配额

TP 计算公式

TP_raw = (trade_amount / 1000) × tier_rate
TP_effective = min(TP_raw, daily_remaining, weekly_remaining)
交易量角色TierTP
$1,000MakerT11.2
$5,000MakerT27.5
$10,000TakerT313.0

代码示例

Python

import requests

BASE_URL = "https://api.prex.world/api/v1"
JWT_TOKEN = "your_jwt_token"

resp = requests.post(
f"{BASE_URL}/points/simulate",
headers={"Authorization": f"Bearer {JWT_TOKEN}"},
json={"trade_amount": 5000.00, "order_type": "maker"},
)
data = resp.json()["data"]

print(f"预估 TP: {data['tp_estimate']} → 实际: {data['tp_effective']}")
print(f"今日剩余配额: {data['daily_cap_status']['remaining']}")