xeejsgr478Average number of Swaps executed by each Active Swappers
Updated 2022-11-10
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
›
⌄
with prices as (select date_trunc('day', timestamp) as date,
symbol,
avg(price_usd) as asset_price
from near.core.fact_prices
where timestamp >= current_date - 90
group by 1,2)
select date_trunc('day', block_timestamp) as day,
'v2.ref-finance.near' as platform,
count(distinct(tx_hash)) as swap_count,
sum(swap_count) over (order by day) as cumu_swap_count,
avg(swap_count) over (order by day rows between 6 preceding and current row) as ma_swap_count,
count(distinct(trader)) as swapper_count,
avg(swapper_count) over (order by day rows between 6 preceding and current row) as ma_swapper_count,
swap_count/swapper_count as avg_tx
from near.core.ez_dex_swaps
where platform = 'v2.ref-finance.near'
and block_timestamp >= current_date - 90
group by 1
union
select date_trunc('day', block_timestamp) as day,
'Orca Finance' as swap_program,
count(distinct(tx_id)) as swap_count,
sum(swap_count) over (order by day) as cumu_swap_count,
avg(swap_count) over (order by day rows between 6 preceding and current row) as ma_swap_count,
count(distinct(swapper)) as swapper_count,
avg(swapper_count) over (order by day rows between 6 preceding and current row) as ma_swapper_count,
swap_count/swapper_count as avg_tx
from solana.core.fact_swaps
where swap_program = 'orca'
and block_timestamp >= current_date - 90
group by 1
order by 1 desc
Run a query to Download Data