SectorStake Wallet List - Presentation Copy
    Updated 2023-02-10
    -- forked from 3838da9b-a3f2-4383-8948-85d80f846807

    --Note: When funding an account on stake.com users deposit money to a "jump" wallet that then automatically transfers the funds to the stake.com main wallet. This means, starting from the main wallet we need to step back 2 transactions to find the end user who deposited into stake.com
    --Find all jump wallets starting from stake.com main wallet. Then find all wallets that funded the jump wallet. This is the depositor wallet/user.
    --If airdrop make sure we over filter to ensure only users are listed. If we go the claim route, underfilter because CEX/Stake wallets will never claim their tokens.

    --01/09 Using the USD_Amount field limits the data set as data is not always avaialable in USD. Using raw token amounts and getting pricing later will improve amount of data

    --Find all Jump/Deposit wallets that Stake.com uses to funnel into their main wallet
    With Receive as (
    select
    ETH_FROM_ADDRESS as wallet,
    sum(amount) as Receive
    from ethereum.core.ez_eth_transfers
    where ETH_TO_ADDRESS = lower('0x974CaA59e49682CdA0AD2bbe82983419A2ECC400') --Stake.com main wallet where funds are deposited
    group by 1
    ),

    --Find all originating wallets. This is a list of wallets/users that have deposited money into Stake.com via the jump/deposit wallet path.
    wallets as (

    select
    wallet,
    sum("Number of Deposits") as "Number of Deposits",
    sum("Sum of Deposits") as "Sum of Deposits",
    sum("Avg Deposit") as "Avg Deposit"
    from(

    --Raw ETH Deposits
    SELECT
    ETH_FROM_ADDRESS as wallet,
    count(*) as "Number of Deposits",
    sum(AMOUNT_USD) as "Sum of Deposits",
    avg(AMOUNT_USD) as "Avg Deposit"
    from ethereum.core.ez_eth_transfers
    where ETH_TO_ADDRESS in (select wallet from receive) --where wallets are sending money to list of jump/deposit wallets we found
    Run a query to Download Data