BaseHolders List copy
    Updated 2024-09-13
    -- forked from Holders List @ https://flipsidecrypto.xyz/studio/queries/abdb747d-4581-44f7-b5cf-c71a2d38e70d


    with database AS (
    with totalsupplytbl as (
    with general as (
    with tbl3 as (
    with tbl as (
    select
    to_address as "Address",
    sum(amount) as "Input"
    from base.core.ez_token_transfers
    where contract_address = lower ('0x66bff695f3b16a824869a8018a3a6e3685241269')
    group by
    1
    ),
    tbl2 as (
    select
    from_address as "Address",
    sum(amount) as "Output"
    from base.core.ez_token_transfers
    where contract_address = lower ('0x66bff695f3b16a824869a8018a3a6e3685241269')
    group by 1
    )
    select
    tbl."Address",
    case
    when "Input" is null then 0
    else "Input"
    end as "Input tokens",
    case
    when "Output" is null then 0
    else "Output"
    end as "Output tokens"
    from tbl left join tbl2 on tbl."Address" = tbl2."Address"
    )
    QueryRunArchived: QueryRun has been archived