Query editor
WITH-- get all eth and erc20 transfersget_transfers AS (SELECTtx_hash,"from","to",contract_address,amountFROM(-- gets all erc20 transfers (from events)SELECTevt_tx_hash AS tx_hash,"from","to",erc20transfers.contract_address,value as amountFROMerc20_ethereum.evt_Transfer erc20transfersWHERE0x0000000000000000000000000000000000000000 not in ("from", "to") -- remove mint and burnsAND evt_block_time > date_trunc('day', now() - interval '7' day)UNION ALL-- gets all transfers that transferred ether (from traces)SELECTtx_hash,"from","to",0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 as contract_address,value as amountfromethereum.traces tracesWHEREvalue > uint256 '0' -- this is the ether filterAND block_time > date_trunc('day', now() - interval '7' day))),-- get all successful transactions that have sent to a router addresstxs_to_router AS (SELECTCASEWHEN transactions."from" IN (SELECTuserFROMquery_2698146)AND transactions."to" = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D THEN 'Maestro'ELSE routers.projectEND as project,transactions.block_time,transactions.hash as tx_hash,transactions."from",transactions."to"FROMethereum.transactions transactionsJOIN query_2614931 AS routers ON transactions."to" = routers.addressand routers.blockchain = 'ethereum'WHERE