DeFi Referral Program Analytics: Tracking, Attribution, and Measurement

DeFi Referral Program Analytics: Tracking, Attribution, and Measurement

DeFi Referral Program Analytics: Tracking, Attribution, and Measurement

Yos Riady

Yos Riady

Published

· Updated on

Updated

Updated

Key Takeaways

  • A wallet connect is not the conversion event to track. The real signal is the first qualifying onchain action: a trade, a deposit, or a swap, once it clears a defined volume threshold.

  • Cookie-based attribution breaks in DeFi. Effective referral tracking captures the referral code at the URL level, then persists it through the wallet connect event. This creates a referrer-to-wallet mapping that survives cross-device journeys.

  • The four leading DeFi referral programs (GMX, dYdX, Hyperliquid, Jupiter) all tie referrer rewards to trading activity, not to signups or wallet connects. Fee discounts are the dominant referred-trader incentive across all four.

  • CPRA (cost per referred activation) is the correct unit economics metric: total program cost divided by activated referred wallets, not code redemptions. Teams that use redemptions as the denominator can understate true acquisition cost by 5x or more.

  • The referral-to-organic retention ratio compares 30-day retention of referred wallets against organic wallets. If referred wallets retain worse than organic wallets, the program is attracting incentive-driven traffic rather than genuine protocol users. This makes it the most signal-dense metric in a referral program.

  • Sybil resistance has to be built into the program structure from day one, not added later. Volume thresholds to create codes, per-wallet earnings caps, and wallet-locked attribution each reduce gaming without removing referrer incentive.

A DeFi referral program rewards existing users for bringing new wallets to a protocol, typically through fee discounts for the referred trader and a commission or fee-share for the referrer, with attribution resolved onchain rather than through browser cookies.

Referral code redemptions are easy to count. Connecting those redemptions to wallets with sustained trading activity and calculating whether incentive spend was justified requires a measurement layer that most DeFi growth teams have not built.

This guide focuses on measurement, attribution, and tracking implementation. If you are still choosing a reward structure or building Sybil resistance from scratch, start with How to Design and Measure DeFi Referral Programs first, then return here for the analytics layer.

This guide covers the measurement side of the full picture:

  • Why referral programs are becoming the dominant acquisition channel in DeFi, and what structural forces are driving that shift

  • How leading DeFi referral programs are structured, with GMX, dYdX, Hyperliquid, and Jupiter as case studies

  • How to track referral codes from the first web click to onchain conversion

  • Which KPIs distinguish a high-performing program from one burning budget on low-intent traffic

  • How to evaluate and select analytics tools for referral attribution

  • How to build a measurement stack that connects offchain acquisition to wallet-level outcomes

What Makes DeFi Referral Programs Different

Unlike traditional affiliate programs that track a browser cookie and assign last-click credit, DeFi referral programs must bridge pseudonymous wallet identities, offchain acquisition paths, and onchain execution in a single attribution model.

The cookie-to-wallet gap is the primary failure point. A trader who clicks a referral link on mobile and connects their wallet on desktop leaves no referral association in a standard web analytics setup. When referral tracking is embedded in the protocol, as it is on Hyperliquid and GMX, attribution is resolved at the smart contract level with no dependency on browser state. The onchain attribution system in Formo connects referral parameters captured at the URL level to wallet addresses and activities in a single data model for protocols that need frontend attribution.

For a full breakdown of reward structures, Sybil resistance layers, and how to launch a program from scratch, see How to Design and Measure DeFi Referral Programs.

Why DeFi Apps Are Doubling Down on Referrals

Three structural shifts are pushing DeFi growth teams toward referral programs as a primary acquisition channel.

Channel

The problem

Paid advertising

Google and Meta both restrict DeFi apps’ ads without a regulatory licence

KOL marketing

37.2% of influencer followers show signs of inauthenticity (SociaVault Labs, 2026)

Airdrops

Median day-90 wallet retention across airdrop-issuing protocols is 6% (FORKOFF Airdrop Marketing Playbook 2026)

Paid advertising access is restricted

Google's advertising policy explicitly prohibits ads for DeFi trading protocols, token liquidity pools, and unregulated apps. Meta's policy requires a recognised regulatory licence before any crypto trading platform can run paid campaigns. For protocols operating outside a licensed entity structure, paid acquisition on the two largest ad networks is not a viable channel.

