Sbhn_NPUntitled Query
    Updated 2023-03-08
    select date_trunc('{{Date}}',block_timestamp) as date,
    case when symbol = 'MKR' then 'MKR'
    when symbol = 'SNX' then 'SNX'
    when symbol = 'UNI' then 'UNI'
    end as token,
    borrow_rate_mode,
    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 aave_version = 'Aave V2'
    and symbol in ('MKR','SNX','UNI')
    group by 1,2,3
    Run a query to Download Data