Query editor
with time as (SELECT* FROMunnest(sequence(date('2020-12-10'), date(now()), interval '1' day)) AS t(day)),Blacklist as(SELECT pubkeyFROM (VALUES(0xb01dd8e44a8e02e36e0d66161103b9ff32315dbb9ae8c8ac8d097ba86a9e2b1eb3c7fd41e7cd1f77a987985639c26f52), (0xac424d8a3e6ce38eb22109125357324a1c44ecad7a330a3d3deff91e68f4b567ba38c065d2cf852ef050d21705e5dfcb), (0x918f080ca717afed4966901794ad8222ca618b523bbd3ce94be4a1240aa69d9be20f884950214a3cafa0404ce41213e1), (0xa8bcbf91bff7d3368ddbf5b35c46a4f5d82b16230c851a4b8eec82be45225d339414170e14a6cd17ad83ee3792dead85), (0x86f473a006c566f1648a82c74cdfbd4a3cb2ea04eb2e0d49ef381ab2562576888554ef3d39e56996f24c804abb489600), (0x8c69edd7a8e8da5330787952a1ad5075516e6fd4bda1586d62dd64701f7628d5229eb7f929017dea9ae6995f9c69ef5e)) AS temp_table (pubkey)), indexes AS (SELECT pubkey, ROW_NUMBER() OVER (ORDER BY MIN(deposit_index)) - 1 AS validator_indexFROM staking_ethereum.deposits dWHERE pubkey NOT IN (SELECT pubkey FROM Blacklist)GROUP BY 1),validator as(SELECT distinct i.validator_index--, d.block_time--, d.block_number--, d.amount_staked, d.entity as depositor_entity, d.entity_unique_name, d.entity_category as depositor_entity_category, d.pubkey--, d.withdrawal_credentials_type--, d.withdrawal_address--, d.withdrawal_credentials--, d.tx_from--, d.tx_hashFROM staking_ethereum.deposits d inner join dune_upload.Binance_ETH_Staking_Deposit_Address aon d.depositor_address = a.deposit_address_listINNER JOIN indexes i on i.pubkey = d.pubkeyWHERE d.pubkey NOT IN (SELECT pubkey FROM Blacklist))-- 2280321,withdraw as(select a.*, coalesce(full_withdrawal,0)+coalesce(partial_withdrawal,0) as total_withdrawn,(coalesce(full_withdrawal,0)+coalesce(partial_withdrawal,0))*price as total_withdrawn_usdfrom(selectcoalesce(depositor_entity, 'unknown') as depositor_entity,