mmdrezaSwapped to
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
date_trunc('day',recorded_at)as date,
avg(price) as daily_price
from osmosis.core.dim_prices
where symbol like 'STARS'
and recorded_at>= current_date-7
group by 1),
from_swappers as (select
count(distinct trader) as from_swappers,
count(tx_id) as transactions,
(sum(FROM_AMOUNT/pow(10,6))) as from_amount
from osmosis.core.fact_swaps
where from_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
and block_timestamp >= current_date-7
and TX_STATUS = 'SUCCEEDED'),
to_swappers as (select
count(distinct trader) as to_swappers,
count(tx_id) as transactions,
(sum(to_AMOUNT/pow(10,6))) as to_amount
from osmosis.core.fact_swaps
where to_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
and block_timestamp >= current_date-7
and TX_STATUS = 'SUCCEEDED'),
daily_traders as (
select
date_trunc('day',block_timestamp) as date,
count(distinct trader) as traders
from osmosis.core.fact_swaps
where block_timestamp >= current_date-7
and to_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
or from_currency = 'ibc/987C17B11ABC2B20019178ACE62929FE9840202CE79498E29FE8E5CB02B7C0A4'
and block_timestamp >= current_date-7
and TX_STATUS = 'SUCCEEDED'
Run a query to Download Data