KaskoazulCEX - Sent to ALGO
    Updated 2022-02-22
    WITH CEX_ADDRESS AS (
    SELECT
    address,
    label
    FROM
    algorand.labels
    WHERE
    label_type = 'cex'
    ),

    SENT_TO_CEX AS (
    SELECT
    p.block_timestamp::date as fecha,
    p.receiver as Cex_address,
    c.label as Cex_label,
    p.amount as Sent_to_amount
    FROM
    algorand.payment_transaction p
    INNER JOIN CEX_ADDRESS c
    ON p.receiver = c.address
    WHERE
    block_timestamp >= '2021-01-01'
    )

    SELECT
    fecha,
    Cex_label,
    sum(Sent_to_amount)
    FROM
    SENT_TO_CEX
    GROUP BY 1,2
    ORDER BY 3 DESC

    Run a query to Download Data