Query editor
with balance AS (SELECTaddress,sum(amount) as amountFROM(SELECTa.to AS address,CAST(a.value AS DOUBLE)/1e18 AS amountFROM dydx_perpetual_ethereum.DydxToken_evt_Transfer aUNION ALLSELECTs."from" AS address,(-1)*CAST(s.value AS DOUBLE)/1e18 AS amountFROM dydx_perpetual_ethereum.DydxToken_evt_Transfer s)GROUP BY 1HAVINGSUM(amount) > 0),price as (selectpricefromprices.usd_latestwherecontract_address = 0x92D6C1e31e14520e676a687F0a93788B716BEff5and blockchain = 'ethereum'),fund_address as (selectaddress,nameFROM(VALUES(0x820fb25352bb0c5e03e07afc1d86252ffd2f0a18,'Paradigm'),(0x0716a17fbaee714f1e6ab0f9d59edbc5f09815c0,'Jump Trading')-- feel free to add more fund labels here, in the format mentioned above) AS t (address, name)union allselect distinctaddress,namefromlabels.funds),labels as (select distinctaddress,