SalehTime-Stake
Updated 2025-02-19
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 lst_price as (
select
hour::date as price_date
,avg(price) as BRRR_Price
from near.price.ez_prices_hourly
where symbol = 'BRRR'
and hour::date>='2022-04-05'
group by 1
)
,lst_price_last as (
select top 1
hour::date as price_date
,avg(price) as BRRR_Price
from near.price.ez_prices_hourly
where symbol = 'BRRR'
and hour::date>='2022-04-05'
group by 1
order by hour::date desc
)
,lst_BRRR_price as (
with BRRR_api as (
select livequery.live.udf_api(
'GET',
'https://api.nearblocks.io/v1/fts/token.burrow.near'
,{'accept': 'application/json'}, {}) as response
)
,tokens_raw as (
select
value:price as BRRR_price
from
BRRR_api,
LATERAL FLATTEN (input => response:data:contracts))
select * from tokens_raw
)
,lst_stake as (
select
QueryRunArchived: QueryRun has been archived