Pine Analyticsfight_horse copy copy
    Updated 2025-04-05
    -- forked from fight_horse copy @ https://flipsidecrypto.xyz/studio/queries/599250ef-6654-4f0d-886a-53cd0421ad78

    with tab1 as (
    SELECT
    -- ACCOUNT_KEYS[5] as pool,
    t.*,
    f.value as log_message,
    f.index as log_index
    FROM eclipse.core.fact_transactions t,
    LATERAL FLATTEN(input => LOG_MESSAGES) f
    WHERE log_message LIKE '%InitializeMint2%'
    AND block_timestamp > '2024-11-10'
    and log_messages[0] like 'Program 7X3YmPcRu4V5GKxeFvC9MQq4bemCdR5MWea5tVs62bM9 invoke [1]'
    and SUCCEEDED
    and not signers[0] like '2SpeaLUs5SUBauC3xDwDyArz28buhi44QP4RBQq3Gn4E'
    ), tab2 as (
    SELECT
    token_account,
    mint
    FROM eclipse.defi.fact_token_mint_actions
    where tx_id in (SELECT tx_id from tab1)
    AND block_timestamp > '2024-11-10'
    AND not token_account is NULL
    ), tab3 as (
    SELECT
    DISTINCT tx_id
    FROM eclipse.core.fact_transfers
    where (SOURCE_TOKEN_ACCOUNT in (SELECT token_account from tab2)
    or DEST_TOKEN_ACCOUNT in (SELECT token_account from tab2))
    AND block_timestamp > '2024-11-10'
    )


    SELECT
    count(*) as swaps,
    Last run: 20 days ago
    SWAPS
    SWAPPERS
    VOLUME_ETH
    VOLUME_USD
    1
    7008923658713.3375456842058981.35557318
    1
    46B
    524s