Afonso_Diazby event
    Updated 2025-05-07
    with

    pricet as (
    select
    hour::date as dt,
    token_address,
    decimals,
    symbol,
    avg(price) as token_price_usd
    from
    aptos.price.ez_prices_hourly
    group by 1, 2, 3, 4
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    event_data:amount as amount_unadj,
    token_address,
    event_data:actor as user,
    'Supply' as event_name
    from
    aptos.core.fact_events
    join
    aptos.core.fact_transfers transfers using (tx_hash)
    where
    payload_function = '0xccd1a84ccea93531d7f165b90134aa0415feb30e8757ab1632dac68c0055f5c2::entry_public::lend_v2'
    and event_type = '0xccd1a84ccea93531d7f165b90134aa0415feb30e8757ab1632dac68c0055f5c2::lend::LendEvent'
    and transfer_event = 'WithdrawEvent'
    and user = transfers.account_address
    and success

    union all

    select
    Last run: 21 days ago
    EVENT_NAME
    TRANSACTIONS
    USERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    1
    Supply421428471212336302.8602755011.832389838
    2
    Withdraw364076575188079131.6103085134.004793643
    2
    111B
    72s