freemartianTest Query
    Updated 2025-01-14
    -- =============== End 3BC Swap =========================
    with whitelist_3bc AS (
    select
    block_timestamp,
    tx_hash,
    to_address AS user,
    amount,
    amount_usd,
    symbol,
    token_price

    FROM base.core.ez_token_transfers
    WHERE block_timestamp::date >= '2025-01-09'
    AND contract_address = '0x3e64cd8fd4d2fae3d7f4710817885b0941838d0b'
    AND to_address not in ('0xe6ec4c661f0b822ba2851b4a1de9ad64132fbfe3','0xdda04ab22bd06ef490621eace04219798dd71bfd')
    AND tx_hash = '0x96f04e65252e38752d13071255b946c982ed1fd8b6569e3903cca00e290d477b'
    ),

    swap_from_1 AS(
    SELECT
    block_timestamp,
    tx_hash,
    decoded_log:sender::string AS user,
    (decoded_log:spentAmount/pow(10,18))::string AS amount_out,
    '3BC' AS from_token,
    decoded_log:dstToken::string AS to_token,
    decoded_log:returnAmount::string AS to_amount_raw,
    decoded_log,
    'sell' AS function
    FROM base.core.ez_decoded_event_logs
    WHERE decoded_log:srcToken = '0x3e64cd8fd4d2fae3d7f4710817885b0941838d0b'
    AND block_timestamp::date >= '2025-01-09'
    and event_name = 'Swapped'
    ),
    swap_from_2 AS(
    SELECT
    QueryRunArchived: QueryRun has been archived