KOL marketing carries significant fraud risk

37.2% of influencer followers show signs of inauthenticity (SociaVault Labs, 2026), climbing to 48.3% in the 100,000 to 500,000 follower tier most DeFi KOL campaigns target. Teams running KOL campaigns without onchain attribution have no reliable way to connect spend to wallet-level outcomes.

Airdrop-driven acquisition produces low-retention cohorts

Median day-90 wallet retention across airdrop-issuing protocols is 6%, dropping to 4% for snapshot-only airdrops (FORKOFF Airdrop Marketing Playbook 2026). Points-program airdrops retain better at 28%, but the dominant snapshot model produces cohorts that exit quickly once the incentive is distributed.

The referral quality signal

A referred wallet arrives through a trust relationship. The referrer has a direct economic incentive to bring in wallets that will trade, deposit, or generate fees, because their own rewards depend on it. This pre-screening effect is the core structural advantage referral channels hold over paid acquisition and airdrop campaigns.

Referral sits alongside paid acquisition and airdrops as one lever in the broader DeFi user acquisition channel mix, each with different cost and quality tradeoffs.

Top DeFi Referral Programs: How They Work

The four programs below represent the most widely studied referral structures in DeFi. Each is documented publicly and covers a distinct attribution model worth understanding before instrumenting your own measurement stack.

GMX

GMX runs a three-tier onchain referral program on Arbitrum and Avalanche. Referral codes are registered directly on the smart contract, so the referrer-to-wallet mapping is immutable and requires no frontend dependency. Full mechanics are documented in the GMX referral docs.

  • Tier 1 (open): 5% fee discount for referred traders, 5% fee rebate for referrers

  • Tier 2 (15+ active users, $5M+ weekly volume): 10% discount for traders, 10% rebate for referrers. Wallet providers and other protocols are also eligible for Tier 2 and Tier 3 rewards.

  • Tier 3 (30+ active users, $25M+ weekly volume): 10% discount for traders, 15% rebate for referrers

GMX has generated $11B in referral-driven trading volume, approximately 14% of total protocol volume, with $1.6M in rewards distributed over nine months (ShareMint DeFi case studies).

What it gets right: protocol-native attribution, transparent tier progression, and volume-gated graduation that filters low-intent referrers over time.

dYdX

dYdX operates an affiliate program with commission rates scaled by referred trading volume.

  • Base commission: 30% of referred trader taker fees

  • $1M+ referred volume in 30 days: 40% commission

  • $10M+ referred volume in 30 days: 50% commission

  • Eligibility: The referring affiliate must generate a minimum of $10,000 in their own trading volume to unlock their affiliate link

  • Referred users start at fee tier 3

  • Per-wallet earnings cap: $10,000 per referred wallet per 30-day period

What it gets right: volume-scaled rewards that align referrer incentives with protocol fee revenue, and a per-wallet cap that reduces farming without removing referrer incentive entirely.

Hyperliquid

Hyperliquid runs the most Sybil-resistant referral structure of the four. Referral codes are wallet-locked: only wallets that have traded a minimum volume can generate a referral code, and each wallet can only use one code.

  • Referred trader discount: 4% fee discount on the first $25M in cumulative trading volume

  • Referrer commission: 10% of referred trader taker fees, paid in USDC, on the first $1B in referred volume

  • Code creation requirement: $10,000 in personal trading volume before a wallet can generate a code

  • Attribution: Wallet-locked at first use, immutable

What it gets right: wallet-locked attribution, volume-gated code creation, and fee discounts that give referred traders a durable reason to stay on the platform.

Jupiter

Jupiter operates an open-source onchain referral program for its DEX aggregator. The program is built as a public SDK, meaning any protocol integrating Jupiter can implement referral fee routing without building custom attribution infrastructure.

  • Fee routing: Handled entirely onchain via the Jupiter Referral Program SDK

  • Referrer fee: Configurable by the integrating protocol via the default_share_bps parameter. Jupiter does not publish a fixed rate; fees are set by each integrator.

  • Attribution: Onchain, no browser dependency

What it gets right: composable onchain fee routing, open-source infrastructure, and a configurable fee model that supports both individual referrers and protocol-level integrations.

