Pine AnalyticsBlast Stablecoin 1
    Updated 2024-10-05

    with tab1 as (
    -- Burn
    select
    date_trunc('day', block_timestamp) as Date,
    sum(case when symbol like 'MUSD' then -1.3*amount else -1*amount end) as amount
    from blast.core.ez_token_transfers
    where contract_address in ('0x4300000000000000000000000000000000000003', '0xeb466342c4d449bc9f53a865d5cb90586f405215',
    '0x4fee793d435c6d2c10c135983bb9d6d4fc7b9bbd', '0x837fe561e9c5dfa73f607fda679295dbc2be5e40',
    '0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34')
    and to_address = '0x0000000000000000000000000000000000000000'
    group by 1

    UNION ALL

    -- mint
    select
    date_trunc('day', block_timestamp) as Date,
    sum(case when symbol like 'MUSD' then 1.3*amount else amount end) as amount
    from blast.core.ez_token_transfers
    where contract_address in ('0x4300000000000000000000000000000000000003', '0xeb466342c4d449bc9f53a865d5cb90586f405215',
    '0x4fee793d435c6d2c10c135983bb9d6d4fc7b9bbd', '0x837fe561e9c5dfa73f607fda679295dbc2be5e40',
    '0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34')
    and from_address = '0x0000000000000000000000000000000000000000'
    group by 1
    )

    , tab2 as (
    select
    Date,
    sum(amount) as Net_Amount
    from tab1
    group by 1
    )

    SELECT
    QueryRunArchived: QueryRun has been archived