barbodalgoooooo789
    Updated 2022-03-12
    with t1 as (
    SELECT
    sum(amount) as Algo_amount
    FROM algorand.payment_transaction
    where block_timestamp >= '2022-02-10' AND block_timestamp <= '2022-02-17'
    and amount is not null
    and sender in (select address from algorand.labels where LABEL_TYPE = 'cex' )
    and receiver not in (select address from algorand.labels where LABEL_TYPE = 'cex')

    ),

    t2 as (
    SELECT
    sum(amount) as Algo_amount1
    FROM algorand.payment_transaction
    where block_timestamp >= '2022-02-10' AND block_timestamp <= '2022-02-17'
    and amount is not null
    and RECEIVER in (select address from algorand.labels where LABEL_TYPE = 'cex' )
    and SENDER not in (select address from algorand.labels where LABEL_TYPE = 'cex')

    )

    select

    round(sum(t1.Algo_amount)) as total_algo_to_dex,
    round(sum(t2.Algo_amount1)) as total_algo_to_cex

    from t1,t2





    Run a query to Download Data