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

# Get recent trades

> Get recent trades for a symbol from the database.

**Weight**: 1




## OpenAPI

````yaml /kuru-exchange/openapi.yaml get /api/v3/trades
openapi: 3.0.3
info:
  title: Kuru Exchange WebSocket Server API
  description: >
    # Introduction


    The Kuru Exchange WebSocket Server provides REST and WebSocket APIs for
    streaming Kuru Exchange's orderbook data.


    ## Key Features


    - **Four-State Orderbook Model**: Reflects Monad's BFT consensus pipeline
    (Proposed, Voted, Finalized, Committed)

    - **High Performance**: Low latency orderbook updates directly consuming
    from Monad's event ring.

    - **Real-Time Streaming**: WebSocket subscriptions with efficient broadcast


    ## Monad Consensus States


    | State | Description | Use Case |

    |-------|-------------|----------|

    | **Proposed** | Block execution started, speculative | Lowest latency,
    highest risk |

    | **Voted** | Block received quorum certificate | Early confirmation |

    | **Finalized** | Block finalized (reorg-proof) | Safe for most applications
    |

    | **Committed** | State root verified | Maximum safety |


    ## Base URLs


    - **REST API**: `https://exchange.kuru.io`

    - **WebSocket**: `wss://exchange.kuru.io/ws`


    ## WebSocket Streams


    Connect to `wss://exchange.kuru.io` and send JSON messages to
    subscribe/unsubscribe.


    ### Subscription Format


    ```json

    {
      "method": "SUBSCRIBE",
      "params": ["mon_usdc@depth", "ethusdc@trade"],
      "id": 1
    }

    ```


    ### Available Stream Types


    | Stream | Description | Example |

    |--------|-------------|---------|

    | `<symbol>@depth` | Full orderbook updates (committed state) |
    `mon_usdc@depth` |

    | `<symbol>@depth5` | Top 5 levels | `mon_usdc@depth5` |

    | `<symbol>@depth10` | Top 10 levels | `mon_usdc@depth10` |

    | `<symbol>@depth20` | Top 20 levels | `mon_usdc@depth20` |

    | `<symbol>@depth@<state>` | Specific state orderbook |
    `mon_usdc@depth@proposed` |

    | `<symbol>@monadDepth` | All states in one message | `mon_usdc@monadDepth`
    |

    | `<symbol>@trade` | Trade stream | `mon_usdc@trade` |


    ### State Values


    - `proposed` - Block execution started

    - `voted` - Block received QC

    - `finalized` - Block finalized (reorg-proof)

    - `committed` - State root verified


    ## Rate Limits


    ### REST API


    The REST API uses a **token bucket** algorithm per IP address.


    | Parameter | Value | Description |

    |-----------|-------|-------------|

    | Refill rate | 1200 req/min (20 req/sec) | Tokens added continuously |

    | Burst capacity | 100 tokens | Max tokens in the bucket — allows short
    bursts |

    | Tracking | Per IP address | Each IP has its own independent bucket |


    Each request consumes a **weight** from the bucket. Heavier endpoints
    consume more tokens:


    | Endpoint | Weight |

    |----------|--------|

    | `GET /health` | 1 |

    | `GET /api/v3/trades` | 1 |

    | `GET /api/v3/ticker/24hr` | 1 |

    | `GET /api/v3/exchangeInfo` | 10 |

    | `GET /api/v3/klines` (limit ≤ 100) | 1 |

    | `GET /api/v3/klines` (limit 101–500) | 2 |

    | `GET /api/v3/klines` (limit > 500) | 5 |

    | `GET /api/v3/depth` (limit ≤ 100) | 1 |

    | `GET /api/v3/depth` (limit 101–500) | 5 |

    | `GET /api/v3/depth` (limit 501–1000) | 10 |

    | `GET /api/v3/depth` (limit > 1000) | 20 |


    When the bucket is empty the server returns **HTTP 429**. The response
    includes a `Retry-After` header indicating how many seconds until the next
    token is available.


    ### WebSocket


    | Limit | Value | Description |

    |-------|-------|-------------|

    | Connections per IP | 5 | Max concurrent WebSocket connections from a
    single IP |

    | Subscriptions per connection | 1024 | Max active stream subscriptions on
    one connection |

    | Broadcast buffer | 32,768 messages | Per-channel internal queue before
    backpressure |


    Connections that exceed the per-IP limit are rejected at the TCP accept
    stage. Subscription requests that exceed the per-connection limit are
    silently ignored — subscribe to fewer streams or open a new connection.
  version: 1.0.0
  contact:
    name: Kuru Exchange
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://exchange.kuru.io
    description: Exchange server
security: []
tags:
  - name: Market Data
    description: Market data endpoints (orderbook, trades, tickers)
  - name: User Data
    description: User-specific order and trade event endpoints
  - name: Exchange Info
    description: Exchange metadata and market information
  - name: Health
    description: Health and status endpoints
paths:
  /api/v3/trades:
    get:
      tags:
        - Market Data
      summary: Get recent trades
      description: |
        Get recent trades for a symbol from the database.

        **Weight**: 1
      operationId: getTrades
      parameters:
        - name: symbol
          in: query
          description: Trading pair symbol
          required: true
          schema:
            type: string
            example: MON_USDC
        - name: limit
          in: query
          description: Number of trades to return (default 500, max 1000)
          required: false
          schema:
            type: integer
            default: 500
            minimum: 1
            maximum: 1000
            example: 500
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trade'
              example:
                - id: 123456
                  price: '100.50'
                  qty: '10.5'
                  time: 1699999999000
                  isBuyerMaker: true
                - id: 123457
                  price: '100.51'
                  qty: '5.2'
                  time: 1699999999500
                  isBuyerMaker: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Symbol not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Trade:
      type: object
      description: Trade information
      required:
        - id
        - price
        - qty
        - time
        - isBuyerMaker
      properties:
        id:
          type: integer
          format: int64
          description: Trade ID
          example: 123456
        price:
          type: string
          description: Trade price
          example: '100.50'
        qty:
          type: string
          description: Trade quantity
          example: '10.5'
        time:
          type: integer
          format: int64
          description: Trade timestamp in milliseconds
          example: 1699999999000
        isBuyerMaker:
          type: boolean
          description: Whether the buyer is the maker
          example: true
    Error:
      type: object
      description: Error response
      required:
        - code
        - msg
      properties:
        code:
          type: integer
          description: Error code
          example: -1102
        msg:
          type: string
          description: Error message
          example: Mandatory parameter 'symbol' was not sent.

````