Query editor
with HTX_evm as (select address fromquery_2296923where exchange = 'HTX'),HTX_btc as (SELECT * from query_2613158where exchange = 'HTX'),eth_flow_daily as (select sum(amount) as amount from (select cast(value as double)/1e18 as amountfrom ethereum.traceswhere to in(select address from HTX_evm)AND (LOWER(call_type) NOT IN ('delegatecall', 'callcode', 'staticcall') or call_type is null)AND success = trueAND cast(value as double)>0AND block_time>= date('2016-01-01')UNION ALLselect -1*cast(value as double)/1e18 as amountfrom ethereum.traceswhere "from" in (select address from HTX_evm)AND (LOWER(call_type) NOT IN ('delegatecall', 'callcode', 'staticcall') or call_type is null)AND success = trueAND cast(value as double)>0AND block_time>= date('2016-01-01')UNION ALLSELECT (-1)*gas_price*gas_used/1e18 as amountFROM ethereum.transactionsWHERE "from" in (select address from HTX_evm)AND cast(value as double)>0AND block_time>= date('2016-01-01'))a),bnb_flow_daily as (select sum(amount) as amount from (select cast(value as double)/1e18 as amountfrom bnb.traceswhere to in(select address from HTX_evm)AND (LOWER(call_type) NOT IN ('delegatecall', 'callcode', 'staticcall') or call_type is null)AND success = trueAND cast(value as double)>0AND block_time>= date('2016-01-01')UNION ALLselect -1*cast(value as double)/1e18 as amountfrom bnb.traceswhere "from" in (select address from HTX_evm)AND (LOWER(call_type) NOT IN ('delegatecall', 'callcode', 'staticcall') or call_type is null)AND success = trueAND cast(value as double)>0AND block_time>= date('2016-01-01')UNION ALLSELECT (-1)*gas_price*gas_used/1e18 as amountFROM bnb.transactionsWHERE "from" in (select address from HTX_evm)AND cast(value as double)>0AND block_time>= date('2016-01-01'))a