0xHaM-dTotal by Action[Mint/Redeem]
    Updated 2025-03-27
    with eventTb as (
    select
    EVENT_NAME,
    BLOCK_TIMESTAMP,
    TX_HASH,
    DECODED_LOG,
    DECODED_LOG:beneficiary::string as user_add,
    DECODED_LOG:collateral_amount::float/1e6 as collateral_amount_usdc,
    DECODED_LOG:avusd_amount::float/1e18 as avusd_amount,
    from avalanche.core.ez_decoded_event_logs
    where CONTRACT_ADDRESS = '0x1499cb3197427b78dc0e2d356a1e0e4149e0ed51'
    and EVENT_NAME in ('Mint', 'Redeem')
    and TX_SUCCEEDED = TRUE
    )
    select
    EVENT_NAME,
    -- teunc(BLOCK_TIMESTAMP, 'd') as date,
    count(*) as n_transactions,
    count(distinct user_add) as n_users,
    sum(collateral_amount_usdc) as total_collat_amount_usdc,
    sum(avusd_amount) as total_avusd_amount,
    from eventTb
    group by 1
    Last run: 12 days ago
    EVENT_NAME
    N_TRANSACTIONS
    N_USERS
    TOTAL_COLLAT_AMOUNT_USDC
    TOTAL_AVUSD_AMOUNT
    1
    Mint55228014438624.27144214435018.989583
    2
    Redeem5647605661.312568608704.83675
    2
    94B
    2s