Query editor
WITH deposits as (SELECTdate_trunc('week', evt_block_time) as time,sum("value"/1e6) as eth_amountFROM erc20_ethereum.evt_TransferWHERE "to" = {{rollbit erc20 address}}and contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48GROUP BY 1),withdraws as (SELECTdate_trunc('week', evt_block_time) as time,sum("value"/1e6) as eth_amountFROM erc20_ethereum.evt_TransferWHERE "from" = {{rollbit erc20 address}}and contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48GROUP BY 1)SELECTd.time AS week,d.eth_amount as deposits,- w.eth_amount as withdrawals,d.eth_amount - w.eth_amount AS net_depositsFROM deposits AS dLEFT JOIN withdraws AS w ON d.time = w.time