daniel1234567Color Test Query copy
Updated 2023-01-12
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 big_spenders as (
select
buyer_address as buyer_address,
sum(price_usd) + sum(total_fees_usd) as total_spend
from ethereum.core.ez_nft_sales
where
date_trunc ('day', block_timestamp) > current_date - interval '12 weeks' and
total_fees_usd is not null
group by 1 order by 2 desc limit 10
),
actuals as(
SELECT
date_trunc ('week', block_timestamp) as date,
buyer_address,
sum(total_fees_usd) as total_fees,
sum(price_usd) as total_price,
sum(total_fees_usd) + sum(price_usd) as total_cost,
sum(total_fees_usd) / (sum(total_fees_usd) + sum(price_usd)) as fee_percent
FROM ethereum.core.ez_nft_sales
where
buyer_address in (
select
buyer_address
from
big_spenders
) and
date_trunc ('week', block_timestamp) > current_date - interval '52 weeks'
group by 1, 2
)
select
*,
-total_cost as neg_total_cost,
total_cost - 15000000 as mixed_total_cost
Run a query to Download Data