Query editor
WITH transactions AS (-- Transactions where 'original' is the senderSELECT"from" AS address,"to" AS related_address,block_time,hash AS transaction_hashFROM sonic.transactionsWHERE "from" = 0x680178d61d910736153991660c5710841c440ec7UNION ALL-- Transactions where 'original' is the receiverSELECT"to" AS address,"from" AS related_address,block_time,hash AS transaction_hashFROM sonic.transactionsWHERE "to" = 0x680178d61d910736153991660c5710841c440ec7),intermediaries AS (-- Find all addresses related to 'original' through transactionsSELECT DISTINCTrelated_address AS addressFROM transactions)-- Combine 'original' and all related addresses into a single listSELECT'original' AS address_type,0x680178d61d910736153991660c5710841c440ec7 AS addressUNION ALLSELECT'related' AS address_type,addressFROM intermediariesORDER BY address_type, address