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

# wallet/getmarketpricebypair | TRON

> TRON API method that retrieves the current market price for a specific TRC10↔TRC10 trading pair on the TRON DEX. TRON via Chainstack.

TRON API method that retrieves the current market price for a specific TRC10↔TRC10 trading pair on the TRON DEX.

## Parameters

* `sell_token_id` — TRC10 token ID being sold, as a numeric string (for example, "1000006").
* `buy_token_id` — TRC10 token ID being purchased, as a numeric string.
* `visible` — optional boolean. Some node builds require `visible: true`.

## Response

* `sell_token_id` — token ID being sold
* `buy_token_id` — token ID being purchased
* `prices` — array of recent price points containing:
  * `sell_token_quantity` — quantity of sell token
  * `buy_token_quantity` — quantity of buy token
  * `timestamp` — when this price point was recorded

## Use case

The `wallet/getmarketpricebypair` method is used for:

* Getting current market rates for trading pair price calculations.
* Building price tracking and charting applications for TRON DEX.
* Implementing automated trading strategies based on market prices.
* Displaying real-time pricing information in trading interfaces.
* Analyzing price trends and market volatility for specific token pairs.

## curl example

```shell Shell theme={"system"}
curl --request POST \
  --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getmarketpricebypair' \
  --header 'Content-Type: application/json' \
  --data '{
    "sell_token_id": "1000006",
    "buy_token_id": "1000001",
    "visible": true
  }'
```


## OpenAPI

````yaml openapi/tron_node_api/getmarketpricebypair.json post /95e61622bf6a8af293978377718e3b77/wallet/getmarketpricebypair
openapi: 3.0.0
info:
  title: wallet/getmarketpricebypair TRON API
  version: 1.0.0
  description: Get market price for trading pair
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/getmarketpricebypair:
    post:
      tags:
        - Market and DEX
      summary: wallet/getmarketpricebypair
      operationId: getMarketPriceByPair
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sell_token_id:
                  type: string
                  description: >-
                    TRC10 token ID being sold, as a numeric string (e.g.,
                    '1000006').
                buy_token_id:
                  type: string
                  description: TRC10 token ID being purchased, as a numeric string.
                visible:
                  type: boolean
                  description: >-
                    Optional. Some node builds require `visible: true` for this
                    endpoint.
                  default: true
              required:
                - sell_token_id
                - buy_token_id
              example:
                sell_token_id: '1000006'
                buy_token_id: '1000001'
                visible: true
      responses:
        '200':
          description: Market price for trading pair
          content:
            application/json:
              schema:
                type: object
                properties:
                  sell_token_id:
                    type: string
                    description: Token ID being sold
                  buy_token_id:
                    type: string
                    description: Token ID being purchased
                  prices:
                    type: array
                    description: Array of recent price points
                    items:
                      type: object
                      properties:
                        sell_token_quantity:
                          type: string
                          description: Quantity of sell token
                        buy_token_quantity:
                          type: string
                          description: Quantity of buy token
                        timestamp:
                          type: number
                          description: Price point timestamp
        '400':
          description: Validation error or unsupported pair
          content:
            application/json:
              schema:
                type: object
                properties:
                  Error:
                    type: string
              example:
                Error: >-
                  class org.tron.core.exception.BadItemException : sellTokenId
                  is not a valid number

````