POST /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.
Documentation Index
Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer token from Geomi. See Authentication for setup instructions.

