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

# public/get_last_trades_by_currency

> Retrieves the latest trades that have occurred for instruments in a specific currency. Returns trade details including price, amount, direction, timestamp, and trade ID for all instruments in the currency.

Results can be filtered by instrument kind and trade ID range or timestamp range. Use the `count` parameter to limit the number of trades returned, and `sorting` to control the order (ascending or descending by trade ID).

[Try in API console](https://test.deribit.com/api_console?method=%2Fpublic%2Fget_last_trades_by_currency)





## OpenAPI

````yaml /api-reference/coinbase-deribit-app-api/adv-starbase-openapi.json get /public/get_last_trades_by_currency
openapi: 3.0.0
info:
  description: Coinbase Retail Advanced Trade API for derivatives trading.
  title: Coinbase Retail Advanced Trade (Deribit) API
  version: 2.1.1
servers:
  - url: https://drb.coinbase.com/api/v2
security: []
tags:
  - description: Can only be used over websockets.
    name: WebSocket Only
  - description: Public methods can be used without authentication.
    name: Public
  - description: >-
      <p>Private methods require authentication. All requests must include a
      valid OAuth2 token.</p>

      <p>A token can be requested using the <a
      href="#public-auth">/public/auth</a> method.</p>

      <p>When using the websockets protocol, the token must be included as a
      parameter <code>access_token</code> in the message. When using REST (HTTP
      GET), the token may also be passed in the <code>Authorization</code>
      header.</p>
    name: Private
  - name: Authentication
  - name: Session Management
  - description: >-
      Subscription works as [notifications](#notifications), so users will
      automatically (after subscribing) receive messages from the server.
      Overview for each channel response format is described in
      [subscriptions](#subscriptions) section.
    name: Subscription Management
  - name: Account Management
  - name: Trading
  - name: Market Data
paths:
  /public/get_last_trades_by_currency:
    get:
      tags:
        - Market Data
        - Public
      description: >+
        Retrieves the latest trades that have occurred for instruments in a
        specific currency. Returns trade details including price, amount,
        direction, timestamp, and trade ID for all instruments in the currency.


        Results can be filtered by instrument kind and trade ID range or
        timestamp range. Use the `count` parameter to limit the number of trades
        returned, and `sorting` to control the order (ascending or descending by
        trade ID).


        [Try in API
        console](https://test.deribit.com/api_console?method=%2Fpublic%2Fget_last_trades_by_currency)

      parameters:
        - description: The currency symbol
          in: query
          name: currency
          required: true
          schema:
            $ref: '#/components/schemas/currency'
        - description: >-
            Instrument kind, `"combo"` for any combo or `"any"` for all. If not
            provided instruments of all kinds are considered
          in: query
          name: kind
          required: false
          schema:
            $ref: '#/components/schemas/kind_with_combo_all'
        - description: >-
            The ID of the first trade to be returned. Number for BTC trades, or
            hyphen name in ex. `"ETH-15"` # `"ETH_USDC-16"`
          in: query
          name: start_id
          required: false
          schema:
            $ref: '#/components/schemas/trade_id'
        - description: >-
            The ID of the last trade to be returned. Number for BTC trades, or
            hyphen name in ex. `"ETH-15"` # `"ETH_USDC-16"`
          in: query
          name: end_id
          required: false
          schema:
            $ref: '#/components/schemas/trade_id'
        - description: >-
            The earliest timestamp to return result from (milliseconds since the
            UNIX epoch). When param is provided trades are returned from the
            earliest
          in: query
          name: start_timestamp
          required: false
          schema:
            $ref: '#/components/schemas/timestamp'
        - description: >-
            The most recent timestamp to return result from (milliseconds since
            the UNIX epoch). Only one of params: start_timestamp, end_timestamp
            is truly required
          in: query
          name: end_timestamp
          required: false
          schema:
            $ref: '#/components/schemas/timestamp'
        - description: Number of requested items, default - `10`, maximum - `1000`
          in: query
          name: count
          required: false
          schema:
            maximum: 1000
            minimum: 1
            type: integer
        - description: >-
            Direction of results sorting (`default` value means no sorting,
            results will be returned in order in which they left the database)
          in: query
          name: sorting
          required: false
          schema:
            $ref: '#/components/schemas/sorting'
      requestBody:
        content:
          application/json:
            examples:
              request:
                description: JSON-RPC Request Example
                value:
                  id: 9290
                  jsonrpc: '2.0'
                  method: public/get_last_trades_by_currency
                  params:
                    count: 3
                    currency: BTC
        description: JSON-RPC request body
      responses:
        '200':
          $ref: '#/components/responses/PublicTradesHistoryResponse'
components:
  schemas:
    currency:
      description: Currency, i.e `"BTC"`, `"ETH"`, `"USDC"`
      enum:
        - BTC
        - ETH
        - USDC
        - USDT
        - EURR
      type: string
    kind_with_combo_all:
      description: >-
        Instrument kind: `"future"`, `"option"`, `"spot"`, `"future_combo"`,
        `"option_combo"`, `"combo"` for any combo or `"any"` for all
      enum:
        - future
        - option
        - spot
        - future_combo
        - option_combo
        - combo
        - any
      type: string
    trade_id:
      description: Unique (per currency) trade identifier
      type: string
    timestamp:
      description: The timestamp (milliseconds since the Unix epoch)
      example: 1536569522277
      type: integer
    sorting:
      enum:
        - asc
        - desc
        - default
      type: string
    PublicTradesHistoryResponse:
      properties:
        id:
          description: The id that was sent in the request
          type: integer
        jsonrpc:
          description: The JSON-RPC version (2.0)
          enum:
            - '2.0'
          type: string
        result:
          properties:
            has_more:
              type: boolean
            trades:
              items:
                $ref: '#/components/schemas/public_trade'
              type: array
          required:
            - trades
            - has_more
          type: object
      required:
        - jsonrpc
        - result
      type: object
    public_trade:
      properties:
        amount:
          description: >-
            Trade amount. For perpetual and inverse futures the amount is in USD
            units. For options and linear futures it is the underlying base
            currency coin.
          type: number
        block_rfq_id:
          description: ID of the Block RFQ - when trade was part of the Block RFQ
          type: integer
        block_trade_id:
          $ref: '#/components/schemas/block_trade_id_in_result'
        block_trade_leg_count:
          $ref: '#/components/schemas/block_trade_leg_count'
        combo_id:
          description: >-
            Optional field containing combo instrument name if the trade is a
            combo trade
          type: string
        combo_trade_id:
          description: >-
            Optional field containing combo trade identifier if the trade is a
            combo trade
          type: number
        contracts:
          description: >-
            Trade size in contract units (optional, may be absent in historical
            trades)
          type: number
        direction:
          $ref: '#/components/schemas/direction'
          description: Trade direction of the taker
        index_price:
          description: Index Price at the moment of trade
          type: number
        instrument_name:
          $ref: '#/components/schemas/instrument_name'
        iv:
          description: Option implied volatility for the price (Option only)
          type: number
        liquidation:
          description: >-
            Optional field (only for trades caused by liquidation): `"M"` when
            maker side of trade was under liquidation, `"T"` when taker side was
            under liquidation, `"MT"` when both sides of trade were under
            liquidation
          enum:
            - M
            - T
            - MT
          type: string
        mark_price:
          description: Mark Price at the moment of trade
          type: number
        price:
          $ref: '#/components/schemas/price'
          description: The price of the trade
        tick_direction:
          $ref: '#/components/schemas/tick_direction'
        timestamp:
          $ref: '#/components/schemas/trade_timestamp'
        trade_id:
          $ref: '#/components/schemas/trade_id'
        trade_seq:
          $ref: '#/components/schemas/trade_seq'
      required:
        - trade_id
        - instrument_name
        - timestamp
        - trade_seq
        - direction
        - tick_direction
        - index_price
        - price
        - amount
        - mark_price
      type: object
    block_trade_id_in_result:
      description: Block trade id - when trade was part of a block trade
      example: '154'
      type: string
    block_trade_leg_count:
      description: Block trade leg count - when trade was part of a block trade
      example: 3
      type: integer
    direction:
      description: 'Direction: `buy`, or `sell`'
      enum:
        - buy
        - sell
      type: string
    instrument_name:
      description: Unique instrument identifier
      example: BTC-PERPETUAL
      type: string
    price:
      description: Price in base currency
      type: number
    tick_direction:
      description: >-
        Direction of the "tick" (`0` = Plus Tick, `1` = Zero-Plus Tick, `2` =
        Minus Tick, `3` = Zero-Minus Tick).
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
    trade_timestamp:
      description: The timestamp of the trade (milliseconds since the UNIX epoch)
      example: 1517329113791
      type: integer
    trade_seq:
      description: The sequence number of the trade within instrument
      type: integer
  responses:
    PublicTradesHistoryResponse:
      content:
        application/json:
          examples:
            response:
              description: Response example
              value:
                id: 1469
                jsonrpc: '2.0'
                result:
                  has_more: true
                  trades:
                    - amount: 3
                      contracts: 3
                      direction: buy
                      index_price: 66930.31
                      instrument_name: BTC-24APR26-72000-C
                      iv: 45.91
                      mark_price: 0.05253883
                      price: 0.0525
                      tick_direction: 2
                      timestamp: 1770984454552
                      trade_id: '415305279'
                      trade_seq: 467
          schema:
            $ref: '#/components/schemas/PublicTradesHistoryResponse'
      description: Success response

````