Ali3NAvalanche Lending Platforms' TVL
    Updated 2024-06-24
    with deposits as (
    select case when platform ilike '%aave%' then 'AAVE'
    when platform ilike '%joe%' then 'Trader Joe'
    else platform end as platform_name,
    token_symbol as market,
    sum (amount_usd) as deposit_volume
    --sum (case when token_symbol ilike '%usd%' or token_symbol ilike '%dai%' or token_symbol ilike '%frax%' or token_symbol ilike '%mim%' then amount else amount_usd end) as Deposit_Volume
    from avalanche.defi.ez_lending_deposits
    group by 1,2),

    withdraws as (
    select case when platform ilike '%aave%' then 'AAVE'
    when platform ilike '%joe%' then 'Trader Joe'
    else platform end as platform_name,
    token_symbol as market,
    sum (amount_usd) as withdraw_volume
    --sum (case when token_symbol ilike '%usd%' or token_symbol ilike '%dai%' or token_symbol ilike '%frax%' or token_symbol ilike '%mim%' then amount else amount_usd end) as withdraw_volume
    from avalanche.defi.ez_lending_withdraws
    group by 1,2),

    borrows as (
    select case when platform ilike '%aave%' then 'AAVE'
    when platform ilike '%joe%' then 'Trader Joe'
    else platform end as platform_name,
    token_symbol as market,
    sum (amount_usd) as borrow_volume
    --sum (case when token_symbol ilike '%usd%' or token_symbol ilike '%dai%' or token_symbol ilike '%frax%' or token_symbol ilike '%mim%' then amount else amount_usd end) as borrow_volume
    from avalanche.defi.ez_lending_borrows
    group by 1,2),

    repayments as (
    select case when platform ilike '%aave%' then 'AAVE'
    when platform ilike '%joe%' then 'Trader Joe'
    else platform end as platform_name,
    token_symbol as market,
    sum (amount_usd) as repayment_volume
    Auto-refreshes every 6 hours
    QueryRunArchived: QueryRun has been archived