DatarunnerCAP - Pearce C9
    Updated 6 hours ago
    --Pearce C9
    WITH
    tx_list AS (
    SELECT
    TO_VARCHAR(DATE_TRUNC('HOUR', block_timestamp), 'YYYY-MM-DD HH24:MI') AS date,
    --TO_VARCHAR(DATE_TRUNC('DAY', block_timestamp), 'YYYY-MM-DD HH24:MI:SS') AS date,
    inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount AS total_des_frais,
    inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount AS total_hf,
    inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount AS volume_total,
    total_hf + total_des_frais AS montant_total,
    inner_instruction:instructions[0]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx' AS ATLAS,
    inner_instruction:instructions[0]:parsed:info:mint::string = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' AS USDC,
    inner_instruction:instructions[2]:parsed:info:mint::string = '5f1jUARhtSypVA4uTpgpLp76WYGdB2dGr8zMbh4WjYRf' AS Pearce_C9,
    CASE
    WHEN ATLAS THEN (total_hf + total_des_frais) / NULLIF(volume_total, 0)
    END AS prix_unitaire_ATLAS,
    CASE
    WHEN USDC THEN (total_hf + total_des_frais) / NULLIF(volume_total, 0)
    END AS prix_unitaire_USDC,
    CASE
    WHEN ATLAS THEN 'ATLAS'
    WHEN USDC THEN'USDC'
    END AS devise

    FROM
    solana.core.fact_events

    WHERE
    program_id = 'traderDnaR5w6Tcoi3NFm53i48FTDNbGjBSZwWXDRrg'
    AND succeeded = 'true'
    AND block_timestamp >= DATEADD(DAY, -180, CURRENT_TIMESTAMP())
    AND Pearce_C9
    AND devise IN ('USDC', 'ATLAS')
    ),

    final AS (
    Last run: about 6 hours agoAuto-refreshes every 12 hours
    Date
    Volume
    Pearce C9 (ATLAS)
    Pearce C9 (USDC)
    1
    2025-01-17 05:0017950
    2
    2024-11-21 04:0018990
    2
    67B
    7s