MasiDaily stake
Updated 2023-02-17
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 price as ( select trunc(RECORDED_HOUR,'day') as day ,
symbol ,
avg(price) as avg_price
from osmosis.core.ez_prices
where symbol in ('ATOM','OSMO','AXL')
and RECORDED_HOUR >= CURRENT_DATE - 90
group by 1,2)
,
axelar as ( select trunc(block_timestamp,'day') as day,
count(DISTINCT tx_id) as count_txs,
count(DISTINCT DELEGATOR_ADDRESS) as count_users,
sum(amount/pow(10,6)*avg_price) as volumes
from axelar.core.fact_staking a left outer join price b on a.block_timestamp::date = b.day
where block_timestamp >= CURRENT_DATE - 90
and symbol = 'AXL'
group by 1)
,
osmo as ( select trunc(block_timestamp,'day') as day,
count(DISTINCT tx_id) as count_txs,
count(DISTINCT DELEGATOR_ADDRESS) as count_users,
sum(amount/pow(10,decimal)*avg_price) as volumes
from osmosis.core.fact_staking a left outer join price b on a.block_timestamp::date = b.day
where block_timestamp >= CURRENT_DATE - 90
and currency = 'uosmo'
and action = 'delegate'
and symbol = 'OSMO'
group by 1)
,
atom as ( select DISTINCT b.tx_id,
trunc(a.block_timestamp,'day') as day,
tx_from ,
replace(ATTRIBUTE_VALUE,'uatom','' ) as amount
from cosmos.core.fact_msg_attributes a join cosmos.core.fact_transactions b on a.tx_id = b.tx_id
where MSG_TYPE ilike '%delegate%' and ATTRIBUTE_KEY = 'amount'
and day >= CURRENT_DATE - 90)
Run a query to Download Data