Query editor
WITH latest_params AS (--AaveSELECTCASEWHEN mode = 'emode' AND loan_token IN ('BTCB', 'WBTC', 'cbBTC') THEN CONCAT('Aave E-mode - ', loan_token)WHEN loan_token IN ('BTCB', 'WBTC', 'cbBTC') THEN CONCAT('Aave - ', loan_token)WHEN mode = 'emode' THEN 'Aave E-mode'ELSE 'Aave' END AS protocol,loan_token,chain_id,utilization_rate,liquidation_threshold,max_ltv,reserve_factor,liquidation_penalty,total_supply,total_borrowsFROM query_5620975UNION ALL--MorphoSELECTCONCAT('Morpho - ', market) AS protocol,loan_token,chain_id,AVG(utilization_rate) AS utilization_rate,AVG(liquidation_threshold) AS liquidation_threshold,AVG(liquidation_threshold) AS max_ltv, --no distinction on Morpho between maxLTV and liquidation_threshold0 AS reserve_factor, --not enabled in MorphoNULL AS liquidation_penalty, --not captured in APISUM(total_supply) AS total_supply,SUM(total_borrows) AS total_borrowsFROM query_5621746GROUP BY 1,2,3 --Morpho markets are per collateral/loan token pair. Here we take the average utilization for a given loan token across the main collateral pairs.UNION ALL--VenusSELECTCASEWHEN loan_token IN ('BTCB', 'WBTC', 'cbBTC') THEN CONCAT('Venus - ', pool, ' ', loan_token)WHEN loan_token IN ('BNB', 'WBNB') THEN CONCAT('Venus - ', pool, ' ', loan_token)ELSE CONCAT('Venus - ', pool)END AS protocol,loan_token,chain_id,utilization_rate,liquidation_threshold,max_ltv,reserve_factor,liquidation_penalty, --not captured in APItotal_supply,total_borrowsFROM query_5622050UNION ALL--ListaSELECTCONCAT('Lista - ', market) AS protocol,