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

# Read firm account analytics

> One consistent snapshot of an account issued by the authenticated firm. Trading P&L is average-cost realized fill P&L minus all fill fees, excluding balance operations. Current cycle only; resets delete prior fills. Equity history contains up to 1000 forward minute samples, newest first, with null for unavailable valuations. Source walks are capped at 50000 rows; any cap marks trading incomplete. Never infer zero from unavailable data. See the firm analytics guide for coverage and session semantics.



## OpenAPI

````yaml /partner-platform/openapi.json get /api/partner/accounts/analytics
openapi: 3.1.0
info:
  title: trdrs Engine API
  version: 1.1.0
  description: >-
    ## API Reference


    This is the served OpenAPI contract for the trdrs engine: market data,
    trading and account

    routes for your firm's traders, trdrs Connect account-registration handoff,
    and preview

    challenge routes.


    See Quick Start for the first integration path: key setup, market config,
    chart data, Connect

    account registrations, idempotency, stream reconnects, and conformance.


    See Overview and API Standards for the cross-cutting contract rules.
servers:
  - url: https://app.trdrs.co
    description: Production
  - url: /
    description: This engine
security: []
tags:
  - name: Market data
    description: >-
      Symbol search and resolution, OHLCV history, quote snapshots, the server
      clock, and the live bar stream. Crypto rides each venue’s public feed;
      futures stream from the caller’s own connected Rithmic account. With none
      connected, futures requests answer 503 `feed_requires_connection`.
  - name: News
    description: >-
      Aggregated market news and the economic calendar, from licensed/open
      sources, keyword-tagged with futures roots at ingest. Platform-wide
      content (nothing per-user), admitted exactly like Market data: a licensed
      origin, a session, or a firm API key. Headlines page by published time,
      scope by instrument root, and stream live over SSE; thumbnails serve
      through the image proxy.
  - name: Trading
    description: >-
      The money surface: entries, exits, replaces, cancels, and position/account
      flattening. Every order-placing call uses `clientOrderId` as its
      idempotency key.
  - name: Account
    description: >-
      Reading a connected account. You do not create trading accounts here: a
      trader connects their own broker account (or creates a free demo account)
      in the app, and firms create evaluation accounts through the Partner API
      (Firm accounts → Create evaluation accounts) or register venue accounts
      through Connect (Create an account registration). Account state and the
      durable ledgers: balances, positions, working orders, fills, P&L history,
      and the live account stream.
  - name: Connect
    description: >-
      trdrs Connect account registration, for partner firms. Register an account
      you issued on your own venue — a pending account registration — with the
      trader’s sign-in email, optionally the venue account id and the login name
      your venue issued. The trader finds it waiting in the connect flow the
      moment they sign in with that email: the connect step is pre-filled with
      everything except the credential, which the trader always enters
      themselves. A registration never transmits a password and never grants
      access to anything before the trader’s own login succeeds. These routes
      answer a partner-scoped key only; a firm API key or a user session gets
      401. Registrations expire after 30 days; re-registering the same email +
      account refreshes the expiry instead of duplicating. The end-to-end flow
      guide is **[Quick Start](/docs/guides/quick-start)**.
  - name: Firm accounts
    description: >-
      Evaluation accounts your firm issues on the trdrs venue, through your
      partner key — the other half of account setup. Connect registrations hand
      off accounts that exist on your venue; these routes create and manage
      accounts on ours: the trader trades them on trdrs, and your firm owns the
      lifecycle. Every route is scoped to accounts your firm created through
      this API — an account the same trader opened themselves is invisible and
      untouchable here, by construction. Creation is batched with per-item
      results, and every write carries your own `referenceId`, so a crashed
      pipeline retries safely. Served when the deployment runs the prop engine;
      without it, every route in this group answers `404`.
  - name: Webhooks
    description: >-
      The outbound event bus: register an https endpoint and the platform pushes
      events to it instead of your back office polling us. Every delivery is
      signed (`trdrs-signature: t=<unix>,v1=<hmac-sha256>` over
      `${t}.${rawBody}`) so you can prove it came from us and is fresh, and
      every delivery is durable — a failed attempt is retried with backoff for
      about nine hours and the whole log is readable, so an endpoint that was
      down is a delay rather than a lost event. Serves brokers and prop firms
      alike: the account-registration (`registration.*`) events fire wherever
      Connect does, and the account events fire where the prop engine runs.
  - name: Challenges
    description: >-
      The prop evaluation surface: challenge programs and a trader’s own
      enrollments. **Preview: the one group on this page outside the
      additive-only guarantee** (the pre-contract v1 scaffold; the Phase-1
      rebuild will change these shapes; see Stability). **Cookie-authenticated,
      not key-authenticated**, and served only when the engine runs with
      `CHALLENGES_ENABLED`; without that flag the bundle is absent and every
      route below returns `404`. The firm-console/admin half of this surface is
      deliberately not documented here. It is back office, not licensed surface.
