Skip to main content
Track every step of your DeFi user journey, from first visit to completed transaction, with Formo’s unified analytics. This guide shows you how to set up conversion tracking for common DeFi actions: token swaps, staking, and liquidity provision.

What you’ll learn

  • Set up end-to-end conversion tracking for DeFi protocols
  • Create funnels that combine offchain and onchain events
  • Measure conversion rates by traffic source
  • Identify where users drop off in the conversion flow

Prerequisites


Part 1: Understanding DeFi Conversion Funnels

The typical DeFi user journey

Most DeFi conversions follow this pattern:
StepEvent TypeDescription
1pageUser lands on your app
2connectUser connects their wallet
3signatureUser signs approval transaction
4Contract eventUser completes the target action (swap, stake, etc.)
Formo captures steps 1-3 automatically. Step 4 requires contract event tracking.

Why this matters

Traditional analytics tools only see steps 1-2. Onchain analytics tools only see the final step, but not everything that matters is onchain. They can’t tell you:
  • How many users who connected a wallet actually completed a transaction
  • Which traffic sources drive the most completed swaps (not just wallet connects)
  • When users drop off before connecting their wallet
  • Where users drop off between approval and execution
  • How many users leave before completing a transaction
Formo gives you the complete picture.

Part 2: How to Set Up Contract Event Tracking

Before creating funnels, configure Formo to track your smart contract events.

Step 1: Add your contract

1

Go to Project Settings > Contracts in the Formo Dashboard

2

Click Add Contract

3

Enter your contract details

  • Chain: Select your deployment chain (Ethereum, Base, Arbitrum, etc.)
  • Address: Your contract address
  • Name: A friendly name (e.g., “Swap Router”)

Step 2: Select events to track

After adding the contract, select the relevant events: For a DEX/Swap protocol:
  • Swap - When a swap is executed
  • Approval - When a token is approved (optional)
For a staking protocol:
  • Stake or Deposit - When tokens are staked
  • Unstake or Withdraw - When tokens are withdrawn
For a lending protocol:
  • Supply or Deposit - When collateral is supplied
  • Borrow - When assets are borrowed
  • Repay - When debt is repaid

Step 3: Verify events are flowing

1

Perform a test transaction on your app

2

Go to Activity in the Formo Dashboard

3

Confirm you see the contract event with decoded parameters


Part 3: How to Create a Swap Conversion Funnel

Now let’s build a funnel to track swap conversions.

Step 1: Navigate to Funnels

1

Go to Funnels in the left navigation

2

Click Create Funnel

3

Name it "Swap Conversion Funnel"

Step 2: Define funnel steps

Add these steps in order:
StepConfiguration
Step 1Event: page, Filter: path = /swap (or your swap page URL)
Step 2Event: connect
Step 3Event: Swap (your contract event)
For DEXes with token approval, add an intermediate step for the Approval event between connect and swap.

Step 3: Set the conversion window

Choose a conversion window based on your typical user behavior:
  • DEX swaps: 1-7 days (users often swap quickly)
  • Staking: 7-14 days (users may research first)
  • Complex DeFi: 14-30 days (longer consideration)

Step 4: Save and analyze

Click Save to create your funnel. You’ll see:
  • Overall conversion rate: % of swap page visitors who completed a swap
  • Step-by-step drop-off: Where users abandon the journey
  • Absolute numbers: User count at each step

Part 4: How to Analyze by Traffic Source

Understanding which channels drive actual conversions (not just visits) is critical for DeFi growth.

Add a breakdown by referrer

1

Open your Swap Conversion Funnel

2

Click Add Breakdown

3

Select Referrer (or UTM Source for campaign tracking)

Now you can compare conversion rates across sources:
ReferrerVisitorsWallet ConnectsSwapsConversion Rate
twitter.com1,00040012012%
discord.com50030015030%
defillama.com2001509045%
In this example, DefiLlama traffic converts 4x better than Twitter despite lower volume.

Key metrics to track

MetricWhat it tells you
Visit → Connect rateLanding page effectiveness
Connect → Swap rateTransaction UX quality
Overall conversionEnd-to-end funnel health
By referrerChannel quality
By deviceMobile vs desktop experience

Part 5: How to Identify Drop-off Points

Common DeFi drop-off patterns

High drop-off at wallet connect:
  • Wallet detection issues
  • Unclear call-to-action
  • Missing wallet support
High drop-off at approval:
  • Confusing approval UX
  • Users concerned about unlimited approvals
  • Gas fee surprises
High drop-off at transaction:
  • Slippage errors
  • Insufficient balance
  • Transaction failures

Using Conversion Insights

Formo’s Conversion Insights automatically identifies behaviors correlated with conversion:
1

Open your funnel

2

Click the Insights tab

3

Look for high-lift events

Example insight:
Users who viewed the “How it works” page are 2.3x more likely to complete a swap.
Use these insights to:
  • Promote high-lift behaviors in your UX
  • Add educational content where users drop off
  • A/B test changes to low-converting steps

Part 6: Example Funnels

Staking funnel

StepEventExpected conversion
1Visit /stake100% (baseline)
2Connect wallet40-60%
3Approval event70-85%
4Stake event80-95%

Liquidity provision funnel

StepEventExpected conversion
1Visit /pool100% (baseline)
2Connect wallet30-50%
3Approval (Token A)60-80%
4Approval (Token B)90-95%
5AddLiquidity event85-95%

Multi-step DeFi flow

For complex protocols with multiple transactions:
StepEvent
1Visit landing page
2Connect wallet
3Deposit collateral
4Borrow assets
5Use borrowed assets (custom event)

Part 7: How to Set Up Alerts

Get notified when high-value conversions happen.

Whale swap alert

1

Go to Settings > Alerts

2

Click Create Alert

3

Configure the alert

  • Event: Your Swap contract event
  • Condition: net_worth > 100000
  • Notification: Email or Slack webhook
Now you’ll know instantly when whales use your protocol.

Failed transaction alert

Track when swaps fail to identify UX issues:
1

Create a new alert

2

Configure the alert

  • Event: transaction
  • Condition: status = failed
  • Notification: Slack webhook

Summary

You’ve learned how to:
  1. Configure contract events for your DeFi protocol
  2. Create conversion funnels combining offchain and onchain events
  3. Analyze by traffic source to find your best channels
  4. Identify drop-off points and use Conversion Insights
  5. Set up alerts for high-value transactions

Next steps