Query editor
-- Wallet Index (Collector vs Flipper)-- Computes a 0-100 score for a single wallet using VeeFriends-only activity.-- Outputs: wallet, index_score, index_band, and supporting metrics.---- Parameters:-- {{WalletAddress}} - Wallet to analyze (e.g., 0x1234...)---- Notes:-- - Uses only VeeFriends collections (S1/S2/Iconics/Book Games).-- - Trades are marketplace sales from nft.trades (mints not included).-- - Score weights/thresholds are tunable and documented in docs/wallet_vision.md.WITH collections AS (SELECT contract_address, blockchain, collection_key FROM (VALUES(0xA3AEE8BCE55BEEA1951EF834B99F3AC60D1ABEEB, 'ethereum', 's1'),(0x9378368ba6b85c1fba5b131b530f5f5bedf21a18, 'ethereum', 's2'),(0x65FFF8F5F6A9922B6DC13FE06345A0FE46DD413D, 'ethereum', 'iconics'),(0x6bb33db533dcc47d26570408559228d180bcd67c, 'base', 'bookgames')) AS t(contract_address, blockchain, collection_key)),wallet_trades AS (-- BuysSELECTc.collection_key,CAST(t.token_id AS INTEGER) AS token_id,t.block_time,'buy' AS trade_type,t.buyer AS walletFROM nft.trades tINNER JOIN collections cON t.nft_contract_address = c.contract_addressAND t.blockchain = c.blockchainWHERE t.buyer = FROM_HEX(SUBSTR(CAST({{WalletAddress}} AS VARCHAR), 3))AND (t.amount_original > 0 OR t.currency_symbol = 'WETH')UNION ALL-- SellsSELECTc.collection_key,CAST(t.token_id AS INTEGER) AS token_id,t.block_time,'sell' AS trade_type,t.seller AS walletFROM nft.trades tINNER JOIN collections cON t.nft_contract_address = c.contract_addressAND t.blockchain = c.blockchainWHERE t.seller = FROM_HEX(SUBSTR(CAST({{WalletAddress}} AS VARCHAR), 3))AND (t.amount_original > 0 OR t.currency_symbol = 'WETH')),current_holdings_eth AS (SELECTCAST(tr.tokenId AS INTEGER) AS token_id,tr.evt_block_time AS acquired_timeFROM (SELECTcontract_address, tokenId, "to", evt_block_time,