cloudr3nxSGD Circulating Supply
    Updated 2024-11-04
    with
    date_ls as (
    select
    *
    from
    ethereum.core.dim_dates
    where
    date_day>='2020-04-03' and date_day<=current_date()
    ),

    polygon_supply as (
    select
    date(block_timestamp) as day,
    sum(case when to_address='0x0000000000000000000000000000000000000000' then amount*(-1)
    when from_address='0x0000000000000000000000000000000000000000' then amount end) daily_changes,
    sum(daily_changes) over (order by day asc) circulating_supply
    from
    polygon.core.ez_token_transfers
    where
    contract_address='0xdc3326e71d45186f113a2f448984ca0e8d201995'
    and (from_address='0x0000000000000000000000000000000000000000' or to_address='0x0000000000000000000000000000000000000000')
    group by
    day
    ),

    ethereum_supply as (
    select
    date(block_timestamp) as day,
    sum(case when to_address='0x0000000000000000000000000000000000000000' then amount*(-1)
    when from_address='0x0000000000000000000000000000000000000000' then amount end) daily_changes,
    sum(daily_changes) over (order by day asc) circulating_supply
    from
    ethereum.core.ez_token_transfers
    where
    contract_address='0x70e8de73ce538da2beed35d14187f6959a8eca96'
    and (from_address='0x0000000000000000000000000000000000000000' or to_address='0x0000000000000000000000000000000000000000')
    QueryRunArchived: QueryRun has been archived