# Market config

Get all supported trading pairs and assets with their metadata. This endpoint provides essential information for trading including token decimals, symbols, and trading pair configurations.

## Get market configuration

> Get all supported trading pairs and assets with their metadata

```json
{"openapi":"3.1.1","info":{"title":"Espresso API Server","version":"1.0"},"paths":{"/app/market-config":{"get":{"description":"Get all supported trading pairs and assets with their metadata","tags":["app"],"summary":"Get market configuration","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.GetMarketConfigResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/espresso_internal_api_response.ErrorJSONWithCodeResponse"}}}}}}}},"components":{"schemas":{"espresso_internal_api_response.GetMarketConfigResponse":{"type":"object","properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/espresso_internal_api_response.MarketConfigAsset"}},"trading_pairs":{"type":"array","items":{"$ref":"#/components/schemas/espresso_internal_api_response.MarketConfigTradingPair"}}}},"espresso_internal_api_response.MarketConfigAsset":{"type":"object","properties":{"decimals":{"type":"integer"},"max_qty_dp":{"type":"integer"},"symbol":{"type":"string"},"trading_pairs":{"type":"array","items":{"type":"string"}},"unit":{"type":"string"}}},"espresso_internal_api_response.MarketConfigTradingPair":{"type":"object","properties":{"base_token":{"$ref":"#/components/schemas/espresso_internal_api_response.MarketConfigToken"},"price_max_dp":{"type":"integer"},"quote_token":{"$ref":"#/components/schemas/espresso_internal_api_response.MarketConfigToken"},"symbol":{"type":"string"}}},"espresso_internal_api_response.MarketConfigToken":{"type":"object","properties":{"decimals":{"type":"integer"},"max_qty_dp":{"type":"integer"},"symbol":{"type":"string"},"unit":{"type":"string"}}},"espresso_internal_api_response.ErrorJSONWithCodeResponse":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"string"}}}}}}
```

{% tabs %}
{% tab title="Curl" %}

```sh
curl --location 'https://api.deltadefi.io/app/market-config'
```

{% endtab %}

{% tab title="NodeJs (axios)" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.deltadefi.io/app/market-config'
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://api.deltadefi.io/app/market-config"
  method := "GET"

  client := &http.Client{}
  req, err := http.NewRequest(method, url, nil)
  if err != nil {
    fmt.Println(err)
    return
  }

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}

**Response:**

```json
{
  "assets": [
    {
      "symbol": "ADA",
      "unit": "lovelace",
      "decimals": 6,
      "max_qty_dp": 2,
      "trading_pairs": ["ADAUSDM"]
    },
    {
      "symbol": "USDM",
      "unit": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad.0014df105553444d",
      "decimals": 6,
      "max_qty_dp": 2,
      "trading_pairs": ["ADAUSDM"]
    }
  ],
  "trading_pairs": [
    {
      "symbol": "ADAUSDM",
      "base_token": {
        "symbol": "ADA",
        "unit": "lovelace",
        "decimals": 6,
        "max_qty_dp": 2
      },
      "quote_token": {
        "symbol": "USDM",
        "unit": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad.0014df105553444d",
        "decimals": 6,
        "max_qty_dp": 2
      },
      "price_max_dp": 4
    }
  ]
}
```

***

## Understanding the Response

### Assets

Each asset includes:

| Field          | Type    | Description                                                               |
| -------------- | ------- | ------------------------------------------------------------------------- |
| symbol         | string  | Human-readable asset name (e.g., ADA, USDM)                               |
| unit           | string  | On-chain asset identifier (policy ID + asset name, or "lovelace" for ADA) |
| decimals       | integer | Number of decimal places for the token on-chain                           |
| max\_qty\_dp   | integer | Maximum decimal places allowed for quantity inputs                        |
| trading\_pairs | array   | List of trading pairs this asset is involved in                           |

### Trading Pairs

Each trading pair includes:

| Field          | Type    | Description                                 |
| -------------- | ------- | ------------------------------------------- |
| symbol         | string  | Trading pair identifier (e.g., "ADAUSDM")   |
| base\_token    | object  | The base asset (what you're buying/selling) |
| quote\_token   | object  | The quote asset (what you're pricing in)    |
| price\_max\_dp | integer | Maximum decimal places for price inputs     |

{% hint style="info" %}
Use this endpoint to dynamically discover available trading pairs and properly format quantities and prices in your trading application.
{% endhint %}


---

# 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.deltadefi.io/start-trading/developers/api-documentation/app/market-config.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.
