KARTODDaily Sushi Activity on Ethereum
    Updated 2022-06-26
    SELECT
    DATE(BLOCK_TIMESTAMP) AS "Date",
    'Borrow' AS "Action",
    COUNT(DISTINCT TX_HASH) AS "Txs",
    SUM(AMOUNT_USD) AS "USD Volume",
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) AS "Users"
    FROM ethereum.sushi.ez_borrowing
    WHERE BLOCK_TIMESTAMP > '2022-02-01'
    AND ACTION = 'Borrow'
    GROUP BY 1
    UNION ALL

    SELECT
    DATE(BLOCK_TIMESTAMP) AS "Date",
    'Repay' AS "Action",
    COUNT(DISTINCT TX_HASH) AS "Txs",
    SUM(AMOUNT_USD) AS "USD Volume",
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) AS "Users"
    FROM ethereum.sushi.ez_borrowing
    WHERE BLOCK_TIMESTAMP > '2022-02-01'
    AND ACTION = 'Repay'
    GROUP BY 1
    UNION ALL

    SELECT
    DATE(BLOCK_TIMESTAMP) AS "Date",
    'Deposit' AS "Action",
    COUNT(DISTINCT TX_HASH) AS "Txs",
    SUM(AMOUNT_USD) AS "USD Volume",
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) AS "Users"
    FROM ethereum.sushi.ez_lending
    WHERE BLOCK_TIMESTAMP > '2022-02-01'
    AND ACTION = 'Deposit'
    GROUP BY 1
    Run a query to Download Data