rain_syndicaSolana Weekly NFT Sales Broken Down by Type Without Degods copy
Updated 2023-09-29
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
›
⌄
-- forked from Solana Weekly NFT Sales Broken Down by Type Without Degods @ https://flipsidecrypto.xyz/edit/queries/e02e62f2-a94e-4e88-aadf-b9f955730183
-- forked from Solana Weekly NFT Sales Broken Down by Type @ https://flipsidecrypto.xyz/edit/queries/a2fc859d-c165-484a-be5f-0cb0778c80d9
WITH
nft_sales AS (
SELECT
tx_id,
date_trunc('day', block_timestamp) AS day,
seller,
purchaser AS buyer,
sales_amount AS sol_amount,
(sales_amount * close) AS usd_amount,
CASE
WHEN mint IN (SELECT address FROM solana.core.dim_labels WHERE label IN ('degod', 'y00ts')) THEN 'Degod Family'
ELSE 'Regular NFT'
END AS type
FROM solana.nft.fact_nft_sales a LEFT JOIN solana.price.fact_token_prices_hourly b
ON date_trunc('hour', a.block_timestamp) = b.recorded_hour
WHERE succeeded = TRUE
AND block_timestamp <= '2023-09-25'
AND block_timestamp >= '2022-06-01'
AND b.symbol = 'SOL'
AND mint NOT IN (SELECT address FROM solana.core.dim_labels WHERE label IN ('degod', 'y00ts'))
),
me_cnft_txs as (
select
block_timestamp
, tx_id
, signers[0] as user_address
, iff((post_balances[0] + fee) < pre_balances[0], 'buy', 'sell') as label_action
, abs(post_balances[0] - pre_balances[0] + iff(label_action = 'buy', +fee, -fee)) / pow(10,9) as amount
Run a query to Download Data