Program comparison

Protocol

Referred trader incentive

Referrer reward

Attribution model

Sybil resistance

GMX

5-10% fee discount

5-15% fee rebate

Onchain (smart contract)

Tier graduation

dYdX

Fee tier 3 discount

30-50% taker fee share

Offchain (affiliate system)

Per-wallet earnings cap

Hyperliquid

4% discount (first $25M volume)

10% taker fee share (first $1B referred)

Onchain (wallet-locked)

Volume-gated code creation

Jupiter

Configurable

Configurable (set by integrator)

Onchain (SDK)

Configurable

Which Referral Program Model Fits Your Protocol?

The right program structure depends on your Sybil risk tolerance, referrer mix, and whether protocol-native attribution is feasible. For a full structure-by-structure breakdown with decision criteria, see How to Design and Measure DeFi Referral Programs. The case studies above illustrate the four main attribution models in practice: onchain smart contract (GMX), wallet-locked onchain (Hyperliquid), offchain affiliate system (dYdX), and composable SDK (Jupiter).

How to Track Referral Codes: From Web Click to Onchain Conversion

Referral code tracking in DeFi requires bridging four distinct data layers: URL parameters, session state, wallet identity, and wallet activities. Each layer must pass data to the next without loss.

Step 1: Capture the referral parameter at the URL level

Formo's web SDK automatically captures the following referral parameters from the landing URL:

Parameter

Example

ref

?ref=ALICE

referral

?referral=ALICE

refcode

?refcode=ALICE

af

?af=ALICE

referrer

?referrer=ALICE

For influencer or KOL campaigns, the full tracking URL combines the referral code with UTM parameters:

https://app.protocol.xyz/?ref=ALICE&utm_source=twitter&utm_medium=kol&utm_campaign=q3_2025

This structure captures both the referrer identity (ref=ALICE) and the distribution channel (utm_source, utm_medium) in a single URL, enabling channel-level segmentation of referral performance.

Step 2: Persist the referral code across visits

The referral code must survive from the initial click to the wallet connect event, which may occur in a different session or on a different device. The SDK stores the referral parameter in local storage on first capture, so it is available when the wallet connect event fires regardless of session state.

Step 3: Associate the referral code with the wallet address

When a wallet connect event fires, the SDK associates the wallet address with the stored referral parameter. This creates the referrer-to-wallet mapping that forms the basis of all downstream attribution. The association is stored at the user level, so subsequent visits from the same wallet carry the referral context forward.

Step 4: Define and track the conversion event

The conversion event should be the first qualifying onchain action for the program, such as a first trade above a minimum volume, a first deposit, or a first swap. Tracking this event alongside the referral parameter produces the referral-code-to-onchain-conversion path needed to calculate CPRA and referral program ROI.

Step 5: Segment and report

With referral code, UTM parameters, wallet address, and onchain conversion events in a single data model, referral performance can be segmented by:

  • Referral code or referrer wallet

  • Distribution channel (utm_source, utm_medium)

  • Conversion rate from click to wallet connect to qualifying onchain action

  • Retention at day 7, day 30, and day 90

  • Volume and fees generated per referred wallet

DeFi Referral Program Analytics: The KPIs That Matter

Referral dashboards that surface clicks and code redemptions describe top-of-funnel activity. The metrics below determine whether the program is generating wallets worth the incentive spend.

The referral program KPI framework

Metric

What it measures

Why it matters

Referral activation rate

% of referred wallets that complete the defined activation event

Separates genuine interest from curiosity

Cost per referred activation (CPRA)

Total program cost / activated referred wallets

The true unit economics of referral acquisition

Referred wallet 30-day retention

% of activated referred wallets still active after 30 days

Reveals whether the program attracts retained users or one-time visitors

Referred wallet LTV

Average volume, TVL, or revenue generated per referred wallet over 90 days

The denominator for ROI calculation

Referrer quality score

Activation rate of wallets referred by a specific code

Identifies high-performing referrers vs. those driving low-intent traffic

Referral-to-organic retention ratio

30-day retention of referred wallets vs. organic wallets

Benchmarks referred user quality against your baseline

The metric most teams skip: referral-to-organic retention ratio

This ratio compares the 30-day retention rate of referred wallets against wallets that arrived organically. It is the most signal-dense metric in a referral program's analytics.

