Links
💰

Fees & Revenue

TLDR: Fees are what the demand-side (i.e. users) of a protocol pay (excluding gas fees).
The closest comparison to this metric in traditional companies is what most two-sided marketplaces get from their end users in fees. As an example, on top of Airbnb's revenue numbers they also report quarterly Gross Booking Value (GBV) numbers. Gross bookings is the total amount that renters pay for their stay in a given location.
Supply-side fees is what the supply-side (i.e. service providers) receive. Continuing our Airbnb example, this is what hosts get after Airbnb takes their cut for facilitating the marketplace. Airbnb's cut is what traditionally is counted as revenue.

Examples

The exact logic for fee calculations depends on which protocol we are tracking. We will go through a few different protocols and showcase how the fees and revenue are split.

Exchanges (Uniswap):

Uniswap is an AMM-based decentralized exchange. Liquidity providers deposit funds into pools and receive a return on investment (supply-side fees) from the fees charged for each token swap. The protocol currently does not take a cut of any of the swap fees paid by traders.
We index each pool's Swap event to track the volume and, subsequently, the fees and revenue. In the case of Uniswap V2 pairs, the swap fee is static (0.3%), whereas for Uniswap V3 pools swap fees are tiered (0.05%, 0.3% and 1%). The example below shows the relevant events and parameters for fee and revenue calculations for the USDC/ETH pools (Uniswap V3) and pair (Uniswap V2).
Contract
Address
Events
Parameters
UniswapV3Pool
0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8
Swap
volume, fee_tier
UniswapV2Pair
0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc
Swap
volume
Lending (Compound):
Compound is a non-custodial lending protocol built on Ethereum. Lenders deposit funds into Compound and receive interest payments from borrowers (supply-side fees). The protocol takes a cut of the total interest paid by borrowers and trading fees paid by traders (revenue).
We index each lending market's AccrueInterest event to track the total interest paid by borrowers. Each market configures its own reserve factor which is used to calculate the part of interest paid going to the protocol. We track this monitoring NewReserveFactor events. The example below shows the events and parameters relevant for fee and revenue calculations for the USDC market.
Contract
Address
Events
Parameters
CErc20
0x39aa39c021dfbae8fac545936693ac917d5e7563
AccrueInterest, NewReserveFactor
interestAccumulated, newReserveFactorMantissa