ChiefGen2 Royalties
Updated 2023-09-08
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
›
⌄
-- https://flipsidecrypto.xyz/h4wk/q/525MkxMnyR22/gen2-vs-gen3
-- forked from gen2 sale @ https://flipsidecrypto.xyz/edit/queries/66db2aff-b20e-4699-95d8-8a1a17d4b850
-- forked from base gen3 @ https://flipsidecrypto.xyz/edit/queries/3fce8604-48f0-4402-8861-3e53b7c8a578
with gen3_mint_tx as (
select
block_timestamp,
tx_id,
instruction:accounts[6] as mint,
instruction:accounts[5] as minter
from solana.core.fact_events
where succeeded = TRUE and block_timestamp > '2023-07-18'
and program_id = 'CSGrdwbJ5z58tLGKjjcmiNMj8bG1Zazthk3cXMrbSZoX'
and instruction:accounts[13] = '8Rt3Ayqth4DAiPnW9MDFi63TiQJHmohfTWLMQFHi4KZH'
)
, gen3_mints as (
select distinct mint from gen3_mint_tx
)
, base as (
SELECT
date_trunc('day', block_timestamp) as date,
case when mint in (select mint from gen3_mints) then 'Gen3'
else 'Gen2' end as type,
count(tx_id) as sale_count,
count(distinct purchaser) as unique_buyer,
sum(sales_amount) as volume,
min(sales_amount) as floor_price,
avg(sales_amount) as avg_price,
sum(sale_count) over (order by date) as cumu_count,
sum(unique_buyer) over (order by date) as cumu_buyer,
sum(volume) over (order by date) as cumu_volume,
avg(avg_price) OVER (ORDER BY date ROWS BETWEEN 7 PRECEDING AND CURRENT ROW) as AVG_PRICE_MA
from solana.core.fact_nft_sales
left join solana.core.dim_labels on mint = address
where succeeded = TRUE
Run a query to Download Data