Query editor
WITH params AS (SELECT0x8881562783028f5c1bcb985d2283d5e170d88888AS shfl_contract,-- Width of each historical selling-price cluster.-- 0.01 creates $0.01-wide bands.CAST(0.01 AS DOUBLE)AS price_band_size,-- TRUE excludes wallets marked as non-organic.-- FALSE includes every wallet.TRUE AS exclude_known_wallets,-- Ignore extremely small trades if desired.-- Set to 0 to include everything.CAST(0 AS DOUBLE)AS minimum_trade_usd),/* ============================================================TEAM, BUYBACK AND OTHER KNOWN WALLETS============================================================ */known_wallets AS (SELECT *FROM (VALUES(0xe9c00c9b0dcd5a41704cdf65a363aa88072e1b4c,'Team Buybacks',TRUE),(0x8d3b38316f4fa5db1779ee372d1ddae465b55769,'Team Buybacks',TRUE)) AS labels(address,wallet_classification,exclude_from_organic)),/* ============================================================1. FIND ALL HISTORICAL SHFL DEX SALES============================================================ */raw_shfl_sells AS (SELECTd.block_time,d.block_date,d.tx_hash,d.tx_from AS seller,d.token_sold_amountAS shfl_sold,d.amount_usd