binhachonVANDOUGH_NFT_PURCHASES
Updated 2021-11-08
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
›
⌄
WITH amounts_table as (SELECT
block_timestamp,
tx_id,
MAX(amount) as amount,
MAX(amount_usd) as amount_usd
FROM ethereum.udm_events
WHERE tx_id IN
(SELECT tx_id FROM ethereum.nft_events
WHERE event_to = '0x0f0eae91990140c560d4156db4f00c854dc8f09e')
AND amount IS NOT NULL
AND amount_usd IS NOT NULL
AND amount_usd <= 1000000000
AND symbol = 'ETH'
--AND (to_address_name = 'marketplace' OR to_label_subtype = 'marketplace')
GROUP BY tx_id, block_timestamp)
SELECT
block_timestamp,
tx_id,
amount,
amount_usd,
SUM (amount) OVER (ORDER BY block_timestamp) as eth_spent_running_total,
SUM (amount_usd) OVER (ORDER BY block_timestamp) as usd_spent_running_total
FROM amounts_table
ORDER BY block_timestamp DESC
Run a query to Download Data