Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.parquet.exchange/llms.txt

Use this file to discover all available pages before exploring further.

This page walks you, the affiliate, through what actually happens on-chain between the moment a trader uses your referral code and the moment USDC lands in your token account. If you are looking for the operator-side intro to the referrals program, start at the existing Referrals page.

Where attribution lives

Perp-engine owns three PDAs that together form the referral system:
PDAOwnerPurpose
ReferralCodeperp-engineYour claimable code as an affiliate.
TraderReferralperp-engineLinks one trader to one affiliate. Created on the trader’s first open if they supplied a referral code.
ReferralConfigperp-engineHolds the tier table (up to four tiers) and the per-affiliate tier assignment. Admin-managed.
Once a trader’s TraderReferral PDA is initialized, the attribution is permanent for that trader. There is no expiry, no rotation, no clawback once a disbursement settles.

Tier system, not a flat rate

Parquet does not pay a single flat percentage to every affiliate. The protocol supports up to four tiers, configured by the admin instruction configure_referral_tiers([ReferralTier; 4]), and each affiliate is placed into a tier with set_referral_tier(tier: u8). Your tier determines what fraction of the trader’s fee flow accrues to you. At the program-wide level, the current protocol parameters route 0.2% of total fee volume into the referral reserve. How that pool is then distributed across the four tiers is set at deploy time and can change. We intentionally do not publish a per-tier percentage on this page — talk to the operator about which tier you are in and what its share currently looks like.
The number that matters to you is your tier’s share of the referral reserve, not the 0.2% aggregate. The 0.2% is the size of the pie; your tier decides your slice.

Disbursement is pull, per market

You receive USDC by calling claim_affiliate_reward on perp-engine. The flow has two pieces:
  1. Accrual (automatic). As traders attributed to you pay fees, perp-engine credits your per-market AffiliateReward PDA’s accrued_usdc field. AffiliateReward is seeded [b"affiliate_reward", affiliate, market_id], so accruals are tracked per market.
  2. Claim (you do this). You sign claim_affiliate_reward for a specific market. The handler zeroes accrued_usdc on that AffiliateReward and CPIs disburse_referral on fee-distributor, with perp-engine’s engine_auth PDA signing the CPI. USDC moves from the fee-distributor’s referral_reserve into your affiliate_usdc token account.
There is no protocol-level claim_referral_fees handler — that name does not exist. The pulling handler is claim_affiliate_reward, and there is one AffiliateReward PDA per (affiliate, market) pair, so you may need to claim across several markets to drain your accrued balance.
Your affiliate_usdc token account must exist (and be a USDC SPL token account owned by you) at claim time, or the CPI fails. The close_affiliate_reward handler lets you reclaim PDA rent when you are done with a specific market.

Becoming an affiliate

The current onboarding flow is operator-driven. To become an affiliate you need someone with admin authority to:
  1. Configure your ReferralCode PDA on perp-engine (this binds the code to your wallet and your USDC destination).
  2. Assign you a tier via set_referral_tier.
Until both steps are done, traders can technically pass your wallet as a referrer on their first open, but no ReferralConfig tier means no accrual. Reach out via the operator workflow described on the Referrals page to start that process. The glossary entry for referrer covers the on-chain terminology if you want a quick orientation before you talk to the operator.
Attribution is one-shot per trader. Once their TraderReferral PDA is written, you cannot re-attribute that trader to a different affiliate, and no one else can either. Make sure traders use the correct code on their very first open.