# Pool

In Torch’s design, **asset management are handled by Vault contracts**, which directly inform Pools about the types and quantities of user assets. This separation allows Pools to **focus solely on trading and liquidity algorithms** without dealing with asset storage or retrieval.

This design decouples Pools from Vaults, granting Torch exceptional flexibility and scalability when creating liquidity pools.

***

## **Torch’s Current Pool Design**

Torch’s Pools are **modular**, enabling support for various assets and Constant Function Market Maker (CFMM) algorithms to accommodate different trading scenarios and market demands, including:

* **CPMM** (Constant Product Market Maker)
* **Stableswap** ([Curve Stable Swap algorithm](https://resources.curve.fi/pdf/curve-stableswap.pdf))
* **Weighted Pool**

Currently, Torch primarily supports the **Curve** **Stable Swap** algorithm and features two types of liquidity pools:

1. **Base Pool** – Suitable for assets with similar or stable values, such as **TON/tsTON/stTON**.
2. **Meta Pool** – Composed of Base Pool LP tokens and other assets, such as **triTON LP/hTON**, further expanding liquidity combinations and enhancing capital efficiency.

This modular design enables Torch to adapt to market changes and quickly introduce new algorithms as needed, maintaining protocol flexibility and competitiveness.

***

## **Advantages of This Design**

1. **Algorithm Focus for Greater Efficiency**\
   Pools handle the DEX’s mathematical logic, while Vaults manage asset storage and security. This division of labor allows Pools to focus on optimizing trading experiences and efficiency without the complexity of managing asset storage.
2. **Flexible Pool Structures**\
   With Base Pools and Meta Pools, Torch can support more complex asset compositions and enable seamless interaction between pools, **facilitating efficient liquidity flow within the system**.

***

## **Example**

Continuing with the Vault supermarket analogy, Pools function like **cash registers**, responsible for calculating discounts and processing payments.

* **Vaults receive and verify assets**, much like a checkout counter confirming a customer’s purchases.
* **Pools calculate the total amount, apply discounts**, and determine how much change or exchanged assets the user receives.

For example:

* A user brings a cart with 10 TON to the **TON checkout counter (Vault)**. The Vault verifies the 10 TON and sends this transaction information to the Pool.
* The Pool uses the **Stable Swap** or another algorithm to calculate how much tsTON the user can receive or how the TON should be distributed, completing the transaction.

This design separates asset management from trading logic:

* **Vaults handle asset deposits, swaps and withdrawals.**
* **Pools manage trading calculations.**

By keeping these responsibilities distinct, Pools focus purely on the DEX’s mathematical operations without direct involvement in asset storage, **ensuring smooth operations and reducing congestion risks**. This also ensures that Torch Finance remains flexible and scalable, evolving alongside the TON ecosystem.


---

# 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://doc.torch.finance/dex/getting-started/architecture/core-components/pool.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.
