HitmonleeCryptoBest ALL JUP Perps So Far
    Updated 2024-08-14
    /* select *
    from solana.core.fact_events
    where
    -- instructions:programId = 'PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu'
    tx_id = '58G2GgtVYS2hcSG2kivwNVFx4cmHAX2bboG2LedjNkaxV4m74jmo7GR1DaaApwsNNEL3FzNgxYq1kVBwpombydGo'
    -- OR tx_id = '5tDyCF2qdUTwWWKzmmLftVQmmQ4FUzhSj7sVa1ZmS7NH4ty845Z7tYbZ8ZAN42PKyk977EEPY4RjC7TxjNfDBdjW'
    */
    SELECT
    DISTINCT t.block_timestamp,
    t.succeeded,
    CASE
    WHEN tr.log_messages[3] ILIKE '%increase%' THEN 'increase position'
    WHEN tr.log_messages[5] ILIKE '%increase%' THEN 'increase position'
    WHEN tr.log_messages[3] ILIKE '%decrease%' THEN 'decrease position'
    WHEN tr.log_messages[5] ILIKE '%decrease%' THEN 'decrease position'
    ELSE NULL
    END AS trade_status,
    e.tx_to,
    e.tx_from,
    e.amount,
    t.instruction,
    -- t.inner_instruction,
    --tr.instructions,
    -- tr.inner_instructions,
    tr.log_messages,
    -- t.event_type,
    t.program_id,
    -- e.swapper,
    --e.swap_from_amount_usd,
    --e.swap_to_amount_usd,
    -- t.fact_events_id,
    t.tx_id
    FROM
    solana.core.fact_events t
    QueryRunArchived: QueryRun has been archived