> For the complete documentation index, see [llms.txt](https://docs.ston.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ston.fi/developer-section/dex/api.md).

# REST API

STON.fi DEX API documentation - RESTful interface for programmatic DEX access and data queries

The STON.fi DEX REST API provides asset and pool metadata, swap and liquidity simulations, wallet data, transaction queries, and statistics.

{% hint style="info" %}
API endpoint: [api.ston.fi](https://api.ston.fi)
{% endhint %}

### Limits

Currently, there are no limits for DEX API use.

### API Viewers

You can explore the full schema and try requests via:

* [Swagger UI](https://api.ston.fi/swagger-ui/)
* [Redoc](https://api.ston.fi/redoc)

### SDK

Use the [TypeScript SDK](https://github.com/ston-fi/api) to access the API from JavaScript and TypeScript.

### API Reference

For a complete list of all available endpoints with brief descriptions, please refer to our [API Reference](/developer-section/dex/api/reference.md).

### Referral Fee Endpoints

The following endpoints expose integrator-fee data for STON.fi DEX v2 Vaults:

* **Wallet-level vaults:** `GET /v1/wallets/{address}/fee_vaults` Lists referral fee vaults for **STON.fi DEX v2** for a given referrer.
* **Fee statistics:**
  * `GET /v1/stats/fee_accruals`: Referral fee accrual history for **DEX v2 fee Vaults**; DEX v1 direct payouts are not this Vault dataset
  * `GET /v1/stats/fee_withdrawals`: Withdrawals from **DEX v2** vaults
  * `GET /v1/stats/fees`: Aggregated referral fee stats

These endpoints cover STON.fi DEX v2 fee Vaults. For fees accrued through other TON liquidity protocols, use the [TON payout contract reference](/developer-section/omniston/migration/fee-payouts.md).

For a full description of how referral fees are calculated and settled across DEX v1, DEX v2, DeDust, and Tonco, see the [Integrator fees in Omniston](/developer-section/omniston/referral-fees.md) guide.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ston.fi/developer-section/dex/api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
