Query editor
withdeposited as (SELECTsymbol, vault_type, token_address, access, slashing, SUM(transfers) as quantity_depositedFROMquery_3820789 --Symbiotic Staking Transactions-- WHERE tx_type = 'deposit'GROUP BY 1,2,3,4,5)SELECTa.symbol, vault_type, quantity_deposited-- , CASE WHEN a.symbol = 'wstETH' THEN (100 - ((quantity_deposited/367900)*100))-- WHEN a.symbol = 'cbETH' THEN (100 - ((quantity_deposited/36870)*100))-- WHEN a.symbol = 'wbETH' THEN (100 - ((quantity_deposited/25410)*100))-- WHEN a.symbol = 'rETH' THEN (100 - ((quantity_deposited/22260)*100))-- WHEN a.symbol = 'mETH' THEN (100 - ((quantity_deposited/20450)*100))-- WHEN a.symbol = 'swETH' THEN (100 - ((quantity_deposited/10770)*100))-- WHEN a.symbol = 'sfrxETH' THEN (100 - ((quantity_deposited/9952)*100))-- WHEN a.symbol = 'ETHx' THEN (100 - ((quantity_deposited/5578)*100))-- WHEN a.symbol = 'sUSDe' THEN (100 - ((quantity_deposited/50000000)*100))-- WHEN a.symbol = 'ENA' THEN (100 - ((quantity_deposited/90000000)*100))-- WHEN a.symbol = 'WBTC' THEN (100 - ((quantity_deposited/1650)*100))-- WHEN a.symbol = 'tBTC' THEN (100 - ((quantity_deposited/165)*100))-- WHEN a.symbol = 'lsETH' THEN (100 - ((quantity_deposited/3619.25443358668)*100))-- WHEN a.symbol = 'FXS' THEN (100 - ((quantity_deposited/5649717.51412429)*100))-- WHEN a.symbol = 'osETH' THEN (100 - ((quantity_deposited/3683.24125230203)*100))-- WHEN a.symbol = 'ETHFI' THEN (100 - ((quantity_deposited/6944444.444444451)*100))-- END AS remaining, quantity_deposited * price as total_value_usd, access, slashingFROM deposited aLEFT JOIN prices.usd_latest b ON b.contract_address = a.token_addressWHERE b.contract_address = a.token_addressAND a.symbol IS NOT NULL-- AND c.token_address = 0xac3e018457b222d93114458476f3e3416abbe38fUNION ALLSELECTa.symbol, vault_type, quantity_deposited-- , CASE WHEN a.symbol = 'wstETH' THEN (100 - ((quantity_deposited/367900)*100))-- WHEN a.symbol = 'cbETH' THEN (100 - ((quantity_deposited/36870)*100))-- WHEN a.symbol = 'wbETH' THEN (100 - ((quantity_deposited/25410)*100))-- WHEN a.symbol = 'rETH' THEN (100 - ((quantity_deposited/22260)*100))-- WHEN a.symbol = 'mETH' THEN (100 - ((quantity_deposited/20450)*100))-- WHEN a.symbol = 'swETH' THEN (100 - ((quantity_deposited/10770)*100))-- WHEN a.symbol = 'sfrxETH' THEN (100 - ((quantity_deposited/9952)*100))-- WHEN a.symbol = 'ETHx' THEN (100 - ((quantity_deposited/5578)*100))-- WHEN a.symbol = 'sUSDe' THEN (100 - ((quantity_deposited/50000000)*100))-- WHEN a.symbol = 'ENA' THEN (100 - ((quantity_deposited/90000000)*100))-- WHEN a.symbol = 'WBTC' THEN (100 - ((quantity_deposited/1650)*100))-- WHEN a.symbol = 'tBTC' THEN (100 - ((quantity_deposited/165)*100))