Afonso_Diazgrouping txns
    Updated 1 day ago
    with

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

    main as (
    select
    tx_hash,
    block_timestamp,
    event_data:amount as amount_unadj,
    event_data:coin_name as token_address,
    event_data:signer_address as user,
    'Supply' as event_name
    from
    aptos.core.fact_events
    where
    payload_function like '0x2fe576faa841347a9b1b32c869685deb75a15e3f62dfe37cbd6d52cc403a16f6::pool::lend%'
    and event_type = '0x2fe576faa841347a9b1b32c869685deb75a15e3f62dfe37cbd6d52cc403a16f6::pool::LendEvent'
    and success

    union all

    select
    tx_hash,
    block_timestamp,
    event_data:amount as amount_unadj,
    event_data:coin_name as token_address,
    event_data:signer_address as user,
    'Withdraw' as event_name
    Last run: 1 day ago
    EVENT_NAME
    TYPE
    TRANSACTIONS
    1
    Supply$10 - $504585
    2
    Supply$10,000 - $100,00014523
    3
    Supply$100 - $5002928
    4
    Supply$1000 - $50005654
    5
    Supply$50 - $1001243
    6
    Supply$500 - $10002279
    7
    Supply$5000 - $10,0001080
    8
    SupplyAbove $100,0009845
    9
    SupplyBelow $109025
    10
    Withdraw$10 - $504440
    11
    Withdraw$10,000 - $100,00014374
    12
    Withdraw$100 - $5002107
    13
    Withdraw$1000 - $50005248
    14
    Withdraw$50 - $100964
    15
    Withdraw$500 - $10002050
    16
    Withdraw$5000 - $10,000969
    17
    WithdrawAbove $100,0006036
    18
    WithdrawBelow $108573
    18
    583B
    56s