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

# Protocol totals

> Protocol totals over a window.



## OpenAPI

````yaml /proto-openapi/api/openapi.yaml get /api/v1/analytics/protocol/totals
openapi: 3.0.3
info:
  title: Monaco Protocol API
  description: REST API for the Monaco Protocol hybrid CLOB exchange.
  version: 1.0.0
servers:
  - url: https://apimonaco.xyz
    description: Production (Sei mainnet)
security: []
tags:
  - name: AccountsService
  - name: AnalyticsService
  - name: ApplicationsService
  - name: AuthService
  - name: BuildercodeRewardsService
  - name: ComplianceService
  - name: CopyTradingService
  - name: DelegatedAgentsService
  - name: FaucetService
  - name: FeesService
  - name: HealthService
  - name: ManagedMarketsService
    description: |-
      Wallet-authenticated maker assignments. The signed session must match both
       configured maker user and application. Owner IDs are process fences, never auth.
       Only wallet sessions are supported; delegated-agent sessions receive 403.
  - name: MarginAccountsService
    description: |-
      Current public isolated-margin semantics:
       - a user has one parent margin account per application scope
       - opening orders create or reuse isolated position buckets under that parent
       - parent account creation is handled internally by margin workflows
  - name: MarketService
  - name: OrderbookService
  - name: OrdersService
  - name: PositionsService
    description: |-
      Current public isolated-margin semantics:
       - positions link to a parent margin account and, when applicable, a bucket id
       - opening orders create or reuse isolated position buckets under the parent
       - users can open another isolated position by reusing the parent account with a different market bucket
  - name: PulseService
  - name: RfqService
  - name: SweeperService
  - name: TraderCodeService
  - name: TradesService
  - name: WithdrawalsService
paths:
  /api/v1/analytics/protocol/totals:
    get:
      tags:
        - AnalyticsService
        - Analytics
      summary: Protocol totals
      description: Protocol totals over a window.
      operationId: get_protocol_totals
      parameters:
        - name: window
          in: query
          schema:
            type: string
            default: 24h
            enum:
              - 24h
              - 7d
              - 30d
              - all
              - custom
            minLength: 1
          description: >-
            Window: the last 24 hours, 7 days or 30 days before endTime, all
            time, or custom (startTime to endTime)
        - name: startTime
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 4102444800000
            format: int64
          description: >-
            Custom window start as Unix milliseconds. Required with
            window=custom and rejected otherwise.
        - name: endTime
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 4102444800000
            format: int64
          description: >-
            Window end as Unix milliseconds; defaults to now. Buckets starting
            at or before it count. A window counted in hours (2.5 days or
            shorter) must start within the last 90 days.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetProtocolTotalsResponse'
        '400':
          description: Invalid window
        '429':
          description: Public read rate limit exceeded for this client
        '500':
          description: Internal server error
components:
  schemas:
    GetProtocolTotalsResponse:
      type: object
      properties:
        window:
          allOf:
            - $ref: '#/components/schemas/AnalyticsWindow'
          description: The window these totals cover
          nullable: true
        volumeUsd:
          example: '1250000.5'
          type: string
          description: >-
            Taker volume in USD (USDC 1:1) routed by the builders the explorer
            displays. Trades of hidden builders are not counted.
          nullable: true
        spotVolumeUsd:
          example: '250000.5'
          type: string
          description: The spot part of volumeUsd (displayed builders only)
          nullable: true
        perpVolumeUsd:
          example: '1000000'
          type: string
          description: The perpetual (margin) part of volumeUsd (displayed builders only)
          nullable: true
        tradesCount:
          example: 4210
          type: integer
          description: Trades routed by the displayed builders
          format: int64
          minimum: 0
          nullable: true
        protocolFeesUsd:
          example: '625.25'
          type: string
          description: >-
            Protocol taker fees in USD over every trade, all builders included.
            Excludes builder add-ons and maker fees.
          nullable: true
        activeTakers:
          example: 312
          type: integer
          description: >-
            Distinct taker wallets that traded in the window (each wallet once
            however many buckets it traded in), all builders included
          format: int64
          minimum: 0
          nullable: true
        newTraders:
          example: 27
          type: integer
          description: >-
            Wallets whose first trade on the protocol fell in the window, each
            counted once however many builders it traded through
          format: int64
          minimum: 0
          nullable: true
        tvlUsd:
          example: '536172600'
          type: string
          description: >-
            Total value locked in USD at the end of the window (the end of the
            bucket holding endTime): USDC custody (the opening custody plus
            deposits less initiated withdrawals), valued 1:1. Null when no
            custody had been folded by then.
          nullable: true
        openingTvlUsd:
          example: '535000000'
          type: string
          description: >-
            Total value locked in USD at the start of the window (the start of
            its first bucket). tvlUsd less openingTvlUsd is the window's change.
            Null when no custody had been folded by then.
          nullable: true
        depositsUsd:
          example: '1250000'
          type: string
          description: >-
            USDC deposited in the window, in USD (1:1). Other tokens are
            unvalued and not counted.
          nullable: true
        withdrawalsUsd:
          example: '78000'
          type: string
          description: >-
            USDC withdrawals initiated in the window, in USD (1:1). Other tokens
            are unvalued and not counted.
          nullable: true
        netFlowUsd:
          example: '1172000'
          type: string
          description: >-
            depositsUsd less withdrawalsUsd; negative when more left than
            arrived
          nullable: true
        activeAccounts:
          example: 418
          type: integer
          description: >-
            Distinct wallets active in the window, each once: wallets that took
            a trade, received a deposit, or were paid out a withdrawal initiated
            in it (by payout address), all builders included
          format: int64
          minimum: 0
          nullable: true
        volumeBySource:
          $ref: '#/components/schemas/VolumeUsdBySource'
        newAccounts:
          example: 57
          type: integer
          description: >-
            Accounts registered in the window: every account with an
            application, whether or not it traded, all builders included
            (newTraders counts first trades instead). Every sign-up counts, in
            buckets without trades too; window=all starts where the analytics
            history does.
          format: int64
          minimum: 0
          nullable: true
    AnalyticsWindow:
      type: object
      properties:
        startTime:
          example: 1762041600000
          type: integer
          description: >-
            Window start as Unix milliseconds. Buckets starting at or after it
            count.
          format: int64
          minimum: 0
          nullable: true
        endTime:
          example: 1762128000000
          type: integer
          description: >-
            Window end as Unix milliseconds. Buckets starting at or before it
            count, so the bucket holding it (usually partial) is included.
          format: int64
          minimum: 0
          nullable: true
        granularity:
          example: hour
          enum:
            - hour
            - day
            - week
          type: string
          description: >-
            Bucket size the window is counted in: hour up to 2.5 days, day up to
            45 days, week beyond. UTC; weeks start Monday.
          nullable: true
      description: The window a response covers, as the server resolved it.
    VolumeUsdBySource:
      type: object
      properties:
        orderBookVolumeUsd:
          example: '1180000.5'
          type: string
          description: >-
            The part of volumeUsd filled on the order book: volumeUsd less
            rfqVolumeUsd
          nullable: true
        rfqVolumeUsd:
          example: '70000'
          type: string
          description: The part of volumeUsd filled by RFQ block trades
          nullable: true
      description: >-
        A USD volume split by how it executed (RFQ-17): the order-book part and
        the
         RFQ part add back exactly to the volumeUsd beside it.

````

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