Query editor
WITH protocols_mapping AS (-- Hardcoded protocol name mapping between TVL and VolumeSELECT *FROM (VALUES('Jupiter', 'Jupiter Perpetual Exchange'),('GMX', 'GMX V2 Perps'),('Hyperliquid Bridge', 'Hyperliquid Perps'),('Drift', 'Drift Trade'),('dYdX', 'dYdX (V3+V4)'),('ApeX Pro', 'ApeX Pro'),('Apex Omni', 'Apex Omni'),('Vertex Perps', 'Vertex Perps'),('APX Finance', 'APX Finance'),('Aevo', 'Aevo Perps'),('KiloEx', 'KiloEx'),('SynFutures', 'SynFutures V3'),('Helix Perp', 'Helix Spot'),('HMX', 'HMX'),('FlashTrade', 'FlashTrade'),('Paradex', 'Paradex'),('HoldStation DeFutures', 'HoldStation DeFutures'),('MYX Finance', 'MYX Finance'),('Satori Perp', 'Satori Perp'),('RabbitX', 'RabbitX'),('JOJO', 'JOJO'),('Orderly', 'Orderly Perps'),('Aark Digital', 'Aark Digital'),('Blitz Perps', 'Blitz Perps'),('Bluefin', 'Bluefin Perps'),('IPOR Derivatives', 'IPOR Derivatives'),('Gains Network', 'Gains Network'),('KTX Perps', 'KTX Perps'),('LogX V2', 'LogX V2'),('edgeX', 'edgeX'),('PancakeSwap','PancakeSwap Perps'),('Synthetix','Synthetix')) AS t(tvl_protocol_name, volume_protocol_name)),-- TVL Data Processingtvls AS (WITH protocols AS (SELECT *FROM (VALUES('https://api.llama.fi/updatedProtocol/drift'),('https://api.llama.fi/updatedProtocol/rabbitx'),('https://api.llama.fi/updatedProtocol/satori-perp'),('https://api.llama.fi/updatedProtocol/synfutures'),('https://api.llama.fi/updatedProtocol/holdstation-defutures'),('https://api.llama.fi/updatedProtocol/apex-pro'),('https://api.llama.fi/updatedProtocol/apex-omni'),('https://api.llama.fi/updatedProtocol/vertex-perps'),('https://api.llama.fi/updatedProtocol/jupiter'),('https://api.llama.fi/updatedProtocol/gmx'),('https://api.llama.fi/updatedProtocol/dydx'),('https://api.llama.fi/updatedProtocol/myx-finance'),('https://api.llama.fi/updatedProtocol/jojo'),('https://api.llama.fi/updatedProtocol/kiloex'),