adriaparcerisasavalanche euro 5.3
    Updated 10 days ago

    with
    transfers_in as (
    select
    to_address,
    sum(amount) as volume
    from avalanche.core.ez_token_transfers
    where contract_address = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD')
    and block_timestamp >= '2023-05-25' and to_address<>'0x0000000000000000000000000000000000000000'
    group by 1
    ),
    transfers_out as (
    select
    from_address,
    sum(amount) as volume
    from avalanche.core.ez_token_transfers
    where contract_address = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD')
    and block_timestamp >= '2023-05-25' and (from_address<>'0x0000000000000000000000000000000000000000')
    group by 1
    ),
    final_transfers as (
    SELECT
    ifnull(x.to_address,y.from_address) as wallet,
    ifnull(x.volume,0)-ifnull(y.volume,0) as total_netflow
    from transfers_in x left join transfers_out y on x.to_address=y.from_address
    )
    select
    case when total_netflow>100000 then '1. >100k EUROC'
    when total_netflow between 10000 and 100000 then '2. 10k-100k EUROC'
    when total_netflow between 1000 and 10000 then '3. 1k-10k EUROC'
    when total_netflow between 100 and 1000 then '4. 100-1k EUROC'
    when total_netflow between 10 and 100 then '5. 10-100 EUROC'
    when total_netflow between 1 and 10 then '6. 1-10 EUROC'
    else '7. <1 EUROC' end as balances,
    count (distinct wallet) as holders,
    avg(total_netflow) as avg_holdings,
    Last run: 10 days ago
    BALANCES
    HOLDERS
    AVG_HOLDINGS
    TOTAL_HOLDINGS
    1
    1. >100k EUROC6476197.3581724972857184.14903498
    2
    2. 10k-100k EUROC848214.451936128385715.61548902
    3
    3. 1k-10k EUROC302152.44727276764573.418182999
    4
    4. 100-1k EUROC185252.3040106746676.241973939
    5
    5. 10-100 EUROC59726.59216769715875.524115004
    6
    6. 1-10 EUROC13363.5401057014729.581216001
    7
    7. <1 EUROC10170.1135886637115.519670987
    7
    370B
    7s