SocioAnalyticaNFT purchase and List
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 last_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)
-- qualify row_number () over (order by date DESC) = 1
-- )
,
sei_price as (
SELECT 'SEI' as network,
RECORDED_HOUR as date,
price as last_price
FROM osmosis.price.ez_prices
WHERE symbol = 'SEI'
qualify row_number () over (order by date DESC) = 1
)
,
fee_sei as (
select
count(DISTINCT a.tx_id) as n_nft_trade,
QueryRunArchived: QueryRun has been archived