winnie-fsUSDz Supply on Mainnet copy
    Updated 2024-09-16
    -- forked from alessio9567 / USDz Supply on Mainnet @ https://flipsidecrypto.xyz/alessio9567/q/cLJDwv8oifoG/usdz-supply-on-mainnet

    select
    day,
    sum(usdz_minted_amount) as daily_net_usdz_minted_amount,
    sum(daily_net_usdz_minted_amount) over (order by day) as usdz_supply
    from
    (
    -- mint
    SELECT
    date_trunc('day', block_timestamp) as day,
    SUM(amount) as usdz_minted_amount
    from
    ethereum.core.ez_token_transfers
    where
    contract_address = '0xa469b7ee9ee773642b3e93e842e5d9b5baa10067'
    and from_address = '0x0000000000000000000000000000000000000000'
    GROUP by
    1
    union
    all -- reedem
    SELECT
    date_trunc('day', block_timestamp),
    - SUM(amount) as usdz_burned_amount
    from
    ethereum.core.ez_token_transfers
    where
    contract_address = '0xa469b7ee9ee773642b3e93e842e5d9b5baa10067'
    and to_address = '0x0000000000000000000000000000000000000000'
    GROUP by
    1
    )
    group by 1
    order by 1 ASC


    QueryRunArchived: QueryRun has been archived