Query editor
-- Zksync tvl calculationswithone_erc20_deposits as (selectdate_trunc('day', call_block_time) as block_time,"_token" as token,symbol,(sum(cast("_amount" as double))/power(10, avg(pr.decimals)))*avg(pr.price) as amt_usd,count(distinct "_franklinAddr") as depositors,count(call_tx_hash) as num_transactionsfrom zksync_ethereum.ZkSync_call_depositERC20 zkjoin prices.usd pr on (pr.contract_address = zk."_token" and date_trunc('minute', call_block_time) = minute)where call_successand call_block_time = date('2023-03-20')group by 1, 2, 3),one_eth_deposits as (select date_trunc('day', block_time) as block_time,sum(value)/1e18*avg(pr.price) as amt_usd,count(hash) as num_transactionsfrom ethereum.transactionsjoin zksync_ethereum.ZkSync_call_depositETH on (call_tx_hash = hash and call_block_time = block_time)join prices.usd pr on (date_trunc('minute', block_time) = minute)where "to" = 0xabea9132b05a70803a4e85094fd0e1800777fbefand successand pr.symbol = 'WETH'and blockchain = 'ethereum'group by 1),inflows as (select amts.block_time, sum(amts.amt_usd) as "Deposits (USD)", sum(num_transactions) as "# of Deposits"from (select block_time, amt_usd, num_transactions from one_erc20_depositsunion allselect block_time, amt_usd, num_transactions from one_eth_deposits) amtsgroup by 1),eth_outflows_raw as (select "to" as address,value_decimal as amt,tx_hash as hash,tx_block_time,tx_block_numberfrom transfers_ethereum.ethwhere "from" = 0xaBEA9132b05A70803a4E85094fD0e1800777fBEF),eth_outflows as (selectdate_trunc('day', tx_block_time) as day,sum(amt)*avg(pr.price) as amt,count(hash) as num_txfrom eth_outflows_rawjoin prices.usd pr on (date_trunc('minute', tx_block_time) = minute)where pr.symbol = 'WETH'and pr.blockchain = 'ethereum'group by 1),