petertherockarbitrum usdc lending
    Updated 2024-12-16
    SELECT
    platform,
    'borrow' as event,
    'loan' as asset_type,
    count(distinct borrower) as wallets,
    sum(amount) as token,
    sum(amount_usd) as vol
    from arbitrum.defi.ez_lending_borrows
    where token_symbol = 'USDC'
    and block_timestamp >= '2024-01-01'
    -- and event_name = 'Borrow'
    group by 1,2,3

    union all

    SELECT
    platform,
    'deposit' as event,
    'collateral' as asset_type,
    count(distinct depositor) as wallets,
    sum(amount) as token,
    sum(amount_usd) as vol
    from arbitrum.defi.ez_lending_deposits
    where token_symbol = 'USDC'
    and block_timestamp >= '2024-01-01'
    -- and event_name = 'SupplyCollateral'
    group by 1,2,3

    union all

    SELECT
    platform,
    'liquidations' as event,
    'collateral' as asset_type,
    count(distinct borrower) as wallets,
    sum(amount) as token,
    QueryRunArchived: QueryRun has been archived