> For the complete documentation index, see [llms.txt](https://doc.torch.finance/dex/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.torch.finance/dex/getting-started/architecture.md).

# Architecture

## TON Virtual Machine (TVM): A Foundation for Scalability

The TON Virtual Machine (TVM) powers smart contracts on the TON blockchain with cutting-edge features like the **Infinity Sharding Paradigm**, which enables dynamic scalability and lightning-fast transaction processing. This unique approach ensures TON can handle ever-growing demand, making it a robust platform for DeFi innovations like Torch Finance.

However, TVM also presents unique challenges:

* **No Transaction Rollback (between addresses)**: Failed transactions cannot be reversed between different addresses, requiring careful contract design.
* **No Cross-Contract State Access**: Contracts cannot directly retrieve state information from other contracts, necessitating innovative solutions for complex interactions.

## The Advantages of Torch Finance Architecture

Torch Finance is designed to overcome these challenges and maximize TVM’s capabilities. Its architecture offers several key advantages:

1. **High-Speed Transactions**\
   Torch Finance leverages TVM’s Infinity Sharding to enable ultra-fast transaction processing, ensuring scalability even during peak demand.
2. **Single-Sided Liquidity Provision**\
   Users can provide liquidity using a single token instead of pairs.
3. **Quasi-Atomic Swaps for Multi-Token Pools**\
   Supports multi-token pools, allowing seamless exchanges between any tokens within a pool.
   * Faster swaps with reduced routing complexity.
   * Almost atomic execution ensures reliable outcomes.
4. **Meta Pool Liquidity Aggregation**\
   Aggregates liquidity for smaller products, improving their usability while benefiting liquidity providers with higher returns.
5. **Gas Optimization**\
   By building on DeDust’s foundation and introducing further optimizations, Torch Finance reduces gas costs for both single-pool and cross-pool operations.

***

With its innovative architecture, Torch Finance not only addresses TVM’s limitations but also delivers a highly efficient and user-centric DeFi experience on TON.
