Query editor
WITH protocols_mapping AS (-- Define a fixed mapping between protocol names for TVL and VolumeSELECT *FROM (VALUES('Jupiter', 'Jupiter Perpetual Exchange'),('GMX', 'GMX V2 Perps'),('Hyperliquid', 'Hyperliquid Perp'),('Drift', 'Drift Trade'),('dYdX', 'dYdX (V3+V4)'),('ApeX Protocol', 'ApeX Pro'),('Vertex Perps', 'Vertex Perps'),('APX Finance', 'APX Finance'),('Aevo', 'Aevo Perps'),('KiloEx', 'KiloEx'),('SynFutures V3', 'SynFutures V3'),('Helix', 'Helix'),('HMX', 'HMX'),('FlashTrade', 'FlashTrade'),('Paradex', 'Paradex'),('HoldStation DeFutures', 'HoldStation DeFutures'),('MYX Finance', 'MYX Finance'),('Satori Perp', 'Satori Perp'),('RabbitX', 'RabbitX'),('JOJO', 'JOJO'),('Orderly Network', 'Orderly Perps'),('Aark Digital', 'Aark Digital'),('Blitz Perps', 'Blitz Perps'),('Bluefin', 'Bluefin'),('IPOR Derivatives', 'IPOR Derivatives'),('Gains Network', 'Gains Network'),('KTX Perps', 'KTX Perps'),('LogX V2', 'LogX V2'),('edgeX', 'edgeX')) 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-v3'),('https://api.llama.fi/updatedProtocol/holdstation-defutures'),('https://api.llama.fi/updatedProtocol/apex-protocol'),('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'),('https://api.llama.fi/updatedProtocol/hmx'),('https://api.llama.fi/updatedProtocol/apx-finance'),('https://api.llama.fi/updatedProtocol/paradex'),('https://api.llama.fi/updatedProtocol/logx'),