Pine AnalyticsCombined ezETH Totals
    Updated 2024-10-31

    ------------------------------------------------------------------------------
    -- Arbitrum:
    with tab_mainA as (
    select
    date_trunc('week', block_timestamp) as Date,
    'Minted' as Type,
    sum(amount) as amount,
    sum(amount_usd) as amount_usd
    from arbitrum.core.ez_token_transfers
    where contract_address like lower('0x2416092f143378750bb29b79ed961ab195cceea5')
    and symbol like 'ezETH'
    and from_address like '0x0000000000000000000000000000000000000000'
    group by 1

    Union All

    select
    date_trunc('week', block_timestamp) as Date,
    'Burned' as Type,
    sum(amount) as amount,
    sum(amount_usd) as amount_usd
    from arbitrum.core.ez_token_transfers
    where contract_address like lower('0x2416092f143378750bb29b79ed961ab195cceea5')
    and symbol like 'ezETH'
    and to_address like '0x0000000000000000000000000000000000000000'
    group by 1

    order by Date desc
    )

    , tab_totalA as (
    select
    Date,
    sum(case when type like 'Minted' then amount else amount*-1 end) as Total_amount,
    sum(case when type like 'Minted' then amount_usd else amount_usd*-1 end) as Total_amount_usd
    QueryRunArchived: QueryRun has been archived