> For the complete documentation index, see [llms.txt](https://docs.arken.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arken.ag/for-developers/arken-api/arken-swap-engine-api.md).

# Arken Swap Engine API

API Endpoint: `https://public-api.arken.finance`

{% hint style="info" %}
Please refer to [Arken API](/for-developers/arken-api.md) for getting API tokens
{% endhint %}

Using Arken Finance Swap Engine API, you can find the best route to exchange assets and make the swap.\
\
Here are the step-by-step instructions on how to use Arken Swap Engine API:

1. Find the addresses of the tokens you want to swap. For example, swapping WETH -> USDT
   1. WETH: `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`
   2. USDT: `0xdac17f958d2ee523a2206206994597c13d831ec7`
2. Check for allowance of Arken Approve contract to spend source asset using `/approve/allowance`
3. If necessary, give approval for Arken Approve contract to spend the source token using `/approve/transaction`
4. Monitor the best exchange route using `/swap/quote`
5. When you are ready to swap, use `/swap/swap` to generate the call data to perform the swap

### Chains

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/chains" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

### Health Check

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/healthcheck" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

### Approve

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/approve/spender" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/approve/transaction" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/approve/allowance" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

### Info

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/liquidity-sources" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

### Swap

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/swap/quote" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}

{% openapi src="<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>" path="/swap-engine/v1/{chainID}/swap/swap" method="get" %}
<https://api.arken.finance/docs/public/swap-engine-api.openapi.json>
{% endopenapi %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.arken.ag/for-developers/arken-api/arken-swap-engine-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
