freeman_7G8 Token
    Updated 2024-12-04
    with deployed_token as (
    with token as (
    select
    tx_hash,
    '0x' || substr(topics[2],27) as Token,
    '0x' || substr(regexp_substr_all(substr(data,3),'.{64}')[0],25 ) as Pool_contract,
    from base.core.fact_event_logs
    where origin_to_address = lower('0x3c0b43867cd04fedfd6a95497e5ea7e3aff8ccae')
    and origin_function_signature = '0x60b3104f'
    and topics[0] = lower('0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9')
    and '0x' || substr(topics[2],27) = lower('0x9a532dba4b18E605541c4eA5E14bF70490044858') -- $HUH TOKEN
    --where tx_hash = lower('0xf58261860e62d2c77b46f7c97fb64db0b6bad5d4f705dd8f995c6dda75d3fd37')
    )
    select
    t.token,
    t.pool_contract,
    livequery.utils.udf_hex_to_int(regexp_substr_all(substr(s.input_data,11),'.{64}')[3])/ power(10,18) as TokenSupply
    from base.core.fact_transactions s
    join token t ON s.tx_hash = t.tx_hash
    )

    ,Token_protection_time as (
    select
    token_out,
    contract_address,
    min(block_timestamp) as date_deployed,
    date_deployed + interval '2 hour' as snipe_protection_time
    from base.defi.ez_dex_swaps
    where contract_address in ( select pool_contract from deployed_token)
    and token_out in (select token from deployed_token) -- the actual token bought
    group by 1,2
    )
    ,swapActivity as (
    select --s.block_timestamp,t.snipe_protection_time,
    s.origin_from_address as address,
    QueryRunArchived: QueryRun has been archived