NatDaily swaps on UniSwap and Velodrome
Updated 2023-04-13Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
›
⌄
with
velodrome as (select
date_trunc('day', block_timestamp) as date,
'Velodrome' as dex,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as unique_swappers
from optimism.core.fact_event_logs a
where a.origin_to_address = lower('0xa132DAB612dB5cB9fC9Ac426A0Cc215A3423F9c9') -- Velodrome contract on Optimism
and event_name = 'Swap'
and tx_status = 'SUCCESS'
group by date),
uniswap as (select
date_trunc('day', block_timestamp) as date,
'Uniswap' as dex,
count(distinct tx_hash) as swap_count,
count(distinct origin_from_address) as unique_swappers
from optimism.core.fact_event_logs b
where b.origin_to_address IN ('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45',
'0xe592427a0aece92de3edee1f18e0157c05861564') -- I found two addresses for Uniswap: both yield a lot of transactions.
and event_name = 'Swap'
and tx_status = 'SUCCESS'
group by date)
select * from velodrome
UNION
select * from uniswap
Run a query to Download Data