nitsBridge Volume Optimism vs Non native
Updated 2022-11-28
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with l1 as
(SELECT date(block_timestamp) as day, sum(amount_usd) as total_volume,sum(total_volume) over (order by day) as cumulatve_amt,
'l1' as type from
( SELECT * from ethereum.udm_events
where from_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1') and block_timestamp >= CURRENT_DATE -60 and event_name = 'transfer' )
GROUP by 1) ,
tx as
(SELECT DISTINCT tx_id from ethereum.udm_events
where contract_address = lower('0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc') ),
l2 as
(SELECT date(block_timestamp) as day, sum(amount_usd) as total_volume,sum(total_volume) over (order by day) as cumulatve_amt,
'l2' as type from
(SELECT * from ethereum.udm_events
where tx_id in (SELECT * from tx) AND (contract_address != '0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc' or contract_address is NULL )
and block_timestamp >= CURRENT_DATE -60 )
GROUP by 1)
SELECT * from l2
UNION ALL
SELECT * FROM l1
Run a query to Download Data