denze-e7j2NUArtist Snapshot by Token ID
Updated 2023-11-08
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
›
⌄
WITH
-- get the artist wallet as an input
input_artist AS (
SELECT
*
FROM VALUES
(lower('{{artist_wallet}}'))
AS data(artist_wallet)
WHERE data.artist_wallet regexp '^0x[0-9a-fA-F]{40}$' -- check address is a valid format, i.e. starts with 0x and has 42 characters total
)
, input_time AS (
SELECT
CASE
WHEN to_timestamp_ntz(data.snapshot_time) > date_trunc('minute', current_timestamp) THEN current_date + interval '1 day' - interval '1 second'
ELSE date_trunc('minute', to_timestamp_ntz(data.snapshot_time))
END AS snapshot_time
FROM VALUES
('{{artist_snapshot_time}}')
AS data(snapshot_time)
)
-- create a manual list of shared contracts with label
, input_contracts AS (
SELECT
*
FROM VALUES
(lower('0x495f947276749Ce646f68AC8c248420045cb7b5e'), 'OpenSea Shared Storefront')
, (lower('0xb932a70A57673d89f4acfFBE830E8ed7f75Fb9e0'), 'SuperRare')
, (lower('0xc143bbfcdbdbed6d454803804752a064a622c1f3'), 'Async Blueprints')
, (lower('0x2963bA471e265e5F51cAfaFca78310FE87F8E6D1'), 'MakersPlace')
, (lower('0x2A46f2fFD99e19a89476E2f62270e0a35bBf0756'), 'MakersPlace') -- V2
, (lower('0x3b3ee1931dc30c1957379fac9aba94d1c48a5405'), 'Foundation')
AS data(nft_contract_address, name)
)
Run a query to Download Data