# Get historical fungible token daily DEX rates

Get a paginated list of historical daily DEX rates for a fungible token pair using the source token contract package hash and target token contract package hash.

```
GET /ft/{contract_package_hash}/daily-dex-rates
```

## Query params

| Query param                    | Description                                                                         |
| ------------------------------ | ----------------------------------------------------------------------------------- |
| `target_contract_package_hash` | Target token contract package hash for conversion (required)                        |
| `dex_id`                       | [DEX](/rest-api/dex.md) identifier                                                  |
| `from`                         | Start of the range in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format |
| `to`                           | End of the range in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format   |
| `includes`                     | Optional fields schema. Supports `ft_daily_rate(currency_id,dex_id)`                |

## Sorting

| Property | Description        |
| -------- | ------------------ |
| `date`   | Sort rates by date |

Default sorting is `date DESC`

## Optional properties

| Property        | Type      | Description                                                                                                                                                                                                           |
| --------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ft_daily_rate` | `float32` | Daily average rate of the source token in the specified fiat/crypto currency. It's a [function includer](/documentation/overview/optional-properties.md#functions) that accepts `currency_id` and `dex_id` arguments. |

## Response

[`PaginatedResponse`](/documentation/overview/pagination.md)[`<DailyDexRate>`](/rest-api/fungible-token-daily-dex-rate.md)

## Example

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/ft/0f6b7e1a8d6e4f1b5a2c3d4e5f60718293a4b5c6d7e8f90123456789abcdef12/daily-dex-rates?target_contract_package_hash=ad0cd4ef3cfd9e7222706786e51773af771f063ecce4606282999a7a6d6ac495&dex_id=1&includes=ft_daily_rate(1,1)' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": [
    {
      "date": "2024-02-01T00:00:00Z",
      "amount": "0.0025",
      "volume": "1234.567",
      "token_contract_package_hash": "0f6b7e1a8d6e4f1b5a2c3d4e5f60718293a4b5c6d7e8f90123456789abcdef12",
      "target_token_contract_package_hash": "ad0cd4ef3cfd9e7222706786e51773af771f063ecce4606282999a7a6d6ac495",
      "dex_id": 1,
      "ft_daily_rate": 0.25
    }
  ],
  "item_count": 1,
  "page_count": 1
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cspr.cloud/rest-api/fungible-token-daily-dex-rate/get-daily-token-dex-rates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
