Salehsei_nft_main_dob
Updated 2024-04-15Copy Reference Fork
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 lst_sei_price as (
select
TO_TIMESTAMP(value[0]::string) as avg_date
,value[1] as avg_price
from (
select livequery.live.udf_api(
'https://api.coingecko.com/api/v3/coins/sei-network/market_chart?vs_currency=usd&days=0&interval=daily&precision=3') as resp
)
,lateral flatten (input => resp:data:prices)
)
,lst_buyer as (
select
tx_id
,ATTRIBUTE_VALUE as buyer
,msg_index
from sei.core.fact_msg_attributes
where MSG_TYPE = 'wasm'
and block_timestamp::date>='2024-01-09'
and ATTRIBUTE_KEY = 'recipient'
and tx_succeeded = true
)
,lst_amount_seller as (
select
tx_id
,split(ATTRIBUTE_VALUE,'usei')[0]/1e6 as amount_sell
,msg_index
from sei.core.fact_msg_attributes
where block_timestamp::date>='2024-01-09'
and MSG_TYPE = 'wasm-buy_now'
and ATTRIBUTE_KEY = 'sale_price'
and tx_succeeded = true
)
,lst_contract_address as (
select
QueryRunArchived: QueryRun has been archived