Query editor
WITHoutbound_txs AS (SELECT"from" AS address,-CAST(tr.value AS DOUBLE) / POWER(10, 18) AS amount,tx_hashFROMethereum.traces trWHERE"from" = (SELECT MAX(balance) AS Ethereum_balance FROM ethereum.traces)AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall')OR call_type IS null)AND "from" <> "to"AND success),inbound_txs AS (SELECT"to" AS address,CAST(value AS DOUBLE) / POWER(10, 18) AS amount,tx_hashFROMethereum.tracesWHERE"to" = (SELECT MAX(balance) AS Ethereum_balance FROM ethereum.traces)AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall')OR call_type IS null)AND success),gas_costs AS (SELECT"from" AS address,-(CAST(gas_used AS DOUBLE) / POWER(10, 18) * CAST(gas_price AS DOUBLE)) AS amount,hashFROMethereum.transactions etWHERE"from" = (SELECT MAX(balance) AS Ethereum_balance FROM ethereum.traces)),eth_usd_rate AS (SELECTMAX(price) AS usd_per_ethFROMeth_usd_prices)SELECTSUM(amount * e.usd_per_eth) AS current_usd_balanceFROM(SELECT*FROMoutbound_txsUNION ALLSELECT