Sbhn_NPstats 2
Updated 2022-12-05
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
›
⌄
--credit : alitaslimi
WITH
raw AS (
SELECT
block_timestamp,
tx_id,
marketplace,
buyer,
nft_id,
price * IFNULL(price_usd, 1) AS amount
FROM
flow.core.ez_nft_sales sales
LEFT JOIN (
SELECT
timestamp::date AS day,
token_contract,
AVG(price_usd) AS price_usd
FROM
flow.core.fact_prices
GROUP BY
day,
token_contract
) prices
ON
sales.block_timestamp::date = prices.day AND sales.currency = prices.token_contract
WHERE
tx_succeeded = TRUE
AND nft_collection = 'A.e4cf4bdc1751c65d.AllDay'
AND price > 0
),
before_thanksgiving AS (
SELECT
*
FROM
raw
WHERE
Run a query to Download Data