Query editor
with toshi_daily_transfers as(select address, sum(value) as holding_amount, min(first_tx_time) as first_tx from (select "from" as address,-sum(value/1e18) as value, min(date_trunc('day',evt_block_time)) as first_tx_timefrom erc20_base.evt_transferwhere contract_address=0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4group by 1unionselect "to" as address, sum(value/1e18) as value, min(date_trunc('day',evt_block_time)) as first_tx_timefrom erc20_base.evt_transferwhere contract_address=0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4group by 1)group by 1),toshi_price as(select date_trunc('day',hour) as day,min(median_price) as price from dex.prices where contract_address=0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4group by 1),holders as (select address, holding_amount, first_tx, pricefrom toshi_daily_transfers h join toshi_price p on h.first_tx=p.day),label as ( -- exchange & ensselect address,name from ens.reverse_latestunionselect address,cex_name as name from query_3237025unionselect 0x0977250dbefe33086cebfb73970e0473c592fc54 as address,'TOSHI multisig' as nameunionselect 0x4b0aaf3ebb163dd45f663b38b6d93f6093ebc2d3 as address,'Uniswap pool' as name)select row_number() over (order by holding_amount desc) as ranked,'<a href=https://debank.com/profile/' || cast(h.address as varchar) || ' target=_blank">' || cast(h.address as varchar) || '</a>'as wallet_address,name, holding_amount, date_trunc('day',first_tx) as first_tx, price from holders hleft join label l on l.address=h.addresswhere holding_amount > 0limit 1000