Query editor
WITH cow_mainnet AS (SELECTdate_trunc('month', block_time) AS date_month,coalesce(sum("Limit"), 0) + coalesce(sum("Market"), 0) + coalesce(sum("UI Fee"), 0) AS protocol_fee,coalesce(sum("Partner Fee Share"), 0) AS partner_fee_shareFROM "query_4217030(blockchain='ethereum',ui_fee_recipient='0x0000000000000000000000000000000000000000')"GROUP BY 1),daily_eth_price AS (SELECTday,priceFROM prices.usd_dailyWHEREblockchain = 'ethereum'AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2),cow_gnosis AS (SELECTdate_trunc('month', block_time) AS date_month,(coalesce(sum("Limit" / price), 0) + coalesce(sum("Market" / price), 0) + coalesce(sum("UI Fee" / price), 0)) AS protocol_fee,coalesce(sum("Partner Fee Share" / price), 0) AS partner_fee_shareFROM "query_4217030(blockchain='gnosis',ui_fee_recipient='0x6b3214fD11dc91De14718DeE98Ef59bCbFcfB432')"LEFT JOIN daily_eth_price ON day = date_trunc('day', block_time)GROUP BY 1),cow_arbitrum AS (SELECTdate_trunc('month', block_time) AS date_month,coalesce(sum("Limit"), 0) + coalesce(sum("Market"), 0) + coalesce(sum("UI Fee"), 0) AS protocol_fee,coalesce(sum("Partner Fee Share"), 0) AS partner_fee_shareFROM "query_4217030(blockchain='arbitrum',ui_fee_recipient='0x451100Ffc88884bde4ce87adC8bB6c7Df7fACccd')"GROUP BY 1),cow_base AS (SELECTdate_trunc('month', block_time) AS date_month,coalesce(sum("Limit"), 0) + coalesce(sum("Market"), 0) + coalesce(sum("UI Fee"), 0) AS protocol_fee,coalesce(sum("Partner Fee Share"), 0) AS partner_fee_shareFROM "query_4217030(blockchain='base',ui_fee_recipient='0x0000000000000000000000000000000000000000')"GROUP BY 1),mevblocker AS (SELECTdate_trunc('month', call_block_time) AS date_month,sum(t.due / 1e18 / 2) AS mev_blocker_feeFROM mev_blocker_ethereum.MevBlockerFeeTill_call_billCROSS JOIN unnest(due) AS t (due)WHEREcall_success = trueGROUP BY 1)SELECTcm.date_month AS "month",