mamad-5XN3k3Untitled Query
    Updated 2023-03-03
    with borrows as (
    select block_timestamp::Date as date,
    count (Distinct tx_hash) as txs,
    count (distinct BORROWER) as users
    --sum (AMOUNT_LOANED) as Borrowed_Volume,
    --avg (AMOUNT_LOANED) as Average_Volume
    from ethereum.maker.ez_flash_loans
    where block_timestamp >= '2023-01-01'
    and symbol = 'BUSD'
    and TX_STATUS='SUCCESS'
    group by 1),

    deposits as (
    select
    block_timestamp::Date as date,
    count (Distinct tx_hash) as txs,
    count (distinct depositor) as users,
    sum (AMOUNT_DEPOSITED) as Deposited_Volume,
    avg (AMOUNT_DEPOSITED) as Average_Volume
    from ethereum.maker.ez_deposits
    where block_timestamp >= '2023-01-01'
    and symbol = 'BUSD'
    and TX_STATUS='SUCCESS'
    group by 1),

    repayments as (
    select
    block_timestamp::Date as date,
    count (Distinct tx_hash) as txs,
    count (distinct payer) as users,
    sum (AMOUNT_PAID) as Repayed_Volume,
    avg (AMOUNT_PAID) as Average_Volume
    from ethereum.maker.ez_repayments
    where block_timestamp >= '2023-01-01'
    and symbol = 'BUSD'
    and TX_STATUS='SUCCESS'
    Run a query to Download Data