FatemeTheLadyToken Holders copy
    Updated 2025-03-23
    -- forked from datavortex / Token Holders @ https://flipsidecrypto.xyz/datavortex/q/FYyQBra5V2mj/token-holders

    WITH transfers AS (
    SELECT
    contract_address,
    LOWER('0x' || SUBSTR(topics[1], 27)) AS from_address,
    LOWER('0x' || SUBSTR(topics[2], 27)) AS to_address,
    CAST(ethereum.public.udf_hex_to_int(SUBSTRING(data, 3, 64)) AS FLOAT) /
    CASE
    WHEN contract_address = LOWER('0xad6605f4987031fd2d6d6816be53eb7c5b764bf7') THEN POWER(10, 6) -- XTBT: 6 decimals
    WHEN contract_address = LOWER('0x53fc82f14f009009b440a706e31c9021e1196a2f') THEN POWER(10, 6) -- BUIDL: 6 decimals
    WHEN contract_address = LOWER('0xe08b4c1005603427420e64252a8b120cace4d122') THEN POWER(10, 18) -- $BENJI: 18 decimals
    WHEN contract_address = LOWER('0x7c6a937943f135283a2561938de2200994a8f7a7') THEN POWER(10, 8) -- $NOTE: 8 decimals
    WHEN contract_address = LOWER('0x7c64925002bfa705834b118a923e9911bee32875') THEN POWER(10, 6) -- $ACRED: 6 decimals
    WHEN contract_address = LOWER('0x0b84f124596dac26010a9f79b7d8feade4ebbdbf') THEN 1 -- $SKHC: 0 decimals
    WHEN contract_address = LOWER('0xbb9360d57f68075e98d022784c12f2fda082316b') THEN POWER(10, 6) -- $XRV: 6 decimals
    WHEN contract_address = LOWER('0xbfdef5e389bb403426337081ecd1d05bc5193203') THEN POWER(10, 6) -- $XEVT: 6 decimals
    WHEN contract_address = LOWER('0x3a206f8f7cec45f1bd48ee5f370d04f609504d56') THEN POWER(10, 6) -- $PARAVII: 6 decimals
    END AS amount
    FROM avalanche.core.ez_decoded_event_logs
    WHERE event_name = 'Transfer'
    AND contract_address IN (
    LOWER('0xad6605f4987031fd2d6d6816be53eb7c5b764bf7'), -- XTBT
    LOWER('0x53fc82f14f009009b440a706e31c9021e1196a2f'), -- BUIDL
    LOWER('0xe08b4c1005603427420e64252a8b120cace4d122'), -- $BENJI
    LOWER('0x7c6a937943f135283a2561938de2200994a8f7a7'), -- $NOTE
    LOWER('0x7c64925002bfa705834b118a923e9911bee32875'), -- $ACRED
    LOWER('0x0b84f124596dac26010a9f79b7d8feade4ebbdbf'), -- $SKHC
    LOWER('0xbb9360d57f68075e98d022784c12f2fda082316b'), -- $XRV
    LOWER('0xbfdef5e389bb403426337081ecd1d05bc5193203'), -- $XEVT
    LOWER('0x3a206f8f7cec45f1bd48ee5f370d04f609504d56') -- $PARAVII
    )
    ),
    address_balances AS (
    SELECT
    Last run: 14 days ago
    TOKEN_NAME
    TOTAL_CURRENT_HOLDERS
    1
    $ACRED1
    2
    $BENJI4
    3
    $NOTE7395
    4
    $XEVT5
    5
    $XRV2
    6
    BUIDL5
    7
    XTBT8
    7
    88B
    6s