SpecterTOP NFT via tx
Updated 2024-12-10
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 mittbuy AS (
SELECT
nft.tx_hash,
'buy' AS category,
nft.to_address AS user,
nft.contract_address AS NFT,
token.amount_usd AS volume,
DATE_TRUNC('day', token.block_timestamp) AS transaction_date
FROM
near.nft.fact_nft_transfers AS nft
JOIN
near.core.ez_token_transfers AS token
ON
nft.tx_hash = token.tx_hash
WHERE
nft.from_address = 'a.mitte-orderbook.near' -- NFT is sent from the platform
AND token.from_address = user -- Payment made by the buyer
AND token.to_address = 'a.mitte-orderbook.near' -- Platform receives the payment
UNION ALL
SELECT
nft.tx_hash,
'sell' AS category,
nft.from_address AS user,
nft.contract_address AS NFT,
token.amount_usd AS volume,
DATE_TRUNC('day', token.block_timestamp) AS transaction_date
FROM
near.nft.fact_nft_transfers AS nft
JOIN
near.core.ez_token_transfers AS token
ON
nft.tx_hash = token.tx_hash
WHERE
QueryRunArchived: QueryRun has been archived