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

# Get realized return per trading day

> Returns the realized return and trade count for each day of a range, grouped into whole Sunday-to-Saturday weeks. Days are market days in America/New_York, and every day in the range is present whether or not it traded. Returns are realized only: a position is counted on the day it is closed, against the average cost of what opened it, so opening a position reports a trade with no return against it. Broker fees and commissions are not included. Omitting `account_id` reports every account the organization has in `environment`, summed across per-account books rather than pooled, so one account's sale never closes another's position. At most 12 weeks are returned per request; use `next_cursor` for anything longer.



## OpenAPI

````yaml /api-reference/ledger.openapi.json get /v1/orders/daily-returns
openapi: 3.1.0
info:
  title: ledger
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Ledger
    description: Read current orders, order history, and order activity
  - name: Ledger
    description: Read current positions and position history
  - name: Ledger
    description: Read platform-wide execution metrics
  - name: Ledger
    description: >-
      Read ledger-wide reference data, such as the symbols an organization has
      traded
  - name: Ledger
    description: >-
      Read completed intents. Live ones are served by the intents service at
      /v1/intents; this is the six year record of finished ones
paths:
  /v1/orders/daily-returns:
    get:
      tags:
        - Ledger
      summary: Get realized return per trading day
      description: >-
        Returns the realized return and trade count for each day of a range,
        grouped into whole Sunday-to-Saturday weeks. Days are market days in
        America/New_York, and every day in the range is present whether or not
        it traded. Returns are realized only: a position is counted on the day
        it is closed, against the average cost of what opened it, so opening a
        position reports a trade with no return against it. Broker fees and
        commissions are not included. Omitting `account_id` reports every
        account the organization has in `environment`, summed across per-account
        books rather than pooled, so one account's sale never closes another's
        position. At most 12 weeks are returned per request; use `next_cursor`
        for anything longer.
      operationId: getDailyReturns
      parameters:
        - name: account_id
          in: query
          description: >-
            Trading account ID. Omit to report every account the organization
            has in `environment`
          required: false
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        - name: environment
          in: query
          description: >-
            Required. Which environment the read covers. Resolved to the
            organization's accounts in that environment, including disabled and
            deleted ones, since the ledger stores no environment of its own.
            Rejected with 400 when it disagrees with the account named alongside
            it.
          required: true
          schema:
            $ref: '#/components/schemas/BrokerEnvironment'
          example: paper
        - name: start
          in: query
          description: >-
            Range start, raised to the window the caller's plan grants and then
            widened back to the Sunday of the week containing it, so the oldest
            week reported can begin inside that window. Defaults to the start of
            the week `end` falls in
          required: false
          schema:
            type: string
            format: date-time
          example: '2026-08-09T00:00:00Z'
        - name: end
          in: query
          description: >-
            Range end, widened forward to the Saturday of the week containing
            it. Defaults to now, so sending neither bound returns the current
            week
          required: false
          schema:
            type: string
            format: date-time
          example: '2026-08-15T23:59:59Z'
        - name: next_cursor
          in: query
          description: >-
            Start of the next page as `YYYY-MM-DD`, taken from a previous
            response. Overrides `start`
          required: false
          schema:
            type: string
          example: '2026-11-01'
      responses:
        '200':
          description: Daily returns retrieved
          headers:
            anthid-retention-days:
              schema:
                type: integer
                format: int64
              description: >-
                Trailing window, in days, that this answer was produced under.
                Comes from the caller's plan, so a value shorter than the range
                requested means the range was narrowed to it. Absent for
                internal service callers, who have no window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DailyReturnsResponse'
              example:
                data:
                  - days:
                      - date: '2026-08-09'
                        net_return: '0.0'
                        trade_count: 0
                      - date: '2026-08-10'
                        net_return: '0.0'
                        trade_count: 1
                      - date: '2026-08-11'
                        net_return: '500.0'
                        trade_count: 1
                      - date: '2026-08-12'
                        net_return: '-125.5'
                        trade_count: 3
                      - date: '2026-08-13'
                        net_return: '0.0'
                        trade_count: 0
                      - date: '2026-08-14'
                        net_return: '212.25'
                        trade_count: 2
                      - date: '2026-08-15'
                        net_return: '0.0'
                        trade_count: 0
                    net_return: '586.75'
                    trade_count: 7
                    week_start: '2026-08-09'
                next_cursor: null
        '400':
          description: >-
            Query parameters are invalid, including a backwards range or a
            malformed cursor
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: >-
            Missing or invalid authentication credentials or organization
            context
          content:
            text/plain:
              schema:
                type: string
        '403':
          description: >-
            Caller lacks intent read access, organization access, or ownership
            of the requested trading account
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: Caller exceeded the request rate limit
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Unexpected server error while reading daily returns
          content:
            text/plain:
              schema:
                type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    BrokerEnvironment:
      type: string
      enum:
        - paper
        - live
    DailyReturnsResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WeekReturns'
          description: Whole weeks, oldest first.
        next_cursor:
          type:
            - string
            - 'null'
          description: >-
            The Sunday the next page starts at, as `YYYY-MM-DD`, or `null` once
            the

            requested range is exhausted. Pass it back as `next_cursor`.


            Unlike the keyset cursors on the list endpoints this is a plain
            date:

            it is a week boundary the caller can already work out, so there is

            nothing to be gained by making it opaque.
    WeekReturns:
      type: object
      description: >-
        One Sunday-to-Saturday week.


        Always seven days, in order, including days the market was shut. The

        calendar this feeds draws a fixed grid, and a week that omitted its
        quiet

        days would shift every later day into the wrong column.


        Returns are realized only: a position is counted on the day it is
        closed,

        against the average cost of what opened it. Opening a position realizes

        nothing, so a week spent building one reads as a trade count with no
        return

        against it. Fees and commissions are not included, because the broker
        does

        not report them on the order records this is derived from.
      required:
        - week_start
        - days
        - net_return
        - trade_count
      properties:
        days:
          type: array
          items:
            $ref: '#/components/schemas/DailyReturn'
          description: Seven days, Sunday first.
        net_return:
          $ref: '#/components/schemas/Price'
          description: Sum of the seven days' returns.
        trade_count:
          type: integer
          format: int64
          description: Sum of the seven days' trade counts.
          minimum: 0
        week_start:
          type: string
          format: date
          description: The Sunday this week starts on.
    DailyReturn:
      type: object
      description: >-
        What one trading day realized.


        `net_return` is a nominal dollar amount, not a percentage, and counts
        only

        positions actually closed on this day. See [`WeekReturns`] for what that

        excludes. `trade_count` is every order that filled on the day, including
        the

        ones that opened a position and so realized nothing.
      required:
        - date
        - net_return
        - trade_count
      properties:
        date:
          type: string
          format: date
          description: The trading day, in the market's timezone.
        net_return:
          $ref: '#/components/schemas/Price'
          description: >-
            Realized return for the day. Negative for a loss, zero for a day
            that

            closed nothing.
        trade_count:
          type: integer
          format: int64
          description: Orders that filled on this day.
          minimum: 0
    Price:
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````