Eman-RazSushiswap
Updated 2023-04-13
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
›
⌄
with tab1 as (select date_trunc('month',block_timestamp) as month, sum(amount_in) as swap_from_vol, symbol_in as stablecoin,
count(distinct origin_from_address) as seller_count, count(tx_hash) as sale_count
from ethereum.core.ez_dex_swaps
where (token_in='0x6b175474e89094c44da98b954eedeac495271d0f' -- dai
or token_in='0xdac17f958d2ee523a2206206994597c13d831ec7' -- usdt
or token_in='0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' -- usdc
or token_in='0x853d955acef822db058eb8505911ed77f175b99e') -- frax
and month>'2022-01-01' and platform='sushiswap'
group by 1,3
order by 1),
tab2 as (select date_trunc('month',block_timestamp) as month, sum(amount_out) as swap_to_vol, symbol_out as stablecoin,
count(distinct origin_from_address) as purchaser_count, count(tx_hash) as purchase_count
from ethereum.core.ez_dex_swaps
where (token_out='0x6b175474e89094c44da98b954eedeac495271d0f' -- dai
or token_out='0xdac17f958d2ee523a2206206994597c13d831ec7' -- usdt
or token_out='0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' -- usdc
or token_out='0x853d955acef822db058eb8505911ed77f175b99e') -- frax
and month>'2022-01-01' and platform='sushiswap'
group by 1,3
order by 1)
select tab1.month, swap_from_vol+swap_to_vol as "Swap Volume", tab1.stablecoin, seller_count as Seller, purchaser_count as Purchaser,
sale_count as sale, purchase_count as purchase, sale_count+purchase_count as "Swap Count",
seller_count+purchaser_count as "Swapper Count", swap_from_vol as "Sale Volume", swap_to_vol as "Purchase Volume"
from tab1 left join tab2 on tab1.month=tab2.month and tab1.stablecoin=tab2.stablecoin
order by 1
Run a query to Download Data