If referred wallets retain at a lower rate than organic wallets, the program is attracting traders motivated primarily by the incentive rather than the protocol's core product. If referred wallets retain at a comparable or higher rate, the program is extending the reach of genuine word-of-mouth acquisition.

Wallets referred by an existing user of the protocol arrive with a pre-existing trust signal. They are structurally more likely to engage with the protocol for its core utility rather than to extract a one-time incentive. The referral channel is as determinative as the incentive structure.

Calculating referral program ROI

The ROI calculation for a DeFi referral program treats the program as a discrete acquisition channel, using the same logic as any CAC and LTV analysis:

Referral program ROI = (Referred wallet LTV - CPRA) / CPRA × 100

To calculate CPRA accurately, include all program costs: fee rebates paid to referred traders, commission paid to referrers, and engineering or operational overhead.

The calculation error to avoid: using code redemptions as the CPRA denominator rather than activations. A program that generates 1,000 code redemptions but only 200 activations has a true CPRA five times higher than the redemption-based figure.

Segmenting referral performance by channel

Referral codes do not perform equally, and the difference is often explained by the referrer's distribution channel rather than the incentive structure. Segmenting referral performance by the utm_source and utm_medium parameters captured alongside the ref code reveals which channels are generating high-quality referred wallets.

Running a cohort analysis segmented by referral code reveals which referrers are driving sustainable growth. If X KOL referrals generate wallets with a 15% 30-day retention rate while Discord community referrals generate wallets with a 45% retention rate, budget allocation should reflect that difference.

Common Failure Modes in Crypto Referral Programs

Measuring redemptions instead of activations

The primary structural error in DeFi referral programs is using code redemptions as the primary performance metric. A redemption confirms that a wallet visited the protocol with a referral code. It does not confirm that the wallet executed a trade, generated fees, or returned after the first visit.

Programs optimised for redemption volume attract referrers who prioritise distribution breadth over user quality. The result is high redemption counts, low activation rates, and incentive spend that does not translate to protocol revenue.

Rewarding referrers before the referred wallet activates

Paying referrer commissions at wallet connect rather than at first qualifying onchain action creates an incentive for referrers to drive low-intent traffic. A referrer who earns on wallet connects has no economic reason to target traders likely to generate sustained volume.

Shifting the reward trigger to activation aligns referrer incentives with protocol revenue. The four protocols covered here all use trading activity as the reward trigger.

Session-scoped attribution losing cross-device referrals

Session-based attribution requires the referral link click and wallet connect to occur in the same browser session. A trader who clicks a referral link on mobile and connects their wallet on desktop the following day will not be attributed to the referrer.

For protocols with high cross-device usage, this produces systematic under-attribution. The solution is to persist the referral code in local storage or a server-side session store, so it survives across devices and visits until the wallet connect event fires.

No referrer-level performance data

Aggregate program metrics mask the distribution of performance across referrers. A program where 5% of referrers generate 80% of activated wallets should concentrate rewards and outreach on those referrers. Without referrer-level data, that concentration is invisible.

Track activation rate, volume per referred wallet, and day-30 retention at the individual referrer level, not just at the program level.

DeFi Analytics Tools That Track Referral Codes

DeFi teams use four main approaches to track referral attribution. Each has a distinct capability profile and a primary limitation for referral-specific measurement.

Approach

Captures frontend/click data?

Wallet-level attribution?

Setup effort

Best for

General blockchain data platforms (e.g. Dune)

No

Partial (onchain only)

Low to medium

Onchain event queries, no frontend context

In-house data warehouse

Yes (with custom instrumentation)

Yes (with engineering effort)

High

Teams with dedicated data infrastructure

Spreadsheet tracking

No

No

Low

Early-stage programs with manual reporting

Web3-native analytics platforms

Yes

Yes

Low

Teams needing unified frontend and onchain attribution

General blockchain data platforms

Platforms such as Dune Analytics provide SQL access to onchain data across major EVM chains. They can query referral code usage recorded at the smart contract level, as GMX and Hyperliquid do, but have no visibility into frontend session data or the offchain acquisition path.

Main limitation: No frontend click data. Cannot attribute a referred wallet to the X post or Discord message that drove the initial click.

In-house data warehouses

