adriaparcerisasosmo vs avax swapping activity
Updated 2023-02-06
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
swaps_from as (
SELECT
trunc(block_timestamp,'day') as date,
COUNT(DISTINCT tx_id) as swaps_from,
sum(swaps_from) over (order by date) as cum_swaps_from,
sum(from_amount/power(10, 18)) as volume_from,
sum(volume_from) over (order by date) as cum_volume_from,
avg(from_amount/power(10, 18)) as avg_swap_amount_from,
count(distinct trader) as swappers_from
FROM osmosis.core.fact_swaps x
join osmosis.core.dim_labels y on x.from_currency=y.address
WHERE project_name='wAVAX' and block_timestamp>='2023-01-22'
GROUP BY 1
),
swaps_to as (
SELECT
trunc(block_timestamp,'day') as date,
COUNT(DISTINCT tx_id) as swaps_to,
sum(swaps_to) over (order by date) as cum_swaps_to,
sum(to_amount/power(10, 18)) as volume_to,
sum(volume_to) over (order by date) as cum_volume_to,
avg(to_amount/power(10, 18)) as avg_swap_amount_to,
count(distinct trader) as swappers_to
FROM osmosis.core.fact_swaps x
join osmosis.core.dim_labels y on x.to_currency=y.address
WHERE project_name='wAVAX' and block_timestamp>='2023-01-22'
GROUP BY 1
),
osmo as (
SELECT
x.date,
swaps_to,swaps_from,
swaps_to-swaps_from as net_swaps,
volume_to,volume_from,
volume_to-volume_from as net_volume_swapped,
Run a query to Download Data