kitlunaMakerDAO/Repayment (2)
    Updated 2022-09-04
    SELECT
    BLOCK_TIMESTAMP::date AS "date",
    COUNT (DISTINCT TX_HASH) AS repay_transactions,
    SUM (repay_transactions) OVER (ORDER BY "date") AS acm_repay_transactions,
    SUM (AMOUNT_PAID * PRICE) as volume_paid,
    SUM (volume_paid) OVER (ORDER BY "date") AS acm_volume_paid
    FROM ethereum.maker.ez_repayments a
    LEFT JOIN ethereum.core.fact_hourly_token_prices b
    ON HOUR = BLOCK_TIMESTAMP::date
    AND a.symbol = b.symbol
    WHERE BLOCK_TIMESTAMP >= '2022-01-01' AND TX_STATUS = 'SUCCESS'
    GROUP BY "date"
    ORDER BY "date"
    Run a query to Download Data