Referral Data APIs
All referral endpoints require authentication. Include the session cookie from API Key Login or Wallet Login in every request.
List Epochs
Returns all epochs where start_time <= now, ordered by epoch ascending.
GET /api/v1/referral/epochs
No request parameters.
Response
{
"epochs": [
{
"epoch": 1,
"start_time": "2025-01-01T00:00:00Z",
"end_time": "2025-01-07T23:59:59Z"
},
{
"epoch": 2,
"start_time": "2025-01-08T00:00:00Z",
"end_time": "2025-01-14T23:59:59Z"
}
]
}
| Field |
Type |
Description |
epochs |
array |
List of epochs up to the current time |
epochs[].epoch |
int |
Epoch number |
epochs[].start_time |
string (ISO 8601) |
Start of the epoch |
epochs[].end_time |
string (ISO 8601) |
End of the epoch |
Get Point Summary
Returns the total points and community referral points earned by the authenticated account, optionally filtered to a range of epochs.
GET /api/v1/referral/points
Query Parameters
| Parameter |
Type |
Required |
Description |
from_epoch |
int32 |
No |
Start of epoch range (inclusive). 0 or omitted means no lower bound. |
to_epoch |
int32 |
No |
End of epoch range (inclusive). 0 or omitted means no upper bound. Must be >= from_epoch when both are set. |
Omitting or setting either parameter to 0 removes that bound, returning all epochs in that direction.
Response
{
"total_points": 1500.5,
"community_referral_points": 320.25
}
| Field |
Type |
Description |
total_points |
float64 |
Total points earned by the account |
community_referral_points |
float64 |
Points earned specifically from community referrals |
Errors
| HTTP Status |
Description |
400 |
to_epoch < from_epoch when both are non-zero |
401 |
Missing or invalid session cookie |
Get Referral Data
Returns paginated direct referral data for accounts referred by the authenticated account, aggregated over a range of epochs or, with from_date / to_date, over a range of UTC days. By default, referred accounts with no trading activity may not appear in the results. Set include_all_referrals to true to include all current referrals regardless of activity. Set account_id to look up a single referred account; for its per-day breakdown, use Get Referral Daily Data.
GET /api/v1/referral/data
Query Parameters
| Parameter |
Type |
Required |
Description |
from_epoch |
int32 |
No |
Start of epoch range (inclusive). 0 or omitted means no lower bound. Cannot be combined with from_date / to_date. |
to_epoch |
int32 |
No |
End of epoch range (inclusive). 0 or omitted means no upper bound. Must be >= from_epoch when both are set. Cannot be combined with from_date / to_date. |
from_date |
string |
No |
First UTC day of a daily range (inclusive), as YYYY-MM-DD. Omitted means the first day daily data is available. |
to_date |
string |
No |
Last UTC day of a daily range (inclusive), as YYYY-MM-DD. Omitted means yesterday (UTC). Must be a completed day and >= from_date. |
account_id |
string |
No |
Return only this account. The result is empty (total is 0) unless the account is a direct referral of the authenticated account under the other filters. Combine with include_all_referrals=true to check whether an account is a direct referral, including one with no trading activity. |
page_number |
int32 |
No |
Page number (1-indexed). Defaults to 1. |
page_size |
int32 |
No |
Number of results per page. Defaults to 100. |
include_all_referrals |
bool |
No |
When true, all current direct referrals are included regardless of trading activity. Accounts without attributed performance data in the requested epoch or day range will show zero values. Defaults to false. |
Daily Data
Setting from_date or to_date aggregates the referral data by UTC day (00:00 to 24:00 UTC) instead of by epoch. For example, the data for 26 October 2026 alone:
GET /api/v1/referral/data?from_date=2026-10-26&to_date=2026-10-26
- Daily data starts on the day daily referral payouts started. Earlier dates are rejected; the error's
params.earliest_date gives the first available day.
- Only completed days are served, so
to_date can be at most yesterday (UTC). The most recent day can still be updated for a short time after 00:00 UTC while its data settles.
Response
{
"referrals": [
{
"account_id": "ACC:1234abcd",
"username": "trader_one",
"funding_account_address": "0xAbCd1234...",
"trade_type": "Perpetual",
"total_trading_volume": 50000.0,
"total_trading_fee": 125.0,
"total_eligible_trading_fee": 62.5,
"earning_from_referral": 31.25,
"cashback_earning": 10.0,
"referral_join_time": "2026-09-01T08:30:00Z"
}
],
"total": 42,
"page_number": 1,
"page_size": 20,
"total_trading_volume": 150000.0
}
| Field |
Type |
Description |
referrals |
array |
List of referred accounts for the requested page |
referrals[].account_id |
string |
Account ID of the referred user |
referrals[].username |
string |
Username of the referred user |
referrals[].funding_account_address |
string |
EVM wallet address of the referred user's funding account |
referrals[].trade_type |
string |
Trade type the referral data covers. Always Perpetual; the referral program pays on perpetual trading only |
referrals[].total_trading_volume |
float64 |
Total trading volume generated by the referred account |
referrals[].total_trading_fee |
float64 |
Total trading fees paid by the referred account |
referrals[].total_eligible_trading_fee |
float64 |
Total trading fees paid by the referred account that is eligible for commission calculation after discounting maker fee rebates |
referrals[].earning_from_referral |
float64 |
Referral earnings credited to the referrer, calculated as a share of the generated fees eligible for commission |
referrals[].cashback_earning |
float64 |
Cashback earnings credited to the referred account |
referrals[].referral_join_time |
string (ISO 8601) |
When the account became a referral of the authenticated account |
total |
int64 |
Total number of referred accounts matching the filter |
page_number |
int32 |
Current page number |
page_size |
int32 |
Number of results per page |
total_trading_volume |
float64 |
Total trading volume of the authenticated (referrer) account, scoped by the requested epoch or day range |
Errors
| HTTP Status |
Description |
400 |
to_epoch < from_epoch when both are non-zero |
400 |
err_referral_date_with_epoch: from_date / to_date combined with from_epoch / to_epoch |
400 |
err_validation_invalid_date_format: from_date or to_date is not YYYY-MM-DD |
400 |
err_referral_daily_data_unavailable: daily data is not available yet |
400 |
err_referral_date_out_of_range: a date outside params.earliest_date to params.latest_date, or to_date < from_date |
401 |
Missing or invalid session cookie |
Errors with a code return a JSON body, for example:
{
"code": "err_referral_date_out_of_range",
"message": "dates must be completed UTC days from earliest_date to latest_date, and to_date >= from_date",
"params": {
"earliest_date": "2026-08-04",
"latest_date": "2026-10-26"
}
}
Get Referral Daily Data
Returns one entry per UTC day for a single referred account: its perpetual trading on that day and the commission it generated for the authenticated account. It uses the same daily data as Get Referral Data.
POST /api/v1/referral/daily_data
Request Body
{
"account_id": "ACC:1234abcd",
"from_date": "2026-09-01",
"to_date": "2026-10-26"
}
| Field |
Type |
Required |
Description |
account_id |
string |
Yes |
Account ID of the referred user. Must be a direct referral of the authenticated account. |
from_date |
string |
No |
First UTC day (inclusive), as YYYY-MM-DD. Omitted means 89 days before to_date (a 90-day range), but no earlier than the first day daily data is available. |
to_date |
string |
No |
Last UTC day (inclusive), as YYYY-MM-DD. Omitted means yesterday (UTC). Must be a completed day and >= from_date. |
- The range can be at most 300 days.
- Only days with activity are returned.
Response
{
"account_id": "ACC:1234abcd",
"username": "trader_one",
"funding_account_address": "0xAbCd1234...",
"referral_join_time": "2026-09-01T08:30:00Z",
"from_date": "2026-09-01",
"to_date": "2026-10-26",
"days": [
{
"date": "2026-10-25",
"trade_type": "Perpetual",
"total_trading_volume": 12000.0,
"total_trading_fee": 30.0,
"total_eligible_trading_fee": 15.0,
"earning_from_referral": 7.5,
"cashback_earning": 1.5
}
]
}
| Field |
Type |
Description |
account_id |
string |
Account ID of the referred user |
username |
string |
Username of the referred user |
funding_account_address |
string |
EVM wallet address of the referred user's funding account |
referral_join_time |
string (ISO 8601) |
When the account became a referral of the authenticated account |
from_date |
string |
First day of the returned range (YYYY-MM-DD), after defaults are applied |
to_date |
string |
Last day of the returned range (YYYY-MM-DD), after defaults are applied |
days |
array |
One entry per UTC day with activity credited to the authenticated account, in ascending date order. Empty when there is none |
days[].date |
string |
UTC day, as YYYY-MM-DD |
days[].trade_type |
string |
Trade type the data covers. Always Perpetual |
days[].total_trading_volume |
float64 |
Trading volume generated by the referred account on the day |
days[].total_trading_fee |
float64 |
Trading fees paid by the referred account on the day |
days[].total_eligible_trading_fee |
float64 |
Trading fees eligible for commission calculation after discounting maker fee rebates |
days[].earning_from_referral |
float64 |
Referral earnings credited to the authenticated account for the day |
days[].cashback_earning |
float64 |
Cashback earnings credited to the referred account for the day |
Errors
| HTTP Status |
Description |
400 |
err_invalid_request_body: the body is not valid JSON |
400 |
err_missing_required_fields: account_id is missing |
400 |
err_validation_invalid_date_format: from_date or to_date is not YYYY-MM-DD |
400 |
err_referral_daily_data_unavailable: daily data is not available yet |
400 |
err_referral_date_out_of_range: a date outside params.earliest_date to params.latest_date, or to_date < from_date |
400 |
err_referral_date_range_too_large: the range is longer than params.max_days (300) days |
401 |
Missing or invalid session cookie |
404 |
err_referral_account_not_found: the account is not a referral of the authenticated account, or does not exist |
Get Indirect Referral Data
Returns paginated indirect (L2) referral data for the authenticated account. Indirect referrals are accounts referred by the authenticated account's direct referrals, optionally filtered to a range of epochs. By default, referred accounts with no trading activity may not appear in the results. Set include_all_referrals to true to include all current referrals regardless of activity.
GET /api/v1/referral/indirect_data
Query Parameters
| Parameter |
Type |
Required |
Description |
from_epoch |
int32 |
No |
Start of epoch range (inclusive). 0 or omitted means no lower bound. |
to_epoch |
int32 |
No |
End of epoch range (inclusive). 0 or omitted means no upper bound. Must be >= from_epoch when both are set. |
page_number |
int32 |
No |
Page number (1-indexed). Defaults to 1. |
page_size |
int32 |
No |
Number of results per page. Defaults to 100. |
include_all_referrals |
bool |
No |
When true, all current indirect referrals are included regardless of trading activity. Accounts without attributed performance data in the requested epoch range will show zero values. Defaults to false. |
Response
{
"referrals": [
{
"account_id": "ACC:5678efgh",
"username": "indirect_trader",
"funding_account_address": "0xEfGh5678...",
"total_trading_volume": 25000.0,
"total_trading_fee": 62.5,
"total_eligible_trading_fee": 31.25,
"earning_from_referral": 15.625
}
],
"total": 10,
"page_number": 1,
"page_size": 20
}
| Field |
Type |
Description |
referrals |
array |
List of indirect referred accounts for the requested page |
referrals[].account_id |
string |
Account ID of the indirect referred user |
referrals[].username |
string |
Username of the indirect referred user |
referrals[].funding_account_address |
string |
EVM wallet address of the indirect referred user's funding account |
referrals[].total_trading_volume |
float64 |
Total trading volume generated by the indirect referred account |
referrals[].total_trading_fee |
float64 |
Total trading fees paid by the indirect referred account |
referrals[].total_eligible_trading_fee |
float64 |
Total trading fees eligible for commission calculation after discounting maker fee rebates |
referrals[].earning_from_referral |
float64 |
Referral earnings from the indirect referral, calculated as a share of the generated fees eligible for commission |
total |
int64 |
Total number of indirect referred accounts matching the filter |
page_number |
int32 |
Current page number |
page_size |
int32 |
Number of results per page |
Errors
| HTTP Status |
Description |
400 |
to_epoch < from_epoch when both are non-zero |
401 |
Missing or invalid session cookie |