> For the complete documentation index, see [llms.txt](https://darksun-2.gitbook.io/darksun-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://darksun-2.gitbook.io/darksun-docs/integrations/overview/dex-catalog.md). Agents can also search and read this documentation through its [MCP server](https://darksun-2.gitbook.io/darksun-docs/~gitbook/mcp).

# dex\_catalog

This guide defines the recommended payload shape for a DEX catalog endpoint.

## Purpose

DarkSun uses `dex_catalog` to discover:

* DEX identities
* factory contracts
* router contracts
* DEX branding and metadata

## Manifest expectation

Example capability declaration:

```json
{
  "key": "dex_catalog",
  "schema": "dex_catalog",
  "version": "1.0",
  "endpoint": "dex_registry",
  "output": {
    "collection": "dexes"
  }
}
```

This means DarkSun expects a top-level `dexes` array.

## Recommended payload

```json
{
  "chain": "terra_classic",
  "dexes": [
    {
      "id": "terraswap",
      "name": "Terraswap",
      "logoURI": "https://example.com/terraswap.svg",
      "factory": "terra1factory...",
      "router": "terra1router...",
      "token_code_id": 6036
    }
  ]
}
```

## Required fields

### Root object

* `dexes`

### DEX object

* `id`
* `name`

## Recommended fields

* `logoURI`
* `factory`
* `router`
* `token_code_id`

## Good implementation patterns

* use stable lowercase ids
* include branding metadata such as `logoURI`
* include factory contracts when available because they help DarkSun with discovery

## Common mistakes

### Publishing branding-only metadata with no discovery contracts

This is useful visually, but much less useful operationally.

### Using ids that change over time

The DEX id should be stable.
