ποΈAffiliate Codes vs Referral Codes
Fuul has two distinct code systems: affiliate codes for tracking link attribution, and referral codes for establishing referrer-user relationships directly. An affiliate code can also be activated as a referral code within a specific project.
Affiliate codes
An affiliate code is a personal, branded identifier that an affiliate uses in tracking links. Instead of sharing a raw wallet address, the affiliate creates a custom code for cleaner URLs.
# Without affiliate code (wallet address)
https://yourwebsite.com?af=0x1f9090aae28b8a3dceadf281b0f12828e676c326
# With affiliate code
https://yourwebsite.com?af=my-affiliate-codeWhen a user clicks the link, attribution happens automatically through the pageview β wallet connection flow. The affiliate doesn't need to share a separate code β the link does all the work.
Example: A KOL creates the affiliate code CRYPTO-GUY and shares tracking links on Twitter. Followers click the link, connect their wallet on the dapp, and all their future conversions are attributed to the KOL β without the user ever typing a code.
Created by
Affiliate (requires wallet signature)
Format
User-defined (e.g., CRYPTO-GUY)
Scope
Global β one code per affiliate across all Fuul projects
How it works
Embedded in tracking links (?af=code), attribution is automatic via pageview events
Best for
KOLs, influencers, affiliates sharing links on social media or content
Create and manage affiliate codes β Affiliate Links & Codes
Referral codes
A referral code is a code that a user explicitly accepts to establish a referrer-user relationship. The referred user enters the code in your UI and calls the SDK to accept it β no link click needed.
Referral codes are generated by the project on behalf of users via Fuul's API/SDK. They are auto-generated (random 7-character alphanumeric, e.g., A1B2C3D) and scoped to a single project.
Example: A DeFi protocol generates referral codes for its users. Alice gets code A1B2C3D and shares it in a Discord group. Bob opens the dapp, enters Alice's code, and signs a message to accept it. From that point on, Bob's conversions are attributed to Alice.
Created by
Project generates on behalf of users (via API/SDK)
Format
Auto-generated 7-char alphanumeric (e.g., A1B2C3D)
Scope
Project-specific
How it works
User explicitly accepts the code via SDK/API, creating a permanent referrer-user relationship
Best for
In-app referral programs, access gating, community-driven growth
Use case: access gating (invite codes)
A common pattern is using referral codes as invite codes to gate access to a product. Your frontend calls getReferralStatus to check whether a user was referred, and only lets them proceed if they were. Fuul doesn't enforce the gate β your application logic does.
Example: A perpetuals protocol in closed beta issues referral codes to early users. When someone visits the dapp, the frontend checks their referral status and grants access only if a valid code was used. The restriction lives in the project's own code, not in Fuul.
"Invite code" is not a separate code type β it's a referral code used for access gating. The underlying mechanism is identical.
Using an affiliate code as a referral code
An affiliate code is global and lives at the affiliate level. But a project can activate an affiliate code as a referral code within its own program β assigning it project-specific properties like maximum uses and rebate rates.
This means a single custom code (e.g., CRYPTO-GUY) can work as both:
An affiliate code globally β for tracking link attribution across any Fuul project
A referral code within a specific project β with uses, rebate rate, and other per-project configuration
Example: A KOL creates the affiliate code CRYPTO-GUY. A DeFi protocol activates that code as a referral code in their program with 100 max uses and a 5% rebate rate. Now the KOL's followers can either click a tracking link or enter CRYPTO-GUY directly in the dapp β both paths establish the referrer relationship.
Think of it as two layers: the affiliate code is the identity layer (global, custom, owned by the affiliate) and the referral code is the project layer (uses, rebate, scoped per project). When a project activates an affiliate code, it adds the project layer on top.
Side-by-side comparison
Purpose
Track link-based attribution
Establish referrer-user relationship via code entry
Created by
Affiliate (wallet signature required)
Project (via API/SDK, on behalf of users)
Scope
Global (1 per affiliate)
Project-specific
Format
User-defined (e.g., CRYPTO-GUY)
Auto-generated 7-char (e.g., A1B2C3D)
How users interact
Click a link β no code entry needed
Enter and accept a code explicitly
Rebate support
Only when activated as a referral code in a project
Yes β via Sharing Rewards with Referred Users
Can become the other?
Yes β projects can activate it as a referral code
No β referral codes are always project-generated
Both mechanisms create referrer-user relationships and can trigger the same payout rules. The difference is how the relationship is established: link click (affiliate code) vs explicit code acceptance (referral code).
Developer guides
Generate and manage affiliate codes β Affiliate Links & Codes
Generate, accept, and manage referral codes β Referral Codes
Track referral links via SDK β Tracking Referrals in Your App
Last updated