Skip to main content

On-chain Query Endpoints

Public reads of the ReferralRebate / ReferralStorage contracts on this deployment's chain. No authentication.

User on-chain rebate info

GET /referral/on-chain/user-rebate/:address
{
"address": "0x29f721b203a9fc9c5dde35a739d8b8e0e4605489",
"claimed_usd": "50000000",
"nonce": 2,
"referral_code": "4DDDC2D4",
"referrer": "0x0000000000000000000000000000000000000000",
"tier_level": 2,
"tier_name": "Silver"
}
FieldDescription
claimed_usdTotal claimed on-chain, in 10^6 units
nonceCurrent claim nonce (increments per on-chain claim)
referral_codeCode registered on-chain (decoded bytes32)
referrerReferrer address, zero address if none
tier_level / tier_nameOn-chain tier (0 Starter … 4 Diamond)

Backed by getUserRebateInfo(address).

Trader on-chain referral info

GET /referral/on-chain/referral-info/:address
{
"address": "0x...",
"code": "4DDDC2D4",
"referrer": "0x...",
"total_rebate_bps": 1200,
"trader_discount_bps": 0,
"affiliate_reward_bps": 1200
}

1 bps = 0.01 %. Backed by getReferralInfo(address).

On-chain claimed amount

GET /referral/on-chain/claimed/:address
{ "address": "0x...", "claimed_usd": "50000000" }

Operator status

GET /referral/on-chain/operator-status
{
"operator_address": "0xbab0acf138842e76dd769e20b94950ff87ff3c5b",
"is_operator": true,
"contract_address": "0x..."
}
FieldDescription
operator_addressBackend signer address
is_operatorWhether the signer is an operator on the contract; false means hourly batchSyncRebates calls will fail — contact operations
contract_addressReferralRebate address on this chain

Errors

HTTPcode
400INVALID_ADDRESS
500CHAIN_ERROR