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

# Get recent runtime trades

> Returns global recent trade summaries, newest first. Limit defaults to
10 and is capped at 100. Terminal trades and active settlement recovery
rows are backed by SQLite.




## OpenAPI

````yaml /openapi.yaml get /v1/runtime/trades
openapi: 3.1.0
info:
  title: Firmament Backend API
  version: 0.1.3
  summary: Public backend routes for Firmament swaps and runtime proof.
  description: >
    Firmament is a Solana RFQ maker backend for managed liquidity demos.

    This specification documents the public routes used by the swap app and
    runtime view.
servers:
  - url: https://api.firmament.shaikazeem.com
    description: Deployed Firmament API.
  - url: http://127.0.0.1:5050
    description: Local backend started with `cargo run`.
security: []
tags:
  - name: Health
    description: Runtime liveness.
  - name: Assets
    description: Supported Solana assets.
  - name: Pairs
    description: Configured directional pairs and constraints.
  - name: RFQ
    description: Firm quote requests.
  - name: Settlement
    description: Browser-wallet HTLC settlement.
  - name: Trades
    description: Trade status lookup.
  - name: Runtime
    description: Read-only runtime state, events, ledger, and trades.
paths:
  /v1/runtime/trades:
    get:
      tags:
        - Runtime
      summary: Get recent runtime trades
      description: |
        Returns global recent trade summaries, newest first. Limit defaults to
        10 and is capped at 100. Terminal trades and active settlement recovery
        rows are backed by SQLite.
      operationId: getRuntimeTrades
      parameters:
        - name: limit
          in: query
          required: false
          description: Number of newest trades to return.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
        - name: wallet
          in: query
          required: false
          description: >-
            Optional taker wallet filter used by the swap page wallet-history
            drawer.
          schema:
            type: string
      responses:
        '200':
          description: Recent trade summaries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    TradesResponse:
      type: object
      required:
        - total_count
        - successful_count
        - active_count
        - refunded_count
        - failed_count
        - trades
      properties:
        total_count:
          type: integer
          minimum: 0
        successful_count:
          type: integer
          minimum: 0
          description: Count of trades whose settlement status is redeemed.
        active_count:
          type: integer
          minimum: 0
          description: Count of active wallet settlements not yet terminal.
        refunded_count:
          type: integer
          minimum: 0
          description: Count of trades whose settlement status is refunded.
        failed_count:
          type: integer
          minimum: 0
          description: Count of trades whose settlement status is failed.
        trades:
          type: array
          items:
            $ref: '#/components/schemas/TradeSummary'
    TradeSummary:
      type: object
      required:
        - trade_id
        - quote_id
        - run_id
        - current_run
        - created_at
        - settlement_status
        - input
        - output
        - tx_signatures
      properties:
        trade_id:
          type: string
          format: uuid
        quote_id:
          type: string
          format: uuid
        run_id:
          type: string
          format: uuid
        current_run:
          type: boolean
          description: Whether the trade belongs to the currently running backend process.
        taker_wallet:
          description: Taker wallet that requested the trade when attribution is known.
          anyOf:
            - $ref: '#/components/schemas/WalletAddress'
            - type: 'null'
        expires_at:
          description: HTLC expiry timestamp when known.
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        created_at:
          type: string
          format: date-time
        settlement_status:
          $ref: '#/components/schemas/SettlementStatus'
        input:
          $ref: '#/components/schemas/RuntimeTradeAmount'
        output:
          $ref: '#/components/schemas/RuntimeTradeAmount'
        tx_signatures:
          type: array
          items:
            $ref: '#/components/schemas/TradeSignature'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              example: invalid_json
            message:
              type: string
            details:
              type: array
              items:
                type: string
    WalletAddress:
      type: string
      description: Solana wallet address.
      example: '11111111111111111111111111111111'
    SettlementStatus:
      type: string
      enum:
        - pending
        - initiated
        - redeemed
        - refunded
        - failed
    RuntimeTradeAmount:
      type: object
      required:
        - asset
        - amount_raw
        - decimals
        - display_amount
      properties:
        asset:
          type: string
          example: SOL
        amount_raw:
          type: string
          example: '1000000'
        decimals:
          type: integer
          minimum: 0
          maximum: 18
          example: 9
        display_amount:
          type: string
          example: '0.001000000'
    TradeSignature:
      type: object
      required:
        - kind
        - signature
      properties:
        kind:
          $ref: '#/components/schemas/TradeSignatureKind'
        signature:
          $ref: '#/components/schemas/TxSignature'
    TradeSignatureKind:
      type: string
      enum:
        - taker_lock
        - taker_redeem
        - taker_refund
        - maker_lock
        - maker_redeem
        - maker_refund
        - gateway_burn
        - gateway_mint
        - jupiter_swap
    TxSignature:
      type: string
      description: Solana transaction signature.
  responses:
    BadRequest:
      description: Request shape, path, or validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Runtime service is not available for the requested action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````