kky111ethereum transactions different layers
    Updated 2023-12-05
    WITH first_layer AS (
    SELECT
    from_address,
    to_address,
    tx_hash,
    raw_amount/1000000000000000000 as amount,
    block_timestamp,
    'first_layer' AS layer
    FROM
    ethereum.core.fact_token_transfers
    WHERE 1=1
    --block_timestamp >= '2021-12-01'
    AND contract_address = '0x826180541412d574cf1336d22c0c0a287822678a'
    --AND tx_hash = '0x48096aaddb7e2078a31df58ec74cc0bb84c7efd0f63fc9a42636a94eef238b6b'
    AND from_address = '0xd152f549545093347a162dce210e7293f1452150'
    )


    , second_layer AS (
    SELECT
    from_address,
    to_address,
    tx_hash,
    raw_amount/1000000000000000000 as amount,
    block_timestamp,
    'second_layer' AS layer
    FROM
    ethereum.core.fact_token_transfers
    WHERE
    block_timestamp >= '2022-06-01'
    AND contract_address = '0x826180541412d574cf1336d22c0c0a287822678a'
    AND from_address IN (SELECT to_address FROM first_layer)
    AND tx_hash NOT IN (SELECT tx_hash FROM first_layer)
    --AND from_address != '0x46950ba8946d7be4594399bcf203fb53e1fd7d37'
    ),
    third_layer AS (
    Run a query to Download Data