Query editor
SELECTDATE_TRUNC('month', block_time) AS month,COUNT(DISTINCT borrower) AS num_borrowers,COUNT(DISTINCT tx_hash) AS borrows_number,SUM(amount_usd) AS amount_USD,'AAVE_ETH' AS projectFROM aave_ethereum.borrowWHEREblock_time > CURRENT_TIMESTAMP - INTERVAL '1' yearAND borrower IN (SELECT userAddressFROM query_3468126)GROUP BY 1,5UNION ALLSELECTDATE_TRUNC('month', block_time) AS month,COUNT(DISTINCT borrower) AS num_borrowers,COUNT(DISTINCT tx_hash) AS borrows_number,SUM(amount_usd) AS amount_USD,'COMPOUND_ETH' AS projectFROM compound_ethereum.borrowWHEREblock_time > CURRENT_TIMESTAMP - INTERVAL '1' yearAND borrower IN (SELECT userAddressFROM query_3468126)GROUP BY 1,5UNION ALLSELECTDATE_TRUNC('month', evt_block_time) AS month,COUNT(DISTINCT borrower) AS num_borrowers,COUNT(DISTINCT evt_tx_hash) AS borrows_number,SUM(usd_amount) AS amount_USD,'AAVE_V3_OP' AS projectFROM aave_v3_optimism.borrowWHEREevt_block_time > CURRENT_TIMESTAMP - INTERVAL '1' yearAND borrower IN (SELECT userAddressFROM query_3468126)GROUP BY 1,5UNION ALLSELECTDATE_TRUNC('month', block_time) AS month,COUNT(DISTINCT borrower) AS num_borrowers,COUNT(DISTINCT tx_hash) AS borrows_number,SUM(amount_usd) AS amount_USD,'AAVE_OP' AS projectFROM aave_optimism.borrowWHEREblock_time > CURRENT_TIMESTAMP - INTERVAL '1' year