> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testnet.dev.adipredictstreet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Window-aggregate cross-check (counts, volumes, fees, fingerprint)

> Returns aggregate totals over `[from, to)` plus a deterministic `fingerprint` (`sha256` of comma-joined sorted trade ids). Compute the same locally; if `tradeCount` AND `fingerprint.value` match, your warehouse is window-complete. Window length is capped at 24 hours — paginate by hour or day for longer audits. Past windows are cached for 1 hour, live windows for 60 seconds.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/partner/reconciliation/snapshot
openapi: 3.1.0
info:
  title: PredictStreet API
  description: >-
    Client-facing HTTP API for the PredictStreet prediction-market platform.
    **Partner kinds.** Every authenticated endpoint resolves a request's
    *effective wallet* from the partner row. `single_wallet` partners bind to
    one `associatedWallet` set at creation. `multi_wallet` partners declare the
    actor on every request via an `X-User-Wallet: 0x<40-hex>` header. See the
    [Partner kinds](/auth/api-keys#partner-kinds) doc for the full contract.
  version: '2026-06-16'
  contact:
    name: PredictStreet partners
    email: partners@predictstreet.com
servers:
  - url: https://core.api.dev.predictstreet.sde.adifoundation.ai
    description: Testnet (partner integrator API — final domain TBD)
security: []
tags:
  - name: Deposits
    description: >-
      Gasless USDC deposit relay - submit a signed EIP-2612 permit and the
      platform broadcasts the on-chain deposit for you (no gas).
  - name: Events
    description: >-
      Polymarket-style event grouping with football metadata (group, stage,
      teams, tags).
  - name: Tags
    description: Curated tag taxonomy used to filter events.
  - name: Markets
    description: 'Public market data: list, detail, orderbook, trades, OHLC.'
  - name: Crypto
    description: >-
      Crypto price markets: the underlying-asset price curve and Up/Down series
      navigation. The markets themselves are ordinary binary markets — list them
      through /api/markets and /api/events.
  - name: Orders
    description: >-
      Signed-order place / cancel / read. Requires `X-Api-Key` with
      `orders:read` / `orders:write` scope; every write additionally requires an
      EIP-712 signature over the order.
  - name: Portfolio
    description: >-
      Balances, positions, trades, fees, vault info for the key's
      `associatedWallet`. Requires `X-Api-Key` with `portfolio:read` scope.
  - name: Matches
    description: >-
      A match groups several events into one fixture/card (1X2 + first-scorer +
      over-under under one matchup).
  - name: Vault
    description: >-
      Backend co-signatures for ERC-1155 split / merge, and recovery for
      off-chain locks when the corresponding chain tx never confirmed. Requires
      `X-Api-Key` with `vault:write` scope plus an EIP-712 signature over the
      operation.
  - name: Leaderboard
    description: Public ranked leaderboard across PnL / volume buckets.
  - name: Search
    description: Global search across users, events, and matches.
  - name: Withdrawal Security
    description: >-
      Self-service withdrawal 2FA (TOTP) and withdrawal-address whitelist. Same
      endpoints serve the web app (user sessions) and API-key integrators.
      Mutations need `vault:write`, reads `portfolio:read`. Both are opt-in per
      wallet and only gate withdrawals once the platform enables
      withdrawal-security enforcement.
  - name: Platform
    description: >-
      Public platform state: the contract registry, the platform fee
      configuration, the platform freeze flag and active notices. No
      authentication.
paths:
  /api/v1/partner/reconciliation/snapshot:
    get:
      tags:
        - partner
      summary: Window-aggregate cross-check (counts, volumes, fees, fingerprint)
      description: >-
        Returns aggregate totals over `[from, to)` plus a deterministic
        `fingerprint` (`sha256` of comma-joined sorted trade ids). Compute the
        same locally; if `tradeCount` AND `fingerprint.value` match, your
        warehouse is window-complete. Window length is capped at 24 hours —
        paginate by hour or day for longer audits. Past windows are cached for 1
        hour, live windows for 60 seconds.
      operationId: PartnerReconciliationController_snapshot
      parameters:
        - name: from
          required: true
          in: query
          description: >-
            ISO-8601 inclusive lower bound. Compared against trade `modifiedAt`
            = `GREATEST(createdAt, settledAt)` — same expression the
            `/partner/trades` feed's `?modifiedSince=` filter uses. This is a
            deliberate alignment: a partner's local trade set (built by pulling
            `?modifiedSince=`) and the server-side recon aggregate describe the
            EXACT same set of trades over the same window. Partners reconciling
            MUST compute their local fingerprint over trades whose CURRENT
            `modifiedAt` falls in `[from, to)` (i.e. use the latest copy of each
            trade in their warehouse).
          schema:
            example: '2026-05-09T00:00:00Z'
            type: string
        - name: to
          required: true
          in: query
          description: >-
            ISO-8601 exclusive upper bound. Window length capped at 24 hours —
            partners must paginate by hour/day for longer audits. Comparison is
            on `modifiedAt`; see `from` for the full alignment rationale.
          schema:
            example: '2026-05-10T00:00:00Z'
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerReconSnapshotRespDto'
      security:
        - ApiKey:
            - partner:trades:read
