Query editor
with eth_tx as (selectblock_time,"from" as from_address,"to" as to_address,cast(value as decimal(38, 0)) / 1e18 as tx_amt,tx_hash,'WETH' symbolfromethereum.traceswherecall_type = 'call'and success = trueand value > uint256 '0'and "from" is not nulland "to" is not nulland block_time >= timestamp '2023-03-02'-- and block_time >= now() - interval '30' dayunion allselectevt_block_time block_time,"from" as from_address,"to" as to_address,cast(value as decimal(38, 0)) / 1e6 as tx_amt,evt_tx_hash tx_hash,'USDT' symbolfrom erc20_ethereum.evt_Transferwhere contract_address = 0xdAC17F958D2ee523a2206206994597C13D831ec7 --USDT-- and evt_block_time >= now() - interval '30' dayand evt_block_time >= timestamp '2023-03-02'),token_price as (select symbol, pricefrom prices.usd_latestwhere symbol in ('WETH','USDT')and blockchain = 'ethereum'),external_address_tx as (selecta.from_address,a.to_address,a.tx_hash,b.user_id customer_id,b.from_addr deposit_address,b.to_addr novadax_deposit_address,case when from_address = from_addr then 'from' else 'to' end as external_tx_direction,c.symbol,tx_amt,coalesce(tx_amt*price,0) tx_usd_amtfrometh_tx ajoindune.xyn008.dataset_eth_deposit_cm bona.from_address = b.from_addror a.to_address = b.from_addrjointoken_price c