algo_ahab-4V8aSZwhale_transactions_chain_vision
    Updated 2024-07-26
    WITH whales AS (
    SELECT DISTINCT(USER_ADDRESS) as address
    FROM ethereum.erc20_balances
    WHERE SYMBOL = 'ETH'
    AND BALANCE_DATE > '2022-05-20'
    AND BALANCE > 20000
    AND LABEL_TYPE IS NULL
    ),
    labels AS (
    SELECT address, label FROM ethereum.core.dim_labels
    ),

    eth AS (
    SELECT block_timestamp as times,
    tx_hash as transaction_hash,
    origin_from_address as origin_source,
    eth_from_address as source,
    l1.label AS from_label,
    origin_to_address as origin_target,
    eth_to_address as target,
    l2.label AS to_label,
    'eth' as symbol,
    amount as amount,
    amount_usd as dollars
    FROM ethereum.core.ez_eth_transfers as et
    LEFT OUTER JOIN whales as w on et.eth_from_address = w.address
    LEFT OUTER JOIN whales as q on et.eth_to_address = q.address
    LEFT OUTER JOIN labels as l1 on et.eth_from_address = l1.address
    LEFT OUTER JOIN labels as l2 on et.eth_to_address = l2.address
    WHERE block_timestamp > '2022-05-20 00:00:00.000'
    AND ((NOT w.address IS NULL) OR (NOT q.address IS NULL))
    AND dollars > 1000
    ),
    erc20 AS (
    SELECT block_timestamp as times,
    QueryRunArchived: QueryRun has been archived