This program manages an on-chain affiliate system. It allows wallets to register as affiliates, stores their commission rate, and has an instruction that can be called via CPI by other programs (like factory-program) to process commission payouts.
AffiliateInfo["affiliate_info", affiliate_pubkey]affiliate_key: Pubkey - The public key of the affiliate's wallet.total_referred_volume: u64 - The cumulative amount of tokens purchased through this affiliate's referrals.commission_rate_bps: u16 - The commission rate in basis points (e.g., 1000 = 10%).register_affiliateAffiliateInfo account for the signing wallet, registering them as an affiliate with a default commission rate.set_commission_ratenew_rate_bps: u16process_commissionmint_to instruction to issue the commission tokens to the affiliate's token account. The mint authority is the launch_state account from the calling program.purchased_tokens: u64InvalidRate: The provided commission rate is out of the valid range (0-10000).Overflow: A mathematical calculation resulted in an overflow.AuthorityMismatch: The signer does not have authority over the account.