> For the complete documentation index, see [llms.txt](https://docs-swap.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-swap.crypto-chief.com/api-reference/liquidity-sources.md).

# Liquidity Sources

## Liquidity Sources

The liquidity sources and executors of a network, with their live status. The `id` values here are what the `sources`, `exclude_sources` and `executors` filters of [`POST /v1/quote`](/api-reference/quote.md) and [`POST /v1/build`](/api-reference/build.md) take.

#### **Liquidity Sources**

<mark style="color:green;">`POST`</mark> `https://swap-api.crypto-chief.com/YOUR_API_KEY/v1/liquidity-sources`

**Headers**

| Name         | Value                                                                                                           |
| ------------ | --------------------------------------------------------------------------------------------------------------- |
| Content-Type | `application/json`                                                                                              |
| X-Request-Id | Optional — your id for this call, echoed in the response ([Authentication](/getting-started/authentication.md)) |

**Body**

| Name      | Type   | Required | Description                    |
| --------- | ------ | -------- | ------------------------------ |
| `network` | string | true     | Network code, case-insensitive |

```json
{
  "network": "ETH_MAINNET"
}
```

**Response**

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

```json
{
  "sources": [
    {"id": "uniswap_v3", "kind": "dex", "name": "Uniswap V3", "status": "enabled", "pools": 412},
    {"id": "oneinch_v6", "kind": "executor", "name": "1inch AggregationRouterV6", "status": "enabled", "address": "0x111111125421cA6dc452d289314280a0f8842A65"},
    {"id": "dex_router", "kind": "executor", "name": "Uniswap V3 router", "status": "enabled", "address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"},
    {"id": "cc_router", "kind": "executor", "name": "Crypto Chief Router", "status": "disabled"}
  ]
}
```

{% endtab %}
{% endtabs %}

**Fields**

| Field     | Description                                                                                                                                                                                                                                                                      |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`      | The id to use in `sources` / `exclude_sources` (a `dex`) or `executors` (an `executor`). Each DEX router appears as its own entry with id `dex_router`; the approve endpoints name it `dex_router:<dex id>` ([Which executor](/api-reference/approve-spender.md#which-executor)) |
| `kind`    | `dex` — a liquidity source the router searches; `executor` — the contract or program that executes the swap; `route_api` — an external route source (Jupiter on Solana)                                                                                                          |
| `name`    | The human-readable name                                                                                                                                                                                                                                                          |
| `status`  | `enabled`, `paused`, `disabled`, `code_mismatch`, `unavailable` — below                                                                                                                                                                                                          |
| `pools`   | How many pools of this source are loaded (a `dex`)                                                                                                                                                                                                                               |
| `address` | The executor's contract or program (an `executor`)                                                                                                                                                                                                                               |

**Status**

| `status`        | Meaning                                                                 |
| --------------- | ----------------------------------------------------------------------- |
| `enabled`       | In use                                                                  |
| `paused`        | The executor is paused on chain — not used until it resumes             |
| `disabled`      | Switched off in configuration — not used                                |
| `code_mismatch` | The executor's on-chain code does not match the expected one — not used |
| `unavailable`   | Cannot be reached or verified right now                                 |

Executors are verified against their on-chain code and pause state, at start and periodically; a mismatch or a pause takes the executor out of route building on its own. Asking for one in `executors` while it is off answers `503 EXECUTOR_UNAVAILABLE`.

{% hint style="info" %}
`cc_router` shows `disabled` on EVM networks and TRON: [partner fees](/getting-started/partner-fees.md) are not available there.
{% endhint %}

### Example

`swap()` is defined in [Authentication](/getting-started/authentication.md).

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

```javascript
const { sources } = await swap("liquidity-sources", { network: "ETH_MAINNET" });
for (const s of sources) console.log(s.id, s.kind, s.status);
```

{% endtab %}

{% tab title="PHP" %}

```php
$out = swap('liquidity-sources', ['network' => 'ETH_MAINNET']);
foreach ($out['sources'] as $s) echo $s['id'], ' ', $s['kind'], ' ', $s['status'], "\n";
```

{% endtab %}

{% tab title="GO" %}

```go
out, _, err := swap("liquidity-sources", map[string]any{"network": "ETH_MAINNET"})
if err != nil {
	log.Fatal(err)
}
for _, s := range out["sources"].([]any) {
	s := s.(map[string]any)
	fmt.Println(s["id"], s["kind"], s["status"])
}
```

{% endtab %}

{% tab title="Python" %}

```python
out = swap("liquidity-sources", {"network": "ETH_MAINNET"})
for s in out["sources"]:
    print(s["id"], s["kind"], s["status"])
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -s -X POST "https://swap-api.crypto-chief.com/$CC_API_KEY/v1/liquidity-sources" \
  -H "Content-Type: application/json" \
  -d '{"network":"ETH_MAINNET"}'
```

{% endtab %}
{% endtabs %}
