mamad-5XN3k3Untitled Query
Updated 2022-10-11
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
›
⌄
with prices as (
select recorded_at::date as day,
avg (price) as price
from osmosis.core.dim_prices
where symbol = 'SCRT'
and recorded_at >= CURRENT_DATE - 7
group by 1)
select
from_currency,
project_name,
count (distinct tx_id) as Swaps,
count (distinct trader) as Swappers,
sum(to_amount/1e6) as Volume,
sum((to_amount/1e6)*Price) as USD_Volume
from osmosis.core.fact_swaps a join prices b on a.block_timestamp::date = b.day
full outer join osmosis.core.dim_labels c on a.from_currency = c.address
where to_currency = 'ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
and block_timestamp::date >= CURRENT_DATE - 7
and block_timestamp::date < current_date
and tx_status = 'SUCCEEDED'
group by 1,2
order by 3 DESC
limit 5
Run a query to Download Data