Tony_IntelTotal mint and burn of USDC
    Updated 2023-06-18
    with source as (
    select
    sum(case when from_address = '0x0000000000000000000000000000000000000000' then (raw_amount/pow(10, 6))end) as minted_USDC,
    'Optimism' as blockchain,
    date_trunc('week', block_timestamp) as date,
    sum(case when to_address = '0x0000000000000000000000000000000000000000' then (-raw_amount/pow(10, 6)) end) as burned_USDC
    from optimism.core.fact_token_transfers
    where --origin_function_signature in ('0x40c10f19', '0x42966c68') and
    contract_address = lower('0x7f5c764cbc14f9669b88837ca1490cca17c31607') and
    (from_address = '0x0000000000000000000000000000000000000000' or to_address = '0x0000000000000000000000000000000000000000')
    and block_timestamp::date >= current_date - 90
    group by 2, 3

    union all

    select
    sum(case when from_address = '0x0000000000000000000000000000000000000000' then (raw_amount/pow(10, 6))end) as minted_USDC,
    'Polygon' as blockchain,
    date_trunc('week', block_timestamp) as date,
    sum(case when to_address = '0x0000000000000000000000000000000000000000' then (-raw_amount/pow(10, 6)) end) as burned_USDC
    from polygon.core.fact_token_transfers
    where --origin_function_signature in ('0x40c10f19', '0x42966c68') and
    contract_address = lower('0x2791bca1f2de4661ed88a30c99a7a9449aa84174') and
    (from_address = '0x0000000000000000000000000000000000000000' or to_address = '0x0000000000000000000000000000000000000000')
    and block_timestamp::date >= current_date - 90
    group by 2, 3

    union all

    select
    sum(case when from_address = '0x0000000000000000000000000000000000000000' then (raw_amount/pow(10, 6))end) as minted_USDC,
    'Arbitrum' as blockchain,
    date_trunc('week', block_timestamp) as date,
    sum(case when to_address = '0x0000000000000000000000000000000000000000' then (-raw_amount/pow(10, 6)) end) as burned_USDC
    from arbitrum.core.fact_token_transfers
    where --origin_function_signature in ('0x40c10f19', '0x42966c68') and
    Run a query to Download Data