adriaparcerisasstable jack protocol 2
    Updated 2025-03-17
    with prices as (
    select trunc(hour,'day') as day,
    symbol,
    token_address,
    decimals,
    avg(price) as price_usd
    from avalanche.price.ez_prices_hourly
    group by 1,2,3,4
    ),

    mints as (
    SELECT
    block_timestamp,
    tx_hash,
    decoded_log:_tokenIn as token_address,
    decoded_log:_amountIn as amount,
    origin_from_address as wallet
    from avalanche.core.ez_decoded_event_logs
    where origin_to_address = '0x8a63943ac3f394ed73c7b06fecf3a81bc11b840e'
    and event_name = 'YakSwap'
    and origin_function_signature = '0xb4d50fcf'
    ),

    redeems as (
    SELECT
    block_timestamp,
    tx_hash,
    decoded_log:_tokenIn as token_address,
    decoded_log:_amountIn as amount,
    origin_from_address as wallet
    from avalanche.core.ez_decoded_event_logs
    where origin_to_address = '0x8a63943ac3f394ed73c7b06fecf3a81bc11b840e'
    and event_name = 'YakSwap'
    and origin_function_signature = '0x4a99dcf1'
    ),

    QueryRunArchived: QueryRun has been archived