paths:
  /api/partner/accounts/analytics:
    get:
      tags:
        - Firm accounts
      summary: Read firm account analytics
      description: >-
        One consistent snapshot of an account issued by the authenticated firm.
        Trading P&L is average-cost realized fill P&L minus all fill fees,
        excluding balance operations. Current cycle only; resets delete prior
        fills. Equity history contains up to 1000 forward minute samples, newest
        first, with null for unavailable valuations. Source walks are capped at
        50000 rows; any cap marks trading incomplete. Never infer zero from
        unavailable data. See the firm analytics guide for coverage and session
        semantics.
      parameters:
        - name: account
          in: query
          required: true
          schema:
            type: string
          description: Account issued by your firm.
        - name: equityBefore
          in: query
          schema:
            type: string
            format: date-time
          description: >-
            For analytics history pagination, use equityHistory.nextBefore to
            retrieve the next older page. Verify cycle.id has not changed.
        - name: timeZone
          in: query
          schema:
            type: string
            default: America/Chicago
          description: >-
            IANA timezone for qualifying fill days. Keep fixed throughout a
            stage.
        - name: rolloverHour
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 23
            default: 17
          description: >-
            Local session roll hour. Midnight uses calendar dates; other rolls
            label the session by its ending date. DST-aware.
      responses:
        '200':
          description: >-
            Snapshot; eligible=false is a successful check with unmet
            conditions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FirmAccountAnalytics'
        '400':
          description: Missing or invalid account/stage/session parameters.
        '401':
          description: Partner-scoped key required.
        '404':
          description: >-
            Account not owned by this firm, absent account, or feature
            unavailable.
        '500':
          description: >-
            Snapshot unavailable. Retry with backoff; never treat an error as
            eligible.
      security:
        - partnerKey: []
      x-codeSamples:
        - lang: javascript
          label: TypeScript
          source: >-
            const res = await
            fetch('https://app.trdrs.co/api/partner/accounts/analytics?account=EVAL-7C21A9',
            {
              headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
            })

            const data = await res.json()
        - lang: shell
          label: cURL
          source: >-
            curl
            'https://app.trdrs.co/api/partner/accounts/analytics?account=EVAL-7C21A9'
            \
              -H "Authorization: Bearer $TRDRS_API_KEY"
