CryptoIcicleHacks, Scandals and Scams - 3. Whales On Alert - ETH Transactions
    Updated 2022-07-29
    -- Identify active wallets with a high balance of ETH (whales).
    -- Visualize the ETH transaction history of these whales in May and June 2022.

    -- Total Evaluated score
    -- Payout
    -- 12 250 USDC
    -- 10-11 200 USDC
    -- 8-9 75 USDC
    -- 6-7 50 USDC
    -- Less than 6 0

    with whales as (
    select
    *
    from flipside_prod_db.ethereum.erc20_balances
    where 1=1
    and balance_date = CURRENT_DATE - 1
    and contract_address= 'ETH'
    order by balance desc
    limit {{n_wallets}}
    )


    select
    date_trunc('{{date_range}}', s.block_timestamp) as date,
    coalesce(s.contract_name,s.contract_address) as contract,
    w.user_address,
    concat(coalesce(w.address_name,'-'),'::',w.user_address) as name,
    s.event_name,
    count(distinct s.tx_hash) as n_txns,
    sum(t.eth_value) as eth_amount,
    sum(t.tx_fee) as eth_fee
    from ethereum.core.fact_event_logs s
    join whales w on w.user_address = s.origin_from_address
    join ethereum.core.fact_transactions t on s.tx_hash = t.tx_hash
    where 1=1
    Run a query to Download Data