Ali3NDately Avalanche BenQi Tokens Stats Over Time
    Updated 2024-06-03
    with AVAXPricet as (
    select hour::date as day,
    avg (price) as AVAXPrice
    from ethereum.price.ez_hourly_token_prices
    where symbol = 'WAVAX'
    group by 1),

    WBTCPricet as (
    select hour::date as day,
    avg (price) as WBTCPrice
    from ethereum.price.ez_hourly_token_prices
    where symbol = 'WBTC'
    group by 1),

    WETHPricet as (
    select hour::date as day,
    avg (price) as WETHPrice
    from ethereum.price.ez_hourly_token_prices
    where symbol = 'WETH'
    group by 1),

    LINKPricet as (
    select hour::date as day,
    avg (price) as LINKPrice
    from ethereum.price.ez_hourly_token_prices
    where symbol = 'LINK'
    group by 1),

    Maintable as (
    select tx_hash,
    origin_from_address as User,
    block_timestamp,
    case when event_name = 'Mint' then 'Deposit (Supply)'
    when event_name = 'Borrow' then 'Borrow'
    when event_name = 'RepayBorrow' then 'Repay'
    when event_name = 'Redeem' then 'Withdrawal (Redeem)'
    QueryRunArchived: QueryRun has been archived