vegardUntitled Query
    Updated 2022-11-11
    SELECT
    SUM(balances.balance) AS circulating_supply
    FROM (
    SELECT
    ledger.account
    , SUM(ledger.amount) AS balance
    FROM (
    SELECT
    FROM_ADDRESS AS account
    , RAW_AMOUNT/1e18 * -1 as amount
    FROM ethereum.core.fact_token_transfers
    WHERE LOWER(contract_address) = LOWER('0xb3999F658C0391d94A37f7FF328F3feC942BcADC')
    UNION ALL
    SELECT
    TO_ADDRESS AS account
    , RAW_AMOUNT/1e18 as amount
    FROM ethereum.core.fact_token_transfers
    WHERE LOWER(contract_address) = LOWER('0xb3999F658C0391d94A37f7FF328F3feC942BcADC')
    ) ledger
    GROUP BY ledger.account
    HAVING SUM(ledger.amount) > 0
    ) balances
    WHERE
    NOT balances.account IN (
    LOWER('0xff830ce17D39BbD6a4fef9683308D793dF8E34fC') -- multisig
    , LOWER('0x1A9a4d919943340B7E855E310489e16155F4ED29') -- claimer
    )
    Run a query to Download Data