banterlyticserc20 holder
    Updated 2023-12-08
    WITH sent_tokens AS (
    SELECT
    to_address as Participant,
    sum(raw_amount/pow(10,18)) as xMETRIC
    FROM polygon.core.fact_token_transfers
    WHERE
    block_timestamp::date > '2022-01-10'::date
    AND contract_address = lower('0xbC91347e80886453F3f8bBd6d7aC07C122D87735')
    AND to_address != lower('0x4b8923746a1D9943bbd408F477572762801efE4d')
    GROUP BY 1
    ),
    burnt_tokens AS (
    SELECT
    to_address as Participant,
    sum(raw_amount/pow(10,18)) as xMETRIC
    FROM polygon.core.fact_token_transfers
    WHERE
    block_timestamp::date > '2022-01-10'::date
    AND contract_address = lower('0xbC91347e80886453F3f8bBd6d7aC07C122D87735')
    AND to_address = lower('0x0000000000000000000000000000000000000000')
    GROUP BY 1
    )
    SELECT
    sent_tokens.Participant as "participant_addr",
    coalesce(sent_tokens.xmetric,0) - coalesce(burnt_tokens.xMETRIC,0) as "balance"
    FROM sent_tokens
    LEFT JOIN burnt_tokens ON sent_tokens.Participant = burnt_tokens.Participant
    ORDER BY 2 DESC


    -- select user_address as HOLDER,
    -- current_bal as "NUMBER OF APECOINS",
    -- USD_VALUE_NOW as "USD VALUE OF APECOINS"
    -- from ethereum.core.ez_current_balances
    -- where contract_address = lower('0x94e496474F1725f1c1824cB5BDb92d7691A4F03a')
    -- and current_bal > 0