sidlly-ethMoD analyze
    Updated 2024-06-20
    WITH play AS(
    SELECT
    SUM(nt.amount_precise) AS amount,
    SUM(tx.tx_fee_precise) AS fee
    FROM
    blast.core.ez_native_transfers AS nt
    INNER JOIN blast.core.fact_transactions AS tx ON nt.tx_hash = tx.tx_hash
    WHERE
    nt.from_address IN ({{PLAYERS}})
    AND nt.to_address IN (
    LOWER('0x693B37a9859Ce9465Fb2aAdeB03811a26A0c37C0'),
    LOWER('0xA56A95F41e64Bc76CDE7423aB2A2ee1763bD8Bcc')
    )
    ),
    payout AS (
    SELECT
    SUM(nt.amount_precise) AS amount,
    SUM(tx.tx_fee_precise) AS fee
    FROM
    blast.core.ez_native_transfers AS nt
    INNER JOIN blast.core.fact_transactions AS tx ON nt.tx_hash = tx.tx_hash
    WHERE
    nt.to_address IN ({{PLAYERS}})
    AND nt.from_address IN (
    LOWER('0x693B37a9859Ce9465Fb2aAdeB03811a26A0c37C0'),
    LOWER('0xA56A95F41e64Bc76CDE7423aB2A2ee1763bD8Bcc')
    )
    )
    SELECT
    play.amount as play_amount,
    play.fee as enter_fee,
    payout.amount as payout_amount,
    payout.fee as claim_fee,
    (payout_amount - play_amount - enter_fee - claim_fee) as pnl
    FROM
    play,
    QueryRunArchived: QueryRun has been archived