components:
  schemas:
    FirmAccountAnalytics:
      type: object
      properties:
        accountNumber:
          type: string
        currency:
          type: string
        asOf:
          type: string
          format: date-time
        snapshotId:
          type: string
        status:
          type: string
        cycle:
          type: object
          properties:
            id:
              type: string
            startedAt:
              type: string
              format: date-time
            resetAt:
              type:
                - string
                - 'null'
            priorTradingHistoryAvailable:
              type: boolean
            resetBoundaries:
              type: array
              items:
                type: object
                properties:
                  startedAt:
                    type: string
                    format: date-time
                  endedAt:
                    type: string
                    format: date-time
                required:
                  - startedAt
                  - endedAt
          required:
            - id
            - startedAt
            - resetAt
            - priorTradingHistoryAvailable
            - resetBoundaries
        pnl:
          type: object
          properties:
            grossRealized:
              type: number
            fees:
              type: number
            netTrading:
              type: number
            balanceAdjustments:
              type: number
            balance:
              type: number
            unrealized:
              type:
                - number
                - 'null'
            equity:
              type:
                - number
                - 'null'
          required:
            - grossRealized
            - fees
            - netTrading
            - balanceAdjustments
            - balance
            - unrealized
            - equity
        tradingDays:
          type: object
          properties:
            count:
              type: integer
            session:
              type: object
              properties:
                timeZone:
                  type: string
                rolloverHour:
                  type: integer
                  minimum: 0
                  maximum: 23
                qualifyingActivity:
                  type: string
                label:
                  type: string
                weekendsExcluded:
                  type: boolean
              required:
                - timeZone
                - rolloverHour
                - qualifyingActivity
                - label
                - weekendsExcluded
            days:
              type: array
              items:
                type: object
                properties:
                  day:
                    type: string
                  fills:
                    type: integer
                required:
                  - day
                  - fills
          required:
            - count
            - session
            - days
        closedTrades:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              instrument:
                type: string
              direction:
                type: string
              quantity:
                type: number
              entryPrice:
                type: number
              exitPrice:
                type: number
              openedAt:
                type: string
                format: date-time
              closedAt:
                type: string
                format: date-time
              grossPnl:
                type: number
              fees:
                type: number
              netPnl:
                type: number
            required:
              - id
              - instrument
              - direction
              - quantity
              - entryPrice
              - exitPrice
              - openedAt
              - closedAt
              - grossPnl
              - fees
              - netPnl
        openPositions:
          type: array
          items:
            type: object
            properties:
              instrument:
                type: string
              quantity:
                type: number
              averagePrice:
                type: number
              unrealizedPnl:
                type:
                  - number
                  - 'null'
            required:
              - instrument
              - quantity
              - averagePrice
              - unrealizedPnl
        openOrders:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              clientOrderId:
                type:
                  - string
                  - 'null'
              instrument:
                type: string
              side:
                type: string
              quantity:
                type: number
              orderType:
                type: string
              limitPrice:
                type:
                  - number
                  - 'null'
              stopPrice:
                type:
                  - number
                  - 'null'
              reduceOnly:
                type: boolean
            required:
              - id
              - clientOrderId
              - instrument
              - side
              - quantity
              - orderType
              - limitPrice
              - stopPrice
              - reduceOnly
        equityHistory:
          type: object
          properties:
            basis:
              type: string
            intervalSeconds:
              type: number
            continuous:
              type: boolean
            points:
              type: array
              items:
                type: object
                properties:
                  at:
                    type: string
                    format: date-time
                  balance:
                    type: number
                  equity:
                    type:
                      - number
                      - 'null'
                required:
                  - at
                  - balance
                  - equity
            limit:
              type: number
            mayHaveOlderSamples:
              type: boolean
            nextBefore:
              type:
                - string
                - 'null'
          required:
            - basis
            - intervalSeconds
            - continuous
            - points
            - limit
            - mayHaveOlderSamples
            - nextBefore
        risk:
          type: object
          properties:
            breaches:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  reason:
                    type: string
                  at:
                    type: string
                    format: date-time
                required:
                  - id
                  - reason
                  - at
            halted:
              type: boolean
            lockReason:
              type:
                - string
                - 'null'
          required:
            - breaches
            - halted
            - lockReason
        completeness:
          type: object
          properties:
            trading:
              type: boolean
            reasons:
              type: array
              items:
                type: string
            risk:
              type: boolean
            riskCoverageStartedAt:
              type: string
              format: date-time
            currentEquity:
              type: boolean
            equityHistory:
              type: string
            unresolvedCommands:
              type: integer
          required:
            - trading
            - reasons
            - risk
            - riskCoverageStartedAt
            - currentEquity
            - equityHistory
            - unresolvedCommands
      required:
        - accountNumber
        - currency
        - asOf
        - snapshotId
        - status
        - cycle
        - pnl
        - tradingDays
        - closedTrades
        - openPositions
        - openOrders
        - equityHistory
        - risk
        - completeness
      example:
        accountNumber: EVAL-7C21A9
        currency: USD
        asOf: '2026-09-12T15:00:00.000Z'
        snapshotId: snapshot-hash
        status: active
        cycle:
          id: cycle-hash
          startedAt: '2026-09-10T00:00:00.000Z'
          resetAt: null
          priorTradingHistoryAvailable: false
          resetBoundaries: []
        pnl:
          grossRealized: 3010
          fees: 10
          netTrading: 3000
          balanceAdjustments: 500
          balance: 53500
          unrealized: 0
          equity: 53500
        tradingDays:
          count: 2
          session:
            timeZone: America/Chicago
            rolloverHour: 17
            qualifyingActivity: any_fill
            label: session_end_date
            weekendsExcluded: false
          days:
            - day: '2026-09-11'
              fills: 2
            - day: '2026-09-12'
              fills: 2
        closedTrades: []
        openPositions: []
        openOrders: []
        equityHistory:
          basis: forward_samples
          intervalSeconds: 60
          continuous: false
          points:
            - at: '2026-09-12T14:59:00.000Z'
              balance: 53500
              equity: 53500
          limit: 1000
          mayHaveOlderSamples: false
          nextBefore: null
        risk:
          breaches: []
          halted: true
          lockReason: firm_halt
        completeness:
          trading: true
          reasons: []
          risk: true
          riskCoverageStartedAt: '2026-09-10T00:00:00.000Z'
          currentEquity: true
          equityHistory: sampled_not_continuous
          unresolvedCommands: 0
  securitySchemes:
    partnerKey:
      type: http
      scheme: bearer
      description: >-
        A partner-scoped API key (`trdrs_sk_…`), issued to a trdrs Connect
        partner firm and accepted only under `/api/partner/`. Same format as the
        firm (`tenant`) key, different scope: a firm API key is refused here,
        and this key is refused everywhere else.

````