components:
  schemas:
    PartnerReconSnapshotRespDto:
      type: object
      properties:
        window:
          type: object
          properties:
            from:
              type: string
            to:
              type: string
          required:
            - from
            - to
        totals:
          $ref: '#/components/schemas/PartnerReconTotalsDto'
        fingerprint:
          $ref: '#/components/schemas/PartnerReconFingerprintDto'
        computedAt:
          type: string
          description: >-
            Server-side `Date.now()` at which this snapshot was computed. Live
            windows (where `to` > computedAt) recompute on every call (60s
            cache); past windows cache for 1 hour.
      required:
        - window
        - totals
        - fingerprint
        - computedAt
    PartnerReconTotalsDto:
      type: object
      properties:
        tradeCount:
          type: number
          description: >-
            Total trades in window (status ∈ matched / settlement_pending /
            settled / settlement_failed). Stable across settlement updates.
        totalQuantity:
          type: string
          description: Sum of trade quantities (decimal string, outcome-token units).
        totalUsdcVolume:
          type: string
          description: >-
            Sum of `price × quantity` across the window — notional volume in
            USDC (decimal string).
        totalTakerFeesUsdc:
          type: string
          description: >-
            Sum of TAKER-leg fees collected in USDC across the window. This is
            half the picture — see `totalMakerFeesUsdc`; the treasury wallet
            USDC delta reconciles against the SUM of the two.
        totalTakerFeesOutcomeTokens:
          description: >-
            Per-token-id sums of TAKER-leg fees collected in OUTCOME_TOKENS.
            Empty array when no BUY-taker fills landed in the window.
          type: array
          items:
            $ref: '#/components/schemas/PartnerReconOutcomeFeeDto'
        totalMakerFeesUsdc:
          type: string
          description: >-
            Sum of MAKER-leg fees collected in USDC across the window. Both legs
            are charged — each order pays its own signed rate.
        totalMakerFeesOutcomeTokens:
          description: >-
            Per-token-id sums of MAKER-leg fees collected in OUTCOME_TOKENS.
            Empty array when no maker leg in the window was charged in tokens.
          type: array
          items:
            $ref: '#/components/schemas/PartnerReconOutcomeFeeDto'
      required:
        - tradeCount
        - totalQuantity
        - totalUsdcVolume
        - totalTakerFeesUsdc
        - totalTakerFeesOutcomeTokens
        - totalMakerFeesUsdc
        - totalMakerFeesOutcomeTokens
    PartnerReconFingerprintDto:
      type: object
      properties:
        algorithm:
          type: string
          enum:
            - sha256-csv-trade-ids
          description: >-
            Hashing algorithm. `sha256-csv-trade-ids` = `sha256(trade_ids sorted
            **lexicographically ascending as decimal strings**, joined by
            ",")`. 


            **Critical**: sort is on `id` AS A STRING, not as an integer. `["1",
            "10", "2"]`, NOT `["1", "2", "10"]`. Mainstream languages default to
            lex-sort on string arrays (`sorted(['1','10','2'])` in Python,
            `Array.sort()` in JS, Go's `sort.Strings`), so the natural
            reproduction matches:

            ```

            import hashlib

            ids = sorted(str(t.id) for t in trades)   # lex sort, NOT int sort

            fp  = hashlib.sha256(",".join(ids).encode()).hexdigest()

            assert fp == server_response.fingerprint.value

            ```


            If you `sorted(int_ids)` first and then stringify, the hash will
            silently differ on any window containing a multi-digit id next to a
            single-digit one (e.g. ids 9 and 10). Use string-sort.
        value:
          type: string
          description: >-
            64-char hex digest. `sha256("")` (the empty-window canonical) is
            `e3b0c44…` — emit verbatim instead of NULL on empty windows so
            partners can hash-compare without null-checks.
      required:
        - algorithm
        - value
    PartnerReconOutcomeFeeDto:
      type: object
      properties:
        tokenId:
          type: string
          description: ERC-1155 token id (decimal string).
        amount:
          type: string
          description: >-
            Sum of fees collected in this token across all trades in the window
            (decimal string, base-1 outcome-token units).
      required:
        - tokenId
        - amount
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Partner / integrator key — format `ps_live_<keyId>_<secret>`. Partner
        keys are issued by PredictStreet; a user can also create keys bound to
        their own wallet from their account settings in the web app. Never ship
        to a browser. `multi_wallet` partners must additionally send
        `X-User-Wallet: 0x<40-hex>` on every authenticated request to declare
        the acting wallet. See the [API keys guide](/auth/api-keys) for scope
        taxonomy, partner kinds, rate limits, and rotation procedure.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.