Query editor
with base as (select"from" as wallet_address,-value/1e18 as valuefrom erc20_ethereum.evt_Transferwhere contract_address = 0x57e114b691db790c35207b2e685d4a43181e6061 -- ethena token addressunion allselect"to" as wallet_address,value/1e18 as valuefrom erc20_ethereum.evt_Transferwhere contract_address = 0x57e114b691db790c35207b2e685d4a43181e6061),total_ethena_supply as (selectsum(value)/1e18 as total_supplyfrom erc20_ethereum.evt_Transferwhere contract_address = 0x57e114b691db790c35207b2e685d4a43181e6061and "from" = 0x0000000000000000000000000000000000000000),ens_data as (select owner, name from ethereumnameservice_ethereum.ETHRegistrarController_1_evt_NameRegisteredunion allselect owner, name from ethereumnameservice_ethereum.ETHRegistrarController_2_evt_NameRegisteredunion allselect owner, name from ethereumnameservice_ethereum.ETHRegistrarController_3_evt_NameRegisteredunion allselect owner, name from ethereumnameservice_ethereum.ETHRegistrarController_4_evt_NameRegistered),latest_price_ethena as (SELECTpriceFROMprices.usd_latestWHERE blockchain = 'ethereum'AND symbol = 'ENA'),ethena_holders AS (SELECTget_href(get_chain_explorer_address('ethereum', wallet_address),cast(wallet_address as varchar)) as wallet_address,sum(value) as total_amount,SUM(value * p.price) usd_value,get_href(concat('https://x.com/',name),concat('x.com/',name)) as twitterFROM baseINNER JOINlatest_price_ethena pON 1 = 1LEFT JOINens_data edON ed.owner = wallet_addresswhere wallet_address <> 0x0000000000000000000000000000000000000000group by 1,4having sum(value) > 0order by 2 desclimit 1000),wallet_rank as (SELECT