Afonso_Diazsushiswap-4-455
Updated 2023-03-18
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 t as (
select
block_timestamp::date as day,
'Gnosis' as chain,
count(distinct tx_hash) as swaps,
count(distinct origin_from_address) as swappers,
sum(iff(symbol_in in ('FRAX', 'LUSD', 'BUSD', 'TUSD', 'USDN', 'GUSD', 'USDC', 'DAI', 'USDP', 'FEI', 'sUSD', 'AMUSDC', 'USDD', 'USDT', 'MIM'), amount_in, amount_out)) as swap_volume_usd,
sum(swaps) over (order by day) as cumulative_swaps,
sum(swap_volume_usd) over (order by day) as cumulative_swap_volume_usd
from gnosis.sushi.ez_swaps
where (
symbol_in in ('FRAX', 'LUSD', 'BUSD', 'TUSD', 'USDN', 'GUSD', 'USDC', 'DAI', 'USDP', 'FEI', 'sUSD', 'AMUSDC', 'USDD', 'USDT', 'MIM') or
symbol_out in ('FRAX', 'LUSD', 'BUSD', 'TUSD', 'USDN', 'GUSD', 'USDC', 'DAI', 'USDP', 'FEI', 'sUSD', 'AMUSDC', 'USDD', 'USDT', 'MIM')
)
and block_timestamp > current_date - interval '3 months'
group by 1
union
select
block_timestamp::date as day,
'BSC' as chain,
count(distinct tx_hash) as swaps,
count(distinct origin_from_address) as swappers,
sum(iff(symbol_in in ('FRAX', 'LUSD', 'BUSD', 'TUSD', 'USDN', 'GUSD', 'USDC', 'DAI', 'USDP', 'FEI', 'sUSD', 'AMUSDC', 'USDD', 'USDT', 'MIM'), amount_in, amount_out)) as swap_volume_usd,
sum(swaps) over (order by day) as cumulative_swaps,
sum(swap_volume_usd) over (order by day) as cumulative_swap_volume_usd
from bsc.sushi.ez_swaps
where (
symbol_in in ('FRAX', 'LUSD', 'BUSD', 'TUSD', 'USDN', 'GUSD', 'USDC', 'DAI', 'USDP', 'FEI', 'sUSD', 'AMUSDC', 'USDD', 'USDT', 'MIM') or
symbol_out in ('FRAX', 'LUSD', 'BUSD', 'TUSD', 'USDN', 'GUSD', 'USDC', 'DAI', 'USDP', 'FEI', 'sUSD', 'AMUSDC', 'USDD', 'USDT', 'MIM')
)
and block_timestamp > current_date - interval '3 months'
group by 1
union
Run a query to Download Data