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

# Get Trade History

> Query users' execution records, sorted by execTime in descending order.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/execution/list
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
security: []
paths:
  /api/v1/execution/list:
    get:
      tags:
        - Trade
      summary: Get Trade History
      description: Query users' execution records, sorted by execTime in descending order.
      operationId: get_trade_history
      parameters:
        - name: sub_account_address
          in: query
          required: true
          schema:
            type: string
        - name: symbol
          in: query
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/Symbol'
        - name: order_id
          in: query
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/OrderId'
        - name: order_link_id
          in: query
          required: false
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/OrderLinkId'
        - name: start_time
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: end_time
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: limit
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: cursor
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Trade history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTradeHistoryResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    Symbol:
      type: string
      example: BTCUSDC
    OrderId:
      type: string
      format: uuid
    OrderLinkId:
      type: string
    GetTradeHistoryResponse:
      type: object
      description: Response for trade history queries.
      required:
        - list
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/Execution'
        next_page_cursor:
          type:
            - string
            - 'null'
    Execution:
      type: object
      description: Single execution (trade fill) record.
      required:
        - exec_id
        - symbol
        - order_id
        - side
        - sub_account_address
        - order_price
        - order_qty
        - leaves_qty
        - order_type
        - exec_price
        - exec_qty
        - exec_value
        - exec_type
        - exec_time
        - is_maker
        - fee_rate
        - mark_price
        - index_price
        - seq
      properties:
        closed_size:
          type:
            - string
            - 'null'
          description: Closed position size
        create_type:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CreateType'
              description: Order create type
        exec_id:
          $ref: '#/components/schemas/ExecutionId'
          description: Execution ID
        exec_price:
          type: string
          description: Execution price
        exec_qty:
          type: string
          description: Execution quantity
        exec_time:
          type: string
          format: date-time
          description: Executed timestamp (ms)
          example: '1672531200000'
        exec_type:
          $ref: '#/components/schemas/ExecType'
          description: Execution type (e.g. Trade, Adl, Bust)
        exec_value:
          type: string
          description: Executed value (price * qty)
        fee_rate:
          type: string
          description: Trading fee rate
        index_price:
          type: string
          description: Index price at execution
        is_maker:
          type: boolean
          description: 'Is maker order. true: maker, false: taker'
        leaves_qty:
          type: string
          description: Remaining quantity not yet executed after this fill
        mark_price:
          type: string
          description: Mark price at execution
        order_id:
          $ref: '#/components/schemas/OrderId'
        order_link_id:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OrderLinkId'
        order_price:
          type: string
          description: Original order price
        order_qty:
          type: string
          description: Original order quantity
        order_type:
          $ref: '#/components/schemas/OrderType'
          description: Order type. Market or Limit
        seq:
          type: integer
          format: int64
          description: >-
            Cross sequence, used to associate each fill and each position update

            * The seq will be the same when conclude multiple transactions at
            the same time

            * Different symbols may have the same seq, please use seq + symbol
            to check unique
          minimum: 0
        side:
          $ref: '#/components/schemas/Side'
          description: Side. Buy or Sell
        stop_order_type:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/StopOrderType'
              description: Stop order type if this was a stop order
        sub_account_address:
          type: string
        symbol:
          $ref: '#/components/schemas/Symbol'
          description: Symbol name, e.g. BTCUSDC
    CreateType:
      type: string
      enum:
        - CreateByUser
        - CreateByFutureSpread
        - CreateByAdminClosing
        - CreateBySettle
        - CreateByStopOrder
        - CreateByTakeProfit
        - CreateByPartialTakeProfit
        - CreateByStopLoss
        - CreateByPartialStopLoss
        - CreateByTrailingStop
        - CreateByTrailingProfit
        - CreateByLiq
        - CreateByTakeOverPassThrough
        - CreateByAdlPassThrough
        - CreateByBlockPassThrough
        - CreateByBlockTradeMovePositionPassThrough
        - CreateByClosing
        - CreateByFGridBot
        - CloseByFGridBot
        - CreateByTWAP
        - CreateByTVSignal
        - CreateByMmRateClose
        - CreateByMartingaleBot
        - CloseByMartingaleBot
        - CreateByIceBerg
        - CreateByArbitrage
        - CreateByDdh
        - CreateByBboOrder
    ExecutionId:
      type: string
      format: uuid
    ExecType:
      type: string
      description: Execution type for trade history entries.
      enum:
        - Trade
        - AdlTrade
        - Funding
        - BustTrade
        - Delivery
        - Settle
        - BlockTrade
        - MovePosition
        - FutureSpread
    OrderType:
      type: string
      description: 'Order type: Limit, Market.'
      enum:
        - Limit
        - Market
    Side:
      type: string
      description: 'Order side: buy or sell.'
      enum:
        - Sell
        - Buy
    StopOrderType:
      type: string
      enum:
        - TakeProfit
        - StopLoss
        - TrailingStop
        - Stop
        - PartialTakeProfit
        - PartialStopLoss
        - TpslOrder
        - OcoOrder
        - MmRateClose
        - BidirectionalTpslOrder
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````