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

# getExchanges

> Returns a list of decentralized exchange metadata.

<div data-generated>
  ## GraphQL

  ```
  type Query {
    getExchanges(
      showNameless: Boolean
    ): [Exchange!]!
  }

  type Exchange {
    id: String!
    address: String!
    color: String
    name: String
    exchangeVersion: String
    iconUrl: String
    networkId: Int!
    tradeUrl: String
  }
  ```
</div>

### Example

<a href="/explore" target="_blank" rel="noopener noreferrer">Test this query in the Explorer →</a>

```graphql theme={null}
{
  getExchanges {
    address
    id
    name
    exchangeVersion
    iconUrl
    networkId
    tradeUrl
    color
  }
}
```

### Usage Guidelines

* Returns metadata for all supported decentralized exchanges across all networks
* Each exchange includes `address`, `name`, `networkId`, and optional branding info (`iconUrl`, `color`, `tradeUrl`)
* Use `exchangeVersion` to distinguish between different versions of the same protocol (e.g., Raydium V4, Uniswap V2 vs V3)
* The `id` field combines `address:networkId` for unique identification
* Set `showNameless: true` to include exchanges with incomplete metadata (missing name or icon)
* Use this query to populate exchange filters or display exchange logos in your UI

### Troubleshooting Tips

<AccordionGroup>
  <Accordion title="How do I filter exchanges by network?">
    `getExchanges` returns all exchanges across all networks. Filter the results client-side by `networkId` to get exchanges for a specific chain. For example, filter by `networkId: 1399811149` for Solana exchanges only.
  </Accordion>

  <Accordion title="What is the exchangeVersion field?">
    `exchangeVersion` indicates the protocol version or variant. For example, Raydium has `V4`, `CPMM`, and `CLMM` versions. Orca has `Whirlpool`. Uniswap has `V2` and `V3`. This helps distinguish pools with different mechanics on the same protocol.
  </Accordion>

  <Accordion title="Why are some fields null?">
    Not all exchanges have complete metadata. Fields like `iconUrl`, `color`, `tradeUrl`, and even `name` may be null for newer or less common exchanges. By default, `showNameless: false` filters out exchanges missing key fields.
  </Accordion>

  <Accordion title="How do I match an exchange to a pair?">
    Pairs include an `exchangeHash` field that corresponds to the exchange's `address`. Use `getExchanges` to build a lookup table mapping exchange addresses to their metadata (name, icon, etc.).
  </Accordion>
</AccordionGroup>
