amirrzTop 10 SCRT swappers by swap volume
Updated 2022-10-12Copy Reference Fork
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 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),
swap as (
select
'from SCRT' as type,
trader,
count (distinct tx_id) as swaps,
sum(from_amount/1e6) as Volume,
sum((from_amount/1e6)*Price) as USD_Volume
from osmosis.core.fact_swaps a join prices b on a.block_timestamp::date = b.day
where from_currency = 'ibc/0954E1C28EB7AF5B72D24F3BC2B47BBB2FDF91BDDFD57B74B99E133AED40972A'
and block_timestamp::date >= CURRENT_DATE - 7
and block_timestamp::date < current_date
and tx_status = 'SUCCEEDED'
group by 1,2
union ALL
select
'to SCRT' as type,
trader,
count (distinct tx_id) as swaps,
sum(from_amount/1e6) as Volume,
sum((from_amount/1e6)*Price) as USD_Volume
from osmosis.core.fact_swaps a join prices b on a.block_timestamp::date = b.day
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)
Run a query to Download Data