Pine AnalyticsBaseNames 2
Updated 2024-12-31
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
›
⌄
with tab1 as (
SELECT
block_timestamp,
tx_hash,
nft_to_address
FROM base.nft.ez_nft_transfers
where NFT_address LIKE lower('0x03c4738Ee98aE44591e1A4A4F3CaB6641d95DD9a')
and NFT_from_address LIKE '0x0000000000000000000000000000000000000000'
GROUP BY 1,2,3
), tab2 as (
SELECT
tx_hash as txs,
sum(amount_usd) As price_usd,
sum(amount) as amt
FROM base.core.ez_native_transfers
WHERE tx_hash in (SELECT tx_hash from tab1)
GROUP BY 1
), tab3 as (
SELECT
date(hour) as day,
median(price) as price
FROM ethereum.price.ez_prices_hourly
WHERE token_address LIKE lower('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')
GROUP BY 1
)
SELECT
count(DISTINCT tx_hash) as names_minted,
count(DISTINCT nft_to_address) as Minters,
sum(CASE when amt * price is NULL then 0 else amt * price end) as mint_fees_usd
FROM tab1
left outer JOIN tab2
on tx_hash = txs
QueryRunArchived: QueryRun has been archived