bachicelsius swaps
Updated 2022-06-22
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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
with
celsius_addresses as (
select * from crosschain.address_labels
where address_name = 'celsius wallet' and
project_name = 'celsius network'
),
swapins as (
select round(sum(amount_in),2) as tokens, symbol_in as symbol,
case when platform like '%uniswap%' then 'Uniswap'
when platform = 'sushiswap' then 'Sushiswap'
end as platfrm
from ethereum.core.ez_dex_swaps where (platform = 'sushiswap' or platform like 'uniswap%')
and origin_from_address in (
select address from celsius_addresses
) and symbol_in is not null
group by symbol_in, platfrm
),
swapouts as (
select round(sum(amount_in),2) as tokens, symbol_out as symbol,
case when platform like '%uniswap%' then 'Uniswap'
when platform = 'sushiswap' then 'Sushiswap'
end as platfrm
from ethereum.core.ez_dex_swaps where (platform = 'sushiswap' or platform like 'uniswap%')
and origin_from_address in (
select address from celsius_addresses
) and symbol_out is not null
group by symbol_out, platfrm
)
select 'Swap-In' as swap_catg, * from swapins
UNION
select 'Swap-Out' as swap_catg, * from swapouts
/*select origin_from_address as wallet, round(sum(amount_in),2) as tokens, symbol_in,
Run a query to Download Data