SocioAnalyticaNFT purchase over time
Updated 2024-04-15
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 sei_network as (
with all_nft_sales as (
select
block_timestamp,
tx_id
from sei.core.fact_msg_attributes
where msg_type = 'wasm-buy_now'
and ATTRIBUTE_KEY = 'nft_token_id'
and ATTRIBUTE_VALUE is not null
and block_timestamp::date >= dateadd('day', -{{past_days}}, current_date)
)
-- ,
-- sei_price as (
-- SELECT 'SEI' as network,
-- TO_TIMESTAMP(value[0]::string) as date,
-- value[1] as price
-- FROM (
-- SELECT livequery.live.udf_api(
-- 'https://api.coingecko.com/api/v3/coins/sei-network/market_chart?vs_currency=usd&days=30') as response
-- ),LATERAL FLATTEN (input => response:data:prices)
-- )
,
sei_price as (
SELECT 'SEI' as network,
RECORDED_HOUR as date,
price as price
FROM osmosis.price.ez_prices
WHERE symbol = 'SEI'
)
,
avg_price as (
SELECT
date_trunc('day', date) as day,
avg(price) as usd_price
QueryRunArchived: QueryRun has been archived