# Smart contracts

FlatQube is a smart contract system consisting of many libraries.

These smart contracts define the logic for managing DEX Pools, managing liquidity inside the pairs pool, deploying and updating new pairs and accounts, swapping EVERs to other TIP-3 tokens or TIP-3 tokens to EVER, creating vault and much more which is described sections below.

**Libraries list:**

* **DexErrors** - contains codes with all the errors and their meaning.
* **DexGas** - contains value for different types of operations.
* **DexOperationTypes** - contains codes of all different dex operation types.
* **DexPlatformTypes** - contains codes for different platform types.
* **EverToTip3Errors** - contains codes with all the errors specifically related to EverToTip3 swap.
* **EverToTip3Gas** - contains gas values for different types of operations specifically related to EverToTip3 contract.
* **EverToTip3OperationStatus** - contains code values that represent operation status in EverToTip3 contract.
* **TokenFactoryErrors** - contains codes with all the errors related to the token factory.

{% embed url="<https://github.com/broxus/ton-dex/tree/master/contracts>" %}


---

# Agent Instructions: 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:

```
GET https://docs.flatqube.io/integrate/smart-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
