Avalanche DeFiAave TVL Borrowed
    Updated 6 hours ago
    with
    aave_tokens as (
    select
    decoded_log:aToken as aToken,
    decoded_log:asset as asset,
    decoded_log:stableDebtToken as stableDebtToken,
    decoded_log:variableDebtToken as variableDebtToken
    from
    avalanche.core.ez_decoded_event_logs
    where
    contract_address='0x8145edddf43f50276641b55bd3ad95944510021e'
    and event_name='ReserveInitialized'
    ),

    tb as (
    select
    date(block_timestamp) as day,
    contract_address,
    sum(case when to_address='0x0000000000000000000000000000000000000000' then amount*-1 else amount end) daily_changes,
    sum(daily_changes) over (partition by contract_address order by day asc) balance1
    from
    avalanche.core.ez_token_transfers
    where
    contract_address in (select variableDebtToken from aave_tokens)
    and (to_address='0x0000000000000000000000000000000000000000' or from_address='0x0000000000000000000000000000000000000000')
    group by contract_address, day
    ),

    markets as (
    select
    block_timestamp,
    symbol,
    decimals,
    decoded_log:reserve as reserve,
    decoded_log:liquidityIndex*pow(10,-27) as liquidityIndex,
    rank() over (partition by symbol order by block_timestamp desc) as rank
    Last run: about 6 hours agoAuto-refreshes every 12 hours
    DAY
    CONTRACT_ADDRESS
    SYMBOL
    BALANCE
    BALANCE_USD
    1
    2024-06-15 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.8736437984987.842242717
    2
    2024-06-16 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.8736437988181.957227292
    3
    2024-06-17 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.8736437984063.817127855
    4
    2024-06-18 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.8736437970216.454843155
    5
    2024-06-19 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186968927.364044462
    6
    2024-06-20 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186970413.818328456
    7
    2024-06-21 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186953489.536461922
    8
    2024-06-22 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186953661.026606307
    9
    2024-06-23 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186953412.149212652
    10
    2024-06-24 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186916067.539106524
    11
    2024-06-25 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186910709.865065006
    12
    2024-06-26 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186914651.042895871
    13
    2024-06-27 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186910764.345688493
    14
    2024-06-28 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186910888.78438532
    15
    2024-06-29 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186903956.125046642
    16
    2024-06-30 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186911263.338671791
    17
    2024-07-01 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186936507.059383937
    18
    2024-07-02 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186929089.646315826
    19
    2024-07-03 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186901298.956455678
    20
    2024-07-04 00:00:00.0000x92b42c66840c7ad907b4bf74879ff3ef7c529473WBTC.E14.85835186867686.269058388
    ...
    4121
    435KB
    63s