Query editor
WITHtransaction_samples AS (SELECT DISTINCTevt_tx_hash,CASEWHEN onBehalfOf <> user THEN 'supply_onBehalfOf_not_user'ELSE 'supply_onBehalfOf_equals_user'END AS supply_comparison_type,ROW_NUMBER() OVER (PARTITION BYCASEWHEN onBehalfOf <> user THEN 'supply_onBehalfOf_not_user'ELSE 'supply_onBehalfOf_equals_user'ENDORDER BYevt_tx_hash) AS rnFROMaave_v2_ethereum.LendingPool_evt_Deposit),withdraw_samples AS (SELECT DISTINCTevt_tx_hash,CASEWHEN to <> user THEN 'withdraw_to_not_user'ELSE 'withdraw_to_equals_user'END AS withdraw_comparison_type,ROW_NUMBER() OVER (PARTITION BYCASEWHEN to <> user THEN 'withdraw_to_not_user'ELSE 'withdraw_to_equals_user'ENDORDER BYevt_tx_hash) AS rnFROMaave_v2_ethereum.LendingPool_evt_Withdraw),repay_samples AS (SELECT DISTINCTevt_tx_hash,CASEWHEN repayer <> user THEN 'repayer_not_user'ELSE 'repayer_equals_user'END AS repay_comparison_type,ROW_NUMBER() OVER (PARTITION BYCASEWHEN repayer <> user THEN 'repayer_not_user'ELSE 'repayer_equals_user'ENDORDER BYevt_tx_hash) AS rnFROMaave_v2_ethereum.LendingPool_evt_Repay),borrow_samples AS (SELECT DISTINCT