Avax AmbassadorsStruct Protocol Overview
    Updated 2025-03-30
    -- forked from Protocol Overview @ https://flipsidecrypto.xyz/edit/queries/b3804391-8ff3-497d-8565-6a10be03eafd

    with
    -------------------- Vaults --------------------
    vaults as (
    select
    block_timestamp,
    tx_hash,
    'GMX' as platform,
    decoded_log:productAddress as vault_address,
    decoded_log:fixedRate / pow(10, 4) as apr,
    to_timestamp(decoded_log:startTimeDeposit) as deposit_start_time,
    to_timestamp(decoded_log:startTimeTranche) as tranche_start_time,
    to_timestamp(decoded_log:endTimeTranche) as tranche_end_time
    from
    avalanche.core.ez_decoded_event_logs
    where
    tx_status = 'SUCCESS'
    and block_timestamp::date >= '2023-06-01'
    and event_name = 'ProductCreated'
    and contract_address = '0x46f8765781ac36e5e8f9937658fa311af9d735d7'
    and origin_to_address = '0x46f8765781ac36e5e8f9937658fa311af9d735d7'
    and origin_function_signature = '0x9cf36df8'
    union
    select
    block_timestamp,
    tx_hash,
    'Trader Joe' as platform,
    decoded_log:productAddress as vault_address,
    decoded_log:fixedRate / pow(10, 4) as apr,
    to_timestamp(decoded_log:startTimeDeposit) as deposit_start_time,
    to_timestamp(decoded_log:startTimeTranche) as tranche_start_time,
    to_timestamp(decoded_log:endTimeTranche) as tranche_end_time
    from
    avalanche.core.ez_decoded_event_logs
    where
    QueryRunArchived: QueryRun has been archived