v1
latestOpenAPI 3.1.02026-07-265385123.6 KBPOST /api/v1/referrals/redeem
Redeems a referral code for an account. Validates the code in ClickHouse, then submits an admin_create_new_subaccount transaction on-chain to create the user's subaccount (bypassing invite-only gating).
Referral tracking (code → user → referrer) stays entirely off-chain in ClickHouse. Fee discounts and on-chain referral relationships will be bulk-registered post-TGE.
After successful on-chain tx, writes a record to referral_redemptions in ClickHouse to track usage_count for code exhaustion.
This handler is idempotent: retrying the same (account, code) pair returns 200. Retrying with a different code returns 409.
Graceful degradation: if ClickHouse writes fail after on-chain tx success, the handler still returns 200 (the tx is the source of truth). Failed CH writes are logged with RECONCILE_NEEDED prefix for manual follow-up.
Request body
Response
Referral code redeemed