dan-smithComptroller testing1
    Updated 2023-02-08
    WITH tokens_in AS(
    SELECT
    *
    ,SUM(amount) OVER(PARTITION BY SYMBOL) AS symbol_total
    FROM (
    SELECT
    SYMBOL
    ,FROM_ADDRESS
    ,SUM(AMOUNT) AS amount
    FROM ethereum.core.ez_token_transfers
    WHERE
    TO_ADDRESS = lower('0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27')
    AND SYMBOL IN('CRV', 'CVX', 'FXS')
    GROUP BY 1,2
    )
    ),

    tokens_out AS (
    SELECT
    SYMBOL
    ,TO_ADDRESS
    ,SUM(AMOUNT) AS amount
    FROM ethereum.core.ez_token_transfers
    WHERE
    FROM_ADDRESS = lower('0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27')
    AND SYMBOL IN('CRV', 'CVX', 'FXS')
    GROUP BY 1,2
    )

    SELECT *
    FROM tokens_out
    Run a query to Download Data