Teams with dedicated data infrastructure can build full-stack referral attribution by combining frontend event tracking with onchain data ingestion into a centralised warehouse. This offers full flexibility but requires significant build vs. buy tradeoffs in engineering investment to build and maintain.

Main limitation: High setup and maintenance cost. Most early to mid-stage protocols find the engineering overhead significant at their current scale.

Spreadsheet tracking

The baseline for early-stage programs. Referral codes are tracked manually, redemption counts are pulled from the protocol frontend or smart contract, and activation rates are estimated. No channel-level segmentation, no retention data, no referrer-level performance breakdown.

Main limitation: No automation, no wallet-level data, and no path from referral click to onchain conversion. Breaks down quickly as program volume grows.

Web3-native analytics platforms

Platforms built for DeFi apps combine frontend session tracking with wallet-level attribution in a single data model. The referral parameter is captured at the URL level, persisted through the wallet connect event, and associated with the wallet address and subsequent activities without requiring custom data infrastructure.

Main limitation: Dependent on SDK instrumentation of the protocol frontend. Programs with fully onchain referral logic (e.g. GMX, Hyperliquid) may not need frontend attribution, but programs using session-based or offchain attribution benefit most from this approach.

Formo's attribution platform covers the full referral tracking stack: URL parameter capture, session persistence, wallet-level association, and onchain conversion tracking in a single data model, without requiring a custom data warehouse.

Building a Referral Analytics Stack for DeFi

A referral analytics stack for DeFi has three layers. Each layer is a prerequisite for the next.

Layer 1: Data capture

The data capture layer collects referral parameters at the URL level and associates them with wallet addresses at connect. The minimum required data points are:

  • Referral code (ref, referral, refcode, af, or referrer parameter from the landing URL)

  • UTM parameters (utm_source, utm_medium, utm_campaign) for channel-level segmentation

  • Wallet address associated with the referral code at wallet connect

  • Session ID linking the referral click to the wallet connect event across visits

Layer 2: Wallet activity tracking

The onchain event layer captures the qualifying conversion events for each referred wallet. The minimum required events are:

  • First qualifying onchain action (first trade, first deposit, first swap above threshold)

  • Subsequent trading volume or deposit activity for LTV calculation

  • Protocol fee events for fee-share reward calculation

Layer 3: Reporting and segmentation

With data capture and onchain event tracking in place, the reporting layer produces the KPIs that drive program decisions. Two SQL queries are particularly useful for referral program reporting:

Event-level referral query (referral code performance by event count):

SELECT

  referrer,

  count() AS events

FROM events

WHERE referrer != ''

GROUP BY referrer

ORDER BY events DESC

User-level referral query (referred wallets by acquisition source):

SELECT

  argMaxMerge(last_utm_source) AS utm_source,

  argMaxMerge(last_utm_medium) AS utm_medium,

  argMaxMerge(last_referrer) AS referrer,

  count() AS users

FROM users

GROUP BY utm_source, utm_medium, referrer

ORDER BY users DESC

These queries return referral performance segmented by source, medium, and referral code, enabling direct comparison of channel quality and referrer performance within the same reporting view.

Final Takeaway

A DeFi referral program is only as strong as its measurement layer. The protocols that run the most capital-efficient programs, GMX, dYdX, Hyperliquid, and Jupiter, all share one structural characteristic: reward triggers are tied to qualifying onchain actions, and attribution is resolved at the wallet level.

For growth teams building or optimising a referral program, the measurement priority is the same regardless of protocol type. Connect the referral code to the wallet address at connect. Map that wallet to its first qualifying onchain action. Track retention and volume at the referrer level, not just the program level. CPRA and the referral-to-organic retention ratio will tell you whether the program is acquiring durable protocol users or subsidising low-intent traffic.

Book a demo to see how Formo connects referral codes, wallet-level attribution, and onchain conversion data in a single analytics view.

Frequently Asked Questions

What is a DeFi referral program?

A DeFi referral program rewards existing users for bringing new wallets to a protocol, typically through fee discounts for the referred trader and a commission or fee-share for the referrer. Unlike traditional affiliate programs, attribution in DeFi is resolved at the wallet level rather than through browser cookies, and the economic value a referred wallet generates is recorded at the protocol level.

