Query editor
WITH totals AS (SELECTdate_trunc('day', a.evt_block_time) AS day,d.name AS collection,COUNT(DISTINCT a.evt_tx_hash) AS total_loans,SUM(a.loanAmount / 1E18) AS total_loan_amount,AVG(a.rate / 1e4) AS rateFROMblur_ethereum.Blend_evt_LoanOfferTaken aLEFT JOINtokens_ethereum.nft d ON a.collection = d.contract_addressWHEREd.contract_address IN (X'524cab2ec69124574082676e6f654a18df49a048',X'bd3531da5cf5857e7cfaa92426877b022e612cf8',X'062e691c2054de82f28008a8ccc6d7a1c8ce060d')GROUP BY1, 2)SELECTday,collection,total_loans,total_loan_amount,rateFROMtotalsORDER BYday ASC