Afonso_DiazOvertime
    Updated 2025-05-15
    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: 17 days ago
    DATE
    EVENT_NAME
    TRANSACTIONS
    USERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    CUMULATIVE_TRANSACTIONS
    CUMULATIVE_VOLUME_USD
    1
    2024-04-01 00:00:00.000Borrow39225630078.10109162476.72984972439230078.101091624
    2
    2024-04-01 00:00:00.000Repay2458817211.48543582970.25096096324517211.485435829
    3
    2024-05-01 00:00:00.000Borrow566211143212.16785701304.706740121958173290.268948633
    4
    2024-05-01 00:00:00.000Repay1935117411.676871944139.29341497643834623.162307774
    5
    2024-06-01 00:00:00.000Borrow880231452132.42243275602.0405092311838625422.691381383
    6
    2024-06-01 00:00:00.000Repay2035263208.98241968569.45029206964197832.144727454
    7
    2024-07-01 00:00:00.000Borrow828312347295.359528164475.0962510652666972718.050909547
    8
    2024-07-01 00:00:00.000Repay40020638041.45358969698.5529885741041135873.598317149
    9
    2024-08-01 00:00:00.000Borrow9542966723852.404418777864.15485896936207696570.45532832
    10
    2024-08-01 00:00:00.000Repay802234250135.325196051327.8313567441843386008.9235132
    11
    2024-09-01 00:00:00.000Borrow87316311510576.654925414987.730019434449319207147.1102537
    12
    2024-09-01 00:00:00.000Repay8341457722211.3031724210563.90055153526778108220.22668562
    13
    2024-10-01 00:00:00.000Borrow272153336528254.242769713995.499709873721455735401.3530234
    14
    2024-10-01 00:00:00.000Repay111827217606380.94639116978.187990734379525714601.1730766
    15
    2024-11-01 00:00:00.000Borrow226841421937417.240016511130.094997472948277672818.5930399
    16
    2024-11-01 00:00:00.000Repay220037230014565.470152414570.177412695599555729166.643229
    17
    2024-12-01 00:00:00.000Borrow290851927563742.28033511674.60494719812390105236560.873375
    18
    2024-12-01 00:00:00.000Repay237431028562065.986139614076.917686614836984291232.6293686
    19
    2025-01-01 00:00:00.000Borrow183626227062395.15935919058.02476011214226132298956.032734
    20
    2025-01-01 00:00:00.000Repay212922124779543.905307214645.12051141110498109070776.534676
    28
    3KB
    57s