RamaharUsers entered Osmosis [tokens]
Updated 2022-12-31Copy 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
›
⌄
With token_prices as (
select
DATE(recorded_at) as dayz,
symbol,
AVG(price) as avg_price
from osmosis.core.dim_prices
group by 1, 2
),
transfers_t as (select
block_timestamp::date as dt,
tx_id,
sender,
REGEXP_SUBSTR (sender,'[^1]+',1) as chains,
amount / POW(10, d.decimal) as volume,
currency,
l.project_name,
avg_price,
volume * avg_price as volume_usd
from osmosis.core.fact_transfers t
join osmosis.core.dim_labels l ON address = currency
join token_prices p ON symbol = project_name AND block_timestamp::date = dayz
join osmosis.core.dim_tokens d ON d.project_name = l.project_name
where tx_status = 'SUCCEEDED' AND transfer_type = 'IBC_TRANSFER_IN'
)
select
dt,
project_name,
count(distinct {{params}}) as param,
sum(param) over (partition by project_name order by dt asc rows between unbounded preceding and current row) as cumu_param
from transfers_t
group by 1, 2
Run a query to Download Data