Uniswap v3

Events Included

ethereum.dex.uniswap_v3_protocol_liquidity_pool_events contains swap, mint, burn, collect, and flash events emitted by Uniswap v3 protocol pools.

Projects Included

This table includes forks of Uniswap v3 under the project segment. Currently, this includes uniswap, sushiswap, pancakeswap and kyberswap.

Signed Token Amounts

token0_amount and token1_amount in this table is multiplied by -1* accordingly. This is to facilitate the calculation of pool TVL changes from events.

TVL Calculation

The 3 main events that contribute to pool balance changes are mint, swap & collect. This is because collect event is emitted during LP-burn and includes the LP burned amount. Users can also collect fees without burning LP (which decreases pool balance without burn event emitted). Sample Query - Pool TVL

-- TVL Calculation*
select 
    date(block_timestamp) as date,
    pool_name,
    sum(token0_amount) as amt0_delta,
    sum(amt0_delta) over (order by date) as token0_balance,
    sum(token1_amount) as amt1_delta,
    sum(amt1_delta) over (order by date) as token1_balance
from ethereum.dex.uniswap_v3_protocol_liquidity_pool_events
where liquidity_pool_address = '0x6c6bc977e13df9b0de53b251522280bb72383700' -- Univ3 
and event in ('mint', 'collect', 'swap') 
group by 1,2
order by 1 desc

Column Names

Last updated