drone-mostafaCopy of Untitled Query
Updated 2022-09-27
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
SELECT
date_trunc('day',block_timestamp) as daily,
count(DISTINCT tx_hash) as Txn,
count(DISTINCT origin_from_address) as Users,
sum(amount_in_usd) as USD_in, avg(amount_in_usd) as avg_USD_in,
sum(amount_out_usd) as USD_out, avg(amount_out_usd) as avg_USD_out,
case
when daily >= '2022-08-01' and daily < '2022-09-15' then 'Before Merge'
when daily >= '2022-09-15' then 'After Merge' else null end as Merge,
sum(Txn) over (partition by Merge order by daily ) as cum_Txn,
sum(Users) over (partition by Merge order by daily ) as cum_Users,
sum(USD_in) over (partition by Merge order by daily ) as cum_USD_in,
sum(USD_out) over (partition by Merge order by daily ) as cum_USD_out
FROM ethereum.core.ez_dex_swaps
where block_timestamp >= '2022-09-04' and block_timestamp <= '2022-09-26'
AND amount_in_usd < 100000000000 AND amount_out_usd < 100000000000
GROUP BY daily , Merge
Run a query to Download Data