Query editor
WITH loans AS (SELECTdate_trunc('day', evt_block_time) AS time,SUM(loanAmount / 1e18) AS total_loan_amountFROM blur_ethereum.Blend_evt_LoanOfferTaken aGROUP BY 1),nft_trades AS (SELECTdate_trunc('day', tx_timestamp_dt) AS time,SUM(price_decimal) AS total_nft_volumeFROM reservoir.salesWHERE fill_source = 'blur.io'and currency_symbol in ('ETH','WETH')GROUP BY 1)SELECTnft_trades.time,loans.total_loan_amount,nft_trades.total_nft_volume,loans.total_loan_amount * p.price as total_loan_amount_usd,nft_trades.total_nft_volume * p.price as nft_trades_usdFROM nft_tradesLEFT OUTER JOIN loans ON loans.time = nft_trades.timeLEFT JOIN prices.usd p ON p.minute = nft_trades.timeWHERE nft_trades.time > CAST('2023-01-01' as timestamp)AND p.symbol = 'ETH'