AVERAGE_DAYS_TOTAL | AVERAGE_DAYS_SOLD | |
---|---|---|
1 | 26.668508 | 9.828283 |
Sandeshaverage days held
Updated 2025-01-27
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
›
⌄
-- Step 1: Identify wolves SBT holders
WITH wolves_sbt_holders AS (
SELECT
DATE_TRUNC('week', block_timestamp) AS member_since,
nft_to_address AS member,
tokenId
FROM polygon.nft.ez_nft_transfers
WHERE block_number >= '44071817' -- Consider only transactions from this block onwards (SBT airdrop block)
AND nft_address = LOWER('0x0433882c60ada1077a9f652ca2d1d36422c62c6c') -- wolvesDAO sbt token
AND member != '0x0000000000000000000000000000000000000000' -- Ignore burn/mint address
QUALIFY ROW_NUMBER() OVER (PARTITION BY tokenId ORDER BY block_number DESC) = 1 -- Keep only latest transfer per tokenId
),
-- Step 2: Build the balance table
balance_table AS (
-- Incoming transactions
WITH inn AS (
SELECT
block_timestamp,
event_index,
tx_hash,
from_address AS counterparty,
to_address AS user,
amount
FROM base.core.ez_token_transfers
WHERE block_timestamp >= '2024-12-11 00:00:00.000'
AND to_address IN (SELECT member FROM wolves_sbt_holders) -- Only include wolvesdao members
AND contract_address = LOWER('0x919E43a2CcE006710090E64BDE9E01b38Fd7f32f') -- AIYP token
),
-- Outgoing transactions (negative amount for debits)
outt AS (
SELECT
block_timestamp,
event_index,
tx_hash,
Last run: 3 months ago
1
22B
17s