mattkstewThe Great Solana Royalty Debate 100
Updated 2022-11-06Copy Reference Fork
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
›
⌄
WITH sales as (
SELECT
token_name,
tx_id
FROM solana.core.fact_nft_sales
LEFT OUTER JOIN solana.core.dim_nft_metadata
ON solana.core.fact_nft_sales.mint = solana.core.dim_nft_metadata.mint
WHERE token_name IN ('Degen Apes', 'Okay Bears', 'DeGods', 'Aurory', 'ABC', 'Trippin’ Ape Tribe', 'Cets On Creck', 'Galactic Geckos', 'Shadowy Super Coder', 'Primates', 'Blocksmith Labs', 'SolPunks', 'Solana Monkey Business', 'Thugbirdz', 'Communi3: Mad Scientists', 'Famous Fox Federation', 'Catalina Whale Mixer', 'Bold Badgers', 'Just Ape.', 'Stoned Ape Crew', 'Vandal City', 'Reptilian Renegade Lizards', 'Meerkat Millionaires', 'TombStoned High Society', 'Astrals')
), roy as (
SELECT
token_name,
solana.core.fact_transfers.tx_id,
min(amount) as roy1
-- max(amount),
-- sum(amount)
FROM solana.core.fact_transfers
LEFT outer JOIN sales
ON solana.core.fact_transfers.tx_id = sales.tx_id
WHERE solana.core.fact_transfers.tx_id IN (SELECT DISTINCT tx_id from sales)
AND mint LIKE 'So11111111111111111111111111111111111111112'
GROUP BY 1,2
)
SELECT
token_name as tn1,
sum(roy1) as royalty_volume_sol
FROM roy
GROUP BY 1
Run a query to Download Data