How is DeFi referral tracking different from a traditional affiliate link?

Traditional affiliate links set a browser cookie and assign last-click credit. DeFi referral tracking must bridge the gap between an offchain click and an onchain wallet event. The primary failure point is the cookie-to-wallet gap: a trader who clicks a referral link on one device and connects their wallet on another leaves no referral association in a standard web analytics setup. Effective DeFi referral tracking persists the referral code through the wallet connect event and stores the referrer-to-wallet mapping in an analytics platform.

What is CPRA and why does it matter?

CPRA (cost per referred activation) divides total program cost by the number of referred wallets that completed a defined activation event, such as a first trade or first deposit. Teams using code redemptions as the denominator can understate true acquisition cost by 5x or more. A program with 1,000 redemptions and 200 activations has a 20% activation rate; calculating cost per redemption rather than cost per activation inflates apparent efficiency by a factor of five.

Should referral rewards trigger on wallet connect or on activation?

Referral rewards should trigger on the qualifying onchain action. Programs that pay referrers on wallet connects incentivise distribution breadth over user quality. All four protocols covered in this article (GMX, dYdX, Hyperliquid, Jupiter) tie referrer rewards to trading activity.

Are fee discounts or token rewards better for referred users?

For trading-focused protocols, fee discounts tend to produce a cleaner incentive signal because the value is immediate and compounds with volume. For a full comparison of reward types including tokens, stablecoins, and fee rebates, see How to Design and Measure DeFi Referral Programs.

Why are DeFi protocols investing more in referral programs?

Referral programs are growing as a share of DeFi growth budgets because the primary alternatives face structural limitations. Google and Meta restrict DeFi app advertising without a regulatory licence. KOL marketing carries significant fraud risk, with 37.2% of influencer followers showing signs of inauthenticity (SociaVault Labs, 2026). Airdrop-driven acquisition produces low-retention cohorts, with median day-90 retention at 6% across airdrop-issuing protocols (FORKOFF, 2026). Referrals arrive through a trust relationship and are structurally more likely to produce engaged protocol users.

Which referral program model should I use?

The right model depends on Sybil risk tolerance, referrer mix, and whether protocol-native attribution is feasible. For the full structure-by-structure framework, see How to Design and Measure DeFi Referral Programs.

What tools do DeFi teams use to track referral attribution?

DeFi teams use four main approaches: general blockchain data platforms, in-house data warehouses, spreadsheet tracking, and web3-native analytics platforms. General blockchain data platforms like Dune provide onchain query access but have no visibility into frontend session data or the offchain acquisition path. In-house warehouses offer full flexibility at high engineering cost. Web3-native platforms combine frontend session tracking with wallet-level attribution in a single data model, capturing the referral parameter at the URL level and associating it with the wallet address at connect.

What is the biggest mistake DeFi teams make with referral analytics?

The most common error is optimising for code redemptions rather than activations. A redemption confirms a wallet visited the protocol with a referral code. It does not confirm the wallet executed a trade, generated fees, or returned after the first visit. Programs optimised for redemption volume attract referrers who prioritise distribution breadth over user quality, producing high redemption counts, low activation rates, and incentive spend that does not translate to protocol revenue.

About the Author

About the Author
About the Author
Yos Riady

Founder

Founder

Yos is the founder of Formo, where he helps DeFi teams make analytics and attribution simple. Prior to Formo, Yos was a staff software engineer and tech lead at Chainlink Labs. He helped scale Chainlink into the industry-standard oracle for leading DeFi protocols such as Aave, Morpho, and Spark. A builder in crypto since 2018, with experience across smart contracts, data engineering, and security.

Yos is the founder of Formo, where he helps DeFi teams make analytics and attribution simple. Prior to Formo, Yos was a staff software engineer and tech lead at Chainlink Labs. He helped scale Chainlink into the industry-standard oracle for leading DeFi protocols such as Aave, Morpho, and Spark. A builder in crypto since 2018, with experience across smart contracts, data engineering, and security.

Table of contents

Share this post

Share on X
Share on X

Measure what matters onchain

Formo makes analytics and attribution simple for DeFi apps.

Measure what matters onchain

Formo makes analytics and attribution simple for DeFi apps.

Measure what matters onchain

Formo makes analytics and attribution simple for DeFi apps.