Query editor
with cex_kr as (select * from cex.addresseswhere cex_name in ('BtcTurk')),cex_kr_txs as (select*,'cex->user' as tpfrom ethereum.transactionswhere "from" in (select address from cex_kr)union allselect*,'user->cex' as tpfrom ethereum.transactionswhere "to" in (select address from cex_kr)),stats as (selectdate_trunc('week',block_time) as dt,count(*) as txs,sum(case when tp='cex->user' then 1 else 0 end) as cex_to_user_txs,sum(case when tp='user->cex' then 1 else 0 end) as user_to_cex_txs,count(distinct "from") as unique_deposit,count(distinct "to") as unique_withdrawfrom cex_kr_txsgroup by 1)select*,sum(txs) over(order by dt asc) as total_txsfrom stats