latsanCopy of Copy of Copy of Untitled Query
Updated 2022-12-01Copy Reference Fork
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 temp1 as (
SELECT
BLOCK_TIMESTAMP,
TX_ID,
CONTRACT_ADDRESS,
MINT_PRICE,
CASE
WHEN mint_price > 0 THEN mint_price
ELSE 0
end as mint,
MINTER,
TOKEN_ID,
CURRENCY
FROM terra.core.fact_nft_mints
),
temp2 as (
SELECT
CONTRACT_ADDRESS,
sales_amount,
TOKEN_ID
FROM terra.core.fact_nft_sales
), temp3 as (
SELECT BLOCK_TIMESTAMP,
TX_ID,
CONTRACT_ADDRESS,
MINT_PRICE,
sales_amount,
sales_amount - mint ,
MINTER,
TOKEN_ID,
CURRENCY
FROM temp1
join temp2 USING (CONTRACT_ADDRESS,token_id)
)
SELECT BLOCK_TIMESTAMP::date as da, COUNT (tx_id)
Run a query to Download Data