> ## 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.

# Trade Flow

> Bounded quote-notional taker flow and cumulative volume delta for a perp.



## OpenAPI

````yaml /proto-openapi/api/openapi.yaml get /api/v1/market/pairs/{tradingPairId}/trade-flow
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://staging.apimonaco.xyz
    description: Staging server (Testnet)
security: []
tags:
  - name: AccountsService
  - name: ApplicationsService
  - name: AuthService
  - name: BuildercodeRewardsService
  - 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: SweeperService
  - name: TraderCodeService
  - name: TradesService
  - name: WhitelistService
  - name: WithdrawalsService
paths:
  /api/v1/market/pairs/{tradingPairId}/trade-flow:
    get:
      tags:
        - MarketService
        - Market
      summary: Trade Flow
      description: >-
        Bounded quote-notional taker flow and cumulative volume delta for a
        perp.
      operationId: get_trade_flow
      parameters:
        - name: tradingPairId
          in: path
          required: true
          schema:
            type: string
            default: 893d2add-2f36-4ee7-b660-893d2add2f36
          example: 893d2add-2f36-4ee7-b660-893d2add2f36
        - name: interval
          in: query
          schema:
            type: string
            enum:
              - 1m
              - 5m
              - 1h
            minLength: 1
          description: UTC-aligned bucket interval
          required: true
        - name: startTime
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 4102444800000
            format: int64
          description: Unix timestamp in milliseconds; range is at most seven days
          required: true
        - name: endTime
          in: query
          schema:
            type: integer
            minimum: 0
            maximum: 4102444800000
            format: int64
          description: Unix timestamp in milliseconds; range is at most seven days
          required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTradeFlowResponse'
        '400':
          description: Invalid or out-of-bounds time range
        '404':
          description: Trading pair not found
        '500':
          description: Internal server error
components:
  schemas:
    GetTradeFlowResponse:
      type: object
      properties:
        tradingPairId:
          type: string
          description: Trading pair UUID
          format: uuid
          nullable: true
        quoteAssetSymbol:
          example: USDC
          type: string
          description: Quote asset used for all notional values, with no USD conversion
          nullable: true
        interval:
          example: 5m
          type: string
          description: UTC-aligned bucket size
          nullable: true
        startTime:
          type: integer
          description: Inclusive selected start time as Unix milliseconds
          format: int64
          minimum: 0
          nullable: true
        endTime:
          type: integer
          description: Exclusive selected end time as Unix milliseconds
          format: int64
          minimum: 0
          nullable: true
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/TradeFlowBucket'
          description: Populated UTC-aligned buckets; intervals without trades are omitted.
          nullable: true
      description: >-
        Taker buy/sell quote notional, net flow and cumulative volume delta for
        a bounded time range. All executed trades, including liquidation and ADL
        fills, are included. Empty buckets are omitted. Buckets that closed more
        than two minutes before the request may be served from a per-replica
        cache for up to ten minutes.
    TradeFlowBucket:
      type: object
      properties:
        bucketStart:
          type: integer
          description: UTC-aligned bucket start as Unix milliseconds
          format: int64
          minimum: 0
          nullable: true
        takerBuyNotional:
          type: string
          description: >-
            Executed quote notional where maker side was SELL, in quote-asset
            units
          nullable: true
        takerSellNotional:
          type: string
          description: >-
            Executed quote notional where maker side was BUY, in quote-asset
            units
          nullable: true
        buySellRatio:
          type: string
          description: >-
            Taker buy notional divided by taker sell notional, rounded to six
            decimal places; null when sell notional is zero
          nullable: true
        netNotional:
          type: string
          description: Taker buy notional minus taker sell notional, in quote-asset units
          nullable: true
        cumulativeVolumeDelta:
          type: string
          description: >-
            Cumulative net notional from the selected range start through this
            bucket, in quote-asset units
          nullable: true
        tradeCount:
          type: integer
          description: Number of executed trades in this bucket
          format: int64
          minimum: 0
          nullable: true

````

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