banbannardStablecoins 5
Updated 2022-06-08Copy Reference Fork
999
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
28
29
30
31
32
33
34
35
36
›
⌄
with mim_base1 as (select date_trunc('day', block_timestamp) as hour,
count(distinct(tx_hash)) as mim_vol_from
from ethereum.core.ez_dex_swaps
where token_in = '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3'
and date_trunc('day', block_timestamp) >= '2022-01-01' and platform in ('uniswap-v2', 'uniswap-v3')
group by 1),
mim_base2 as (select date_trunc('day', block_timestamp) as hour,
count(distinct(tx_hash)) as mim_vol_to
from ethereum.core.ez_dex_swaps
where token_out = '0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3'
and date_trunc('day', block_timestamp) >= '2022-01-01' and platform in ('uniswap-v2', 'uniswap-v3')
group by 1),
mim_base3 as (select a.hour,
mim_vol_from,
mim_vol_to,
mim_vol_from + mim_vol_to as mim_total_vol
from mim_base1 a
join mim_base2 b
on a.hour = b.hour),
frax_base1 as (select date_trunc('day', block_timestamp) as hour,
count(distinct(tx_hash)) as frax_vol_from
from ethereum.core.ez_dex_swaps
where token_in = '0x853d955acef822db058eb8505911ed77f175b99e'
and date_trunc('day', block_timestamp) >= '2022-01-01' and platform in ('uniswap-v2', 'uniswap-v3')
group by 1),
frax_base2 as (select date_trunc('day', block_timestamp) as hour,
count(distinct(tx_hash)) as frax_vol_to
from ethereum.core.ez_dex_swaps
where token_out = '0x853d955acef822db058eb8505911ed77f175b99e'
and date_trunc('day', block_timestamp) >= '2022-01-01' and platform in ('uniswap-v2', 'uniswap-v3')
group by 1),
Run a query to Download Data