flyingfishSolana Token Supply
    Updated 2024-09-11
    -- EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
    -- 7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj

    with token_details as (
    select
    address
    , name
    , symbol
    , iff(decimals is not null, decimals, {{token_decimals}}) as token_decimals
    from crosschain.core.dim_contracts
    where address = '{{token_address}}'
    )

    , first_mint as (
    select min(block_timestamp)::date as first_mint_date
    from solana.defi.fact_token_mint_actions
    where mint = '{{token_address}}'
    )

    , dates as (
    SELECT
    DISTINCT date
    FROM (
    SELECT
    case
    when '{{time_granularity}}' = 'day' then date_day
    when '{{time_granularity}}' = 'week' then iso_week_start_date
    when '{{time_granularity}}' = 'month' then month_start_date
    end as date
    FROM ethereum.core.dim_dates
    WHERE date_day BETWEEN (select first_mint_date from first_mint) AND current_date()
    )
    )

    , token_mints AS (
    SELECT
    QueryRunArchived: QueryRun has been archived