Query editor
WITH dlfo as (SELECT'DirectLoanFixedOffer' as loan_type,contract_address,borrower,lender,CAST(loanId as VARCHAR) as loan_id,CASEWHEN CAST(newLoanDuration as double) >= 86400 THEN CAST(newLoanDuration as double) / 86400ELSE CAST(newLoanDuration as double)END as loan_duration,newMaximumRepaymentAmount,evt_block_number,evt_block_time,evt_index,evt_tx_hash,null as isProRataFROMnftfi_ethereum.DirectLoanFixedOffer_evt_LoanRenegotiated),dlfcor_v2_3 as (SELECT'DirectLoanFixedCollectionOffer_v2.3' as loan_type,contract_address,borrower,lender,CAST(loanId as VARCHAR) as loan_id,CASEWHEN CAST(newLoanDuration as double) >= 86400 THEN CAST(newLoanDuration as double) / 86400ELSE CAST(newLoanDuration as double)END as loan_duration,newMaximumRepaymentAmount,evt_block_number,evt_block_time,evt_index,evt_tx_hash,null as isProRataFROMnftfi_ethereum.DirectLoanFixedCollectionOffer_v2_3_evt_LoanRenegotiated),dlfor_v2_3 as (SELECT'DirectLoanFixedOffer_v2.3' as loan_type,contract_address,borrower,lender,CAST(loanId as VARCHAR) as loan_id,CASEWHEN CAST(newLoanDuration as double) >= 86400 THEN CAST(newLoanDuration as double) / 86400ELSE CAST(newLoanDuration as double)END as loan_duration,newMaximumRepaymentAmount,evt_block_number,evt_block_time,evt_index,evt_tx_hash,null as isProRataFROM