BlockTracker Blaster
    Updated 2024-06-27
    with BlasterSwap_V2 as (-- fork from uniswap v2
    with pool_created as (
    select
    contract_address,
    REGEXP_SUBSTR_ALL(SUBSTR(data, 3, len(data)), '.{64}') as segmented_data,
    lower('0x' || substr(topics[1]::string, 27, 40) :: string) as token0,
    lower('0x' || substr(topics[2]::string, 27, 40) :: string) as token1,
    lower('0x' || substr(segmented_data[0]::string, 25, 40 ) :: string) as pool_address
    from blast.core.fact_event_logs
    WHERE topics[0] = '0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9'
    and tx_status = 'SUCCESS'
    and contract_address = lower('0x9CC1599D4378Ea41d444642D18AA9Be44f709ffD')-- BlasterFactory V2

    )
    ,
    swap as (
    select
    block_timestamp,
    block_number,
    origin_from_address,
    origin_to_address,
    ORIGIN_FUNCTION_SIGNATURE,
    tx_hash,
    event_index,
    contract_address,
    decoded_log: amount0In :: int as amount0In,
    decoded_log : amount1In :: int as amount1In,
    decoded_log : amount0Out :: int as amount0Out,
    decoded_log : amount1Out :: int as amount1Out
    from blast.core.ez_decoded_event_logs
    where topics[0]::string = '0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822'
    and block_timestamp::date >= '2024-02-28'
    and tx_status = 'SUCCESS'
    )

    , result as (
    QueryRunArchived: QueryRun has been archived