Sbhn_NPUntitled Query
    Updated 2023-03-09
    select date_trunc('{{Date}}',block_timestamp) as date,
    case when symbol = 'MKR' then 'MKR'
    when symbol = 'SNX' then 'SNX'
    when symbol = 'UNI' then 'UNI'
    when symbol = 'USDC' then 'USDC'
    end as token,
    count(DISTINCT tx_hash) as borrows,
    count(DISTINCT borrower_address) as unique_borrowers,
    sum(borrowed_usd) as volume_usd,
    avg(borrowed_usd) as avg_volume
    from ethereum.aave.ez_borrows
    where symbol in ('MKR','SNX','UNI','USDC')
    group by 1,2
    Run a query to Download Data