跳到主要内容

积分历史明细

返回当前登录用户的积分事件历史,支持分页。

GET /points/history
Authorization: Bearer <token>

Query 参数

参数类型必填说明
epochintegerEpoch 编号;默认当前
typestring积分类型过滤:trading / pnl / holding / referral / staking
pageinteger页码,从 1 开始(默认 1)
page_sizeinteger每页条数,最大 100(默认 20)

响应

{
"success": true,
"data": {
"events": [
{
"id": "b2c3d4e5-...",
"point_type": "trading",
"points": "1.20",
"metadata": {
"volume": "1000.00",
"role": "maker",
"tier": "T1",
"role_rate": "1.2",
"raw_points": "1.20",
"final_points": "1.20",
"cap_applied": false,
"daily_used_before": "0",
"weekly_used_before": "0"
},
"created_at": "2026-04-15T10:00:00Z"
},
{
"id": "c3d4e5f6-...",
"point_type": "referral",
"points": "10.00",
"metadata": {
"rp_type": "trigger",
"counterpart": "0xdef...",
"trade_id": "a1b2c3d4-..."
},
"created_at": "2026-04-14T08:30:00Z"
}
],
"total": 125,
"page": 1,
"page_size": 20
},
"error": null,
"timestamp": 1745280000
}

data 内的根字段为 events(非 items)。每条记录只含 {id, point_type, points, metadata, created_at},关联 trade/order/position ID 不在此接口返回。

metadata 的键因 point_type 而异。trading 事件:{volume, role, tier, role_rate, raw_points, final_points, cap_applied, daily_used_before, weekly_used_before}(数值序列化为字符串,cap_applied 为布尔值)。referral 事件:{rp_type, counterpart, trade_id}

响应字段

字段类型说明
eventsarray积分事件列表
totalint符合过滤条件的事件总数
pageint当前页码
page_sizeint每页条数

events[]

字段类型说明
idstring事件 UUID
point_typestring积分类型:trading / pnl / holding / referral / staking
pointsDecimal本次获得积分
metadataobject事件附加信息(因 point_type 不同而异)
created_atstring事件时间(ISO 8601)

代码示例

Python

import requests

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

resp = requests.get(
f"{BASE_URL}/points/history",
headers={"Authorization": f"Bearer {JWT_TOKEN}"},
params={"page": 1, "page_size": 20},
)
data = resp.json()["data"]

print(f"共 {data['total']} 条记录")
for e in data["events"]:
print(f" [{e['point_type']}] +{e['points']} 积分 {e['created_at']}")