# REST API

Alongside contracts, we provide REST API to simplify interactions with the STON.fi protocol.

The DEX API provides data from the STON.fi contracts over time and organizes data about pools, jettons, STON.fi protocol as a whole, and more.

{% hint style="info" %}
DEX API live here [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

To simplify DEX API integration in your projects, we also have a tiny [Typescript SDK package](https://github.com/ston-fi/api)

### API Reference

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

### Referral Fee Endpoints

If you use Omniston referral fees with STON.fi pools, the DEX API exposes several helper endpoints:

* **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` – Per-swap referral fee accruals for **DEX v1 and v2** (for v1, accruals are paid instantly to the referrer; v2 accruals go into fee vaults)
  * `GET /v1/stats/fee_withdrawals` – Withdrawals from **DEX v2** vaults
  * `GET /v1/stats/fees` – Aggregated referral fee stats

These endpoints only cover STON.fi DEX v1/v2 pools. Omniston-level referral fees for external DEXes such as **DeDust** and **Tonco** are not yet available via REST and must be tracked on-chain.

For a full description of how referral fees are calculated and settled across DEX v1, DEX v2, DeDust, and Tonco, see the [Referral Fees in Omniston](https://docs.ston.fi/developer-section/omniston/referral-fees) guide.
