SalehPRYZM_RAW_2024_3_part5
Updated 2024-03-27
999
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 atom_day as (
with lst_data as (
select
livequery.live.udf_api (
'https://flipsidecrypto.xyz/api/v1/queries/d7f235af-536c-4f53-bdc5-69d1e5f4c034/data/latest'
) as response
)
select
f.value:PRICE_DATE::date as date
,f.value:AVG_PRICE as avg_price
from lst_data , table(flatten(parse_json(response:data))) f
)
,lst_all_delegate as (
with lst_amount_delegate as (
select
tx_id
,split(ATTRIBUTE_VALUE,'uatom')[0]/1e6 as ATOM_amount
,msg_index
from cosmos.core.fact_msg_attributes
where ATTRIBUTE_KEY = 'amount'
and MSG_TYPE = 'delegate'
)
,lst_Delegator as (
select
tx_id
,ATTRIBUTE_VALUE as wallet
from cosmos.core.fact_msg_attributes
where MSG_TYPE = 'tx'
and ATTRIBUTE_KEY = 'fee_payer'
)
,cond1 as (
select
DISTINCT tx_id
from cosmos.core.fact_msg_attributes
QueryRunArchived: QueryRun has been archived