pepperatzi mUSD supply over time
    Updated 2025-04-11
    with mints as (
    select
    block_timestamp,
    tx_hash,
    'MINT' as event,
    '0x' || substr(topic_2, 27) as minter,
    livequery.utils.udf_hex_to_int(data) / '1e18' as musd
    from mezo.testnet.fact_event_logs
    where topic_0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    and topic_1 = '0x0000000000000000000000000000000000000000000000000000000000000000'
    and contract_address = lower('0x637e22A1EBbca50EA2d34027c238317fD10003eB')
    ),
    burn as (
    select
    block_timestamp,
    tx_hash,
    'BURN' as event,
    '0x' || substr(topic_1, 27) as minter,
    livequery.utils.udf_hex_to_int(data) / '1e18' as musd
    from mezo.testnet.fact_event_logs
    where topic_0 = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
    and topic_2 = '0x0000000000000000000000000000000000000000000000000000000000000000'
    and contract_address = lower('0x637e22A1EBbca50EA2d34027c238317fD10003eB')
    ),
    combined as (
    select * from mints
    union all
    select * from burn
    )
    select
    date_trunc('hour', block_timestamp) as hour,
    sum(case when event = 'MINT' then musd else 0 end) as total_hourly_mint,
    sum(case when event = 'BURN' then musd else 0 end) as total_hourly_burn,
    total_hourly_mint - total_hourly_burn as net_amount,
    sum(net_amount)
    over (order by date_trunc('hour', block_timestamp)) as cum_amount
    Last run: 15 days ago
    HOUR
    TOTAL_HOURLY_MINT
    TOTAL_HOURLY_BURN
    NET_AMOUNT
    CUM_AMOUNT
    1
    2025-03-29 10:00:00.00012636.5081012636.508112636.5081
    2
    2025-03-29 11:00:00.00022123427.33745022123427.3374522136063.84555
    3
    2025-03-29 12:00:00.00089953.75555089953.7555522226017.6011
    4
    2025-03-29 13:00:00.00040884.52025040884.5202522266902.12135
    5
    2025-03-29 14:00:00.00017483.63315017483.6331522284385.7545
    6
    2025-03-29 15:00:00.00020167.26455020167.2645522304553.01905
    7
    2025-03-29 16:00:00.0007936.922107936.922122312489.94115
    8
    2025-03-29 17:00:00.0006844.5373506844.5373522319334.4785
    9
    2025-03-29 18:00:00.00016125237.60255016125237.6025538444572.08105
    10
    2025-03-29 19:00:00.0003545.4540503545.4540538448117.5351
    11
    2025-03-29 20:00:00.00022100221038450327.5351
    12
    2025-03-29 22:00:00.00022100221038452537.5351
    13
    2025-03-30 03:00:00.00019091.0653019091.065338471628.6004
    14
    2025-03-30 04:00:00.0001513670.90601513670.90639985299.5064
    15
    2025-03-30 05:00:00.00048220482239990121.5064
    16
    2025-03-30 06:00:00.00096741.32455096741.3245540086862.83095
    17
    2025-03-30 07:00:00.00058223.2375058223.237540145086.06845
    18
    2025-03-30 08:00:00.000120654.36030120654.360340265740.42875
    19
    2025-03-30 09:00:00.00039300.01725039300.0172540305040.446
    20
    2025-03-30 10:00:00.0009925.2040509925.2040540314965.65005
    ...
    294
    20KB
    34s