Ariofriend tech MEV
    Updated 2024-04-10
    with subjects as (
    select
    distinct DECODED_LOG:subject as subject
    from
    base.core.ez_decoded_event_logs
    where
    DECODED_LOG:subject is not null
    and contract_address = '0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4'
    ),
    active_block as (
    select
    subject,
    min(BLOCK_NUMBER) as start_block
    from
    subjects a
    left join base.core.fact_transactions b on a.subject = b.from_address
    where
    to_address = '0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4'
    group by
    1
    ),
    base_table as (
    select
    c.tx_hash,
    c.block_timestamp,
    c.block_number,
    c.trader,
    c.subject,
    c.ethamount,
    sum(c.shareamount) as shareamount,
    (
    cast(d.gas_price as double) * cast(d.gas_used as double) + l1_fee
    ) / 1e18 as gas_fee_paid
    from
    (
    select
    QueryRunArchived: QueryRun has been archived