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

# Get Exchange Rates

> Retrieves current exchange rates for supported currency pairs.

Retrieve current exchange rates for all supported currency pairs. Use the `rateToken` from the response to lock in a rate when performing a swap.

## Example Request

```bash theme={null}
curl -X GET "https://api.rolla.xyz/api/v1/external/wallet/rates" \
  -H "X-API-Key: your_api_key_here"
```

## Example Response

```json theme={null}
{
  "status": 200,
  "success": true,
  "message": "Exchange rates retrieved successfully",
  "data": {
    "rates": [
      {
        "fromCurrency": "NGN",
        "toCurrency": "USD",
        "rate": 0.0006292157,
        "rateToken": "eyJhbGci..."
      },
      {
        "fromCurrency": "XAF",
        "toCurrency": "USD",
        "rate": 0.0017606254,
        "rateToken": "eyJhbGci..."
      },
      {
        "fromCurrency": "USD",
        "toCurrency": "NGN",
        "rate": 1405.3992,
        "rateToken": "eyJhbGci..."
      },
      {
        "fromCurrency": "USD",
        "toCurrency": "XAF",
        "rate": 556,
        "rateToken": "eyJhbGci..."
      }
    ]
  }
}
```

<Info>
  Exchange rates are live and may change between the time you fetch them and when you execute a swap. Pass the `rateToken` to the `/wallet/swap` endpoint to lock in the quoted rate.
</Info>


## OpenAPI

````yaml GET /wallet/rates
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /wallet/rates:
    get:
      summary: Get Exchange Rates
      description: Retrieves current exchange rates for supported currency pairs.
      operationId: getRates
      responses:
        '200':
          description: Rates retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Exchange rates retrieved successfully
                  rates:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExchangeRate'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ExchangeRate:
      type: object
      properties:
        fromCurrency:
          type: string
          example: USD
        toCurrency:
          type: string
          example: NGN
        rate:
          type: number
          example: 1550
        rateToken:
          type: string
          description: Token to lock in this rate for a swap
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````