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
- Formo SDK installed (Installation Guide)
- Contract events configured (Contract Events Guide)
Part 1: Understanding DeFi Conversion Funnels
The typical DeFi user journey
Most DeFi conversions follow this pattern:| Step | Event Type | Description |
|---|---|---|
| 1 | page | User lands on your app |
| 2 | connect | User connects their wallet |
| 3 | signature | User signs approval transaction |
| 4 | Contract event | User completes the target action (swap, stake, etc.) |
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
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 executedApproval- When a token is approved (optional)
StakeorDeposit- When tokens are stakedUnstakeorWithdraw- When tokens are withdrawn
SupplyorDeposit- When collateral is suppliedBorrow- When assets are borrowedRepay- 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:| Step | Configuration |
|---|---|
| Step 1 | Event: page, Filter: path = /swap (or your swap page URL) |
| Step 2 | Event: connect |
| Step 3 | Event: Swap (your contract event) |
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)
| Referrer | Visitors | Wallet Connects | Swaps | Conversion Rate |
|---|---|---|---|---|
| twitter.com | 1,000 | 400 | 120 | 12% |
| discord.com | 500 | 300 | 150 | 30% |
| defillama.com | 200 | 150 | 90 | 45% |
Key metrics to track
| Metric | What it tells you |
|---|---|
| Visit → Connect rate | Landing page effectiveness |
| Connect → Swap rate | Transaction UX quality |
| Overall conversion | End-to-end funnel health |
| By referrer | Channel quality |
| By device | Mobile 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
- Confusing approval UX
- Users concerned about unlimited approvals
- Gas fee surprises
- 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
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
| Step | Event | Expected conversion |
|---|---|---|
| 1 | Visit /stake | 100% (baseline) |
| 2 | Connect wallet | 40-60% |
| 3 | Approval event | 70-85% |
| 4 | Stake event | 80-95% |
Liquidity provision funnel
| Step | Event | Expected conversion |
|---|---|---|
| 1 | Visit /pool | 100% (baseline) |
| 2 | Connect wallet | 30-50% |
| 3 | Approval (Token A) | 60-80% |
| 4 | Approval (Token B) | 90-95% |
| 5 | AddLiquidity event | 85-95% |
Multi-step DeFi flow
For complex protocols with multiple transactions:| Step | Event |
|---|---|
| 1 | Visit landing page |
| 2 | Connect wallet |
| 3 | Deposit collateral |
| 4 | Borrow assets |
| 5 | Use 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
Swapcontract event - Condition:
net_worth > 100000 - Notification: Email or Slack webhook
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:- Configure contract events for your DeFi protocol
- Create conversion funnels combining offchain and onchain events
- Analyze by traffic source to find your best channels
- Identify drop-off points and use Conversion Insights
- Set up alerts for high-value transactions