Developers

Referrals

Read your referral data from code: epochs, points, per-referral volume, fees and earnings, daily breakdowns, and referrals of your referrals.

On this page

URLs on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.

Use these calls to build reports for the people you referred to Grvt: their trading volume and fees, what you earned from them, and your points. They read data only.

The calls are on the edge host and have no SDK methods yet. Send them over HTTP.

CallReturns
GET /api/v1/referral/epochsthe reward epochs so far
GET /api/v1/referral/pointsyour points
GET /api/v1/referral/datayour direct referrals, with totals per referral
POST /api/v1/referral/daily_dataone direct referral, day by day
GET /api/v1/referral/indirect_datareferrals of your referrals

Before you call

  • Authenticate with your API key in an X-API-Key header, or with the session cookie from a login (Authentication). The data is for the account the key or session belongs to. Without either, calls fail with HTTP 401.
  • Account IDs in these calls are off-chain account IDs, such as "ACC:...", not 0x addresses. Each referral also has its funding_account_address, its main account ID.
  • Numbers in responses are JSON numbers, not decimal strings, rounded to 4 decimals. total is a string.
  • Errors come back as {"code": "err_...", "message": "...", "params": {...}} with an HTTP status.
export GRVT_DOMAIN=testnet.grvt.io
curl -sS "https://edge.testnet.grvt.io/api/v1/referral/epochs" -H "X-API-Key: $GRVT_API_KEY"
{"epochs": [{"epoch": 1, "start_time": "<RFC 3339 time>", "end_time": "<RFC 3339 time>"}]}

Epochs that have started are listed, oldest first. Use their numbers as from_epoch and to_epoch below.

Your points

GET /api/v1/referral/points?from_epoch=10&to_epoch=12 returns {"total_points": 1520.5, "community_referral_points": 230.25}. Leave out an epoch bound (or send 0) for no limit on that side.

Your direct referrals

When: you want totals per referral over a range of epochs or days.

curl -sS "https://edge.testnet.grvt.io/api/v1/referral/data?from_date=2026-11-01&to_date=2026-11-07&page_size=50" \
  -H "X-API-Key: $GRVT_API_KEY"

Query parameters, all optional:

ParameterMeaning
from_epoch, to_epochEpoch range. 0 or left out means no limit.
from_date, to_dateDay range, YYYY-MM-DD in UTC, both days included. Don't combine with epochs.
account_idOnly this referral.
page_number, page_sizePaging. Pages start at 1; the default size is 100.
include_all_referralstrue also lists referrals with no activity in the range, with zeros. Default false.

The response has referrals, total (how many referrals match), page_number, page_size and total_trading_volume, your own trading volume over the same range. Each referral has:

FieldMeaning
account_id, username, funding_account_addressWho they are
referral_join_timeWhen they last became your referral
trade_typeAlways "Perpetual": the program pays on perpetuals
total_trading_volume, total_trading_feeTheir volume and the fees they paid
total_eligible_trading_feeThe part of their fees your earnings are based on
earning_from_referralWhat you earned from them
cashback_earningThe cashback they earned

Watch out: with dates, only completed UTC days are served. to_date defaults to yesterday, and from_date to the first day with daily data. A range outside that fails with err_referral_date_out_of_range, whose params give earliest_date and latest_date.

One referral, day by day

curl -sS "https://edge.testnet.grvt.io/api/v1/referral/daily_data" \
  -H "X-API-Key: $GRVT_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"account_id": "ACC:...", "from_date": "2026-10-01", "to_date": "2026-10-31"}'
  • account_id is required and must be your direct referral; otherwise the call fails with err_referral_account_not_found (HTTP 404).
  • to_date defaults to yesterday and from_date to 89 days before it (90 days in all), but no earlier than the first day with data. The range can be at most 300 days (err_referral_date_range_too_large).

The response repeats the referral's account_id, username, funding_account_address, referral_join_time and the resolved from_date and to_date. days has one entry per day with activity: date, trade_type, total_trading_volume, total_trading_fee, total_eligible_trading_fee, earning_from_referral and cashback_earning.

Referrals of your referrals

GET /api/v1/referral/indirect_data takes from_epoch, to_epoch, page_number, page_size and include_all_referrals, as above (no dates). Each entry has account_id, username, funding_account_address, total_trading_volume, total_trading_fee, total_eligible_trading_fee and earning_from_referral; the response adds total, page_number and page_size.

Errors
StatusCodeCause
400err_invalid_query_paramsA bad query parameter, or to_epoch below from_epoch. params.reason says which.
400err_referral_date_with_epochDates and epochs in one request.
400err_validation_invalid_date_formatA date that isn't YYYY-MM-DD.
400err_referral_date_out_of_rangeOutside params.earliest_date to params.latest_date, or to_date before from_date.
400err_referral_daily_data_unavailableNo daily data yet.
400err_referral_date_range_too_largeMore than params.max_days days.
400err_invalid_request_body / err_missing_required_fieldsdaily_data body is not valid JSON, or has no account_id.
404err_referral_account_not_foundaccount_id is not your direct referral.
esc

↑ ↓ move↵ open⇧↵ open .mdTry an error code like 2002

Keyboard shortcuts

⌘ K
Search the docs
/
Search
l
Next code language (Python → TypeScript → Go → Rust → curl → WebSocket)
j / k
Next / previous page
t
Light / dark theme
?
This help
Esc
Close dialogs and drawers