Afonso_Diaz2023-06-11 10:59 PM
Updated 2023-06-16
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
t as (
select
a.timestamp::date as date,
'NEAR' as symbol,
avg(a.price_usd) as price_usd
from near.core.fact_prices a
where a.symbol = 'wNEAR'
group by 1, 2
union all
select
a.recorded_at::date as date,
symbol,
avg(a.price) as price_usd
from osmosis.core.dim_prices a
where a.symbol in('OSMO', 'ATOM')
group by 1, 2
),
t2 as (
select
tx_hash,
'Near' as chain,
block_timestamp,
tx_signer as user,
(stake_amount * price_usd)/1e24 as amount
from near.core.dim_staking_actions
join t on block_timestamp::date = t.date and symbol = 'NEAR'
where action = 'Stake'
union all
Run a query to Download Data