Query editor
--Error: Unable to fully debug querywithactions as (select * from query_4291350-- https://dune.com/queries/4291350),prices as (selecttoken,symbol,max_by(price, evt_block_time) as pricefrom actionswhere price is not nullgroup by 1,2),user_balances as (selectuser,token,symbol,asset_type,chain,sum(amount_claimed) as balfrom actionsgroup by 1,2,3,4,5)selectrank() over(order by total_usd desc) as tvl_rank,*,round((total_usd / sum(total_usd) over()) * 100, 2) as pool_percentage -- Calculate percentage of poolfrom (selectu.user,sum(bal * price) as total_usd,sum(case u.token when 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 then bal end) as WETH,sum(case u.token when 0xfae103dc9cf190ed75350761e95403b7b8afa6c0 then bal end) as rswETH,sum(case u.token when 0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7 then bal end) as rsETH,sum(case u.token when 0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee then bal end) as weETH,sum(case u.token when 0xbf5495Efe5DB9ce00f80364C8B423567e58d2110 then bal end) as ezETH,sum(case u.token when 0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7 then bal end) as pufETH,sum(case u.token when 0x7122985656e38bdc0302db86685bb972b145bd3c then bal end) as STONE,sum(case u.token when 0xF1376bceF0f78459C0Ed0ba5ddce976F1ddF51F4 then bal end) as uniETH,sum(case u.token when 0x09db87A538BD693E9d08544577d5cCfAA6373A48 then bal end) as ynETH,sum(case u.token when 0x8db2350d78abc13f5673a411d4700bcf87864dde then bal end) as swBTC,sum(case u.token when 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 then bal end) as wBTC,sum(case u.token when 0xf469fbd2abcd6b9de8e169d128226c0fc90a012e then bal end) as pumpBTC,sum(case u.token when 0x657e8C867D8B37dCC18fA4Caead9C45EB088C642 then bal end) as eBTC,sum(case u.token when 0x5300000000000000000000000000000000000004 then bal end) as "WETH(scroll)",sum(case u.token when 0xa25b25548B4C98B0c7d3d27dcA5D5ca743d68b7F then bal end) as "wrsETH(scroll",sum(case u.token when 0xc4d46E8402F476F269c379677C99F18E22Ea030e then bal end) as "pufETH(scroll)",sum(case u.token when 0x01f0a31698C4d065659b9bdC21B3610292a1c506 then bal end) as "weETH(scroll)",sum(case u.token when 0x80137510979822322193FC997d400D5A6C747bf7 then bal end) as "STONE(scroll)"from user_balances ujoin prices p on u.token = p.tokengroup by 1)where total_usd > 1order by total_usd desc;