DatarunnerPower Plant T2 UB
    Updated 5 hours ago
    --Power Plant T2 UB
    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 = '8y5KFaXtc84VWE4mMi8bNU5u8wHD9SjU4VMaZ8xCCw2r' AS Power_Plant_T2_UB,
    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 Power_Plant_T2_UB
    AND devise IN ('USDC', 'ATLAS')
    ),

    final AS (
    Last run: about 5 hours agoAuto-refreshes every 12 hours
    Date
    Volume
    Power Plant T2 UB (ATLAS)
    Power Plant T2 UB (USDC)
    1
    2025-03-07 22:00129.99
    2
    2025-01-05 22:00149.98
    3
    2024-12-30 06:00137.99
    4
    2024-12-21 21:00434.99
    5
    2024-11-10 21:00135
    5
    168B
    4s