Eman-Raz103-Swaps on 2023
Updated 2023-04-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
with tab1 as (Select date_trunc('day',block_timestamp) as date, sum(from_amount)/pow(10,6) as Selling_Volume, count(distinct tx_id) as Selling_Count
from terra.core.ez_swaps
where block_timestamp::date>='2023-01-01' and from_currency='uluna'
group by 1
order by 1),
tab2 as (Select date_trunc('day',block_timestamp) as date, sum(to_amount)/pow(10,6) as Buying_Volume, count(distinct tx_id) as Buying_Count
from terra.core.ez_swaps
where block_timestamp::date>='2023-01-01' and to_currency='uluna'
group by 1
order by 1)
select tab1.date as "Date", -Selling_Volume as "Selling Volume", Buying_Volume as "Buying Volume", -Selling_Count as "Selling Count",
Buying_Count as "Buying Count", selling_volume+buying_volume as "Swap Volume", buying_count+selling_count as "Swap Count"
from tab1 left join tab2 on tab1.date=tab2.date
order by 1
Run a query to Download Data