> 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/smart-contracts/v1.md).

# DEX v1 contracts

STON.fi v1 smart contract API reference - technical specs for Router, Pool, and LP contracts

For SDK transaction-building examples, see [SDK integration](/developer-section/dex/migration/v1.md).

## Overview

The section contains separate documents for each smart contract used in AMM:

* [Pool](/developer-section/dex/smart-contracts/v1/pool.md)
* [Router](/developer-section/dex/smart-contracts/v1/router.md)
* [LpAccount](/developer-section/dex/smart-contracts/v1/lpaccount.md)
* [LpWallet](/developer-section/dex/smart-contracts/v1/lpwallet.md)

Source code of all smart contracts can be found in this [**Github repo**](https://github.com/ston-fi/dex-core)

> **Note**: Protocol fees in DEX v1 are collected in ASK jetton.

## Referral Fees

DEX v1 pays the referrer share of a swap fee directly inside the swap transaction. The rate is fixed at **0.1 %** and the amount is transferred to the provided `referrer_address` automatically. See the [DEX fee model](/developer-section/dex/fees.md#dex-v1-direct-payouts).

Inspect direct payout transfers in the swap's transaction trace. The REST [fee statistics](/developer-section/dex/api/reference.md#fee-statistics) describe DEX v2 Vault activity and do not provide a v1 referral Vault withdrawal history.


---

# 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/smart-contracts/v1.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.
