# Vaults

Vaults are specialized financial products that automatically manage and rebalance a portfolio of cryptocurrencies according to predefined strategies which help achieve high levels of compounding interest.

SettleTON Vaults are an integral part of the SettleTON platform, designed to simplify and enhance the investment process within the TON ecosystem.

Users deposit their funds into a SettleTON Vault, which pools together the deposits from multiple users.&#x20;

Once funds are pooled, the vault automatically implements investment strategies designed to maximize returns. These strategies may include investing in a diversified set of assets within the TON ecosystem or participating in yield farming and other DeFi opportunities.&#x20;

The vaults are periodically rebalanced to ensure that the investment strategy aligns with market conditions and the vault’s objectives.

## 💰 Deposit breakdown

1. The user transfers their Toncoins to a vault.
2. All of the user's Toncoins are sent to a newly deployed smart contract called `InvestorAccount`.
3. `InvestorAccount` splits the user's Toncoins in half, using one half to perform a swap on a DEX for Jetton tokens.
4. After the swap is complete, `InvestorAccount` combines the swapped Jetton tokens with the remaining Toncoins and deposits them into a liquidity pool on the DEX.
5. Once `InvestorAccount` receives LP tokens from the DEX, it sends them to the vault.
6. When the vault receives the LP tokens, it updates its internal state and mints proxy tokens as a share for the user.

<img src="/files/uyFvETnb7qrKtVNINd03" alt="" class="gitbook-drawing">

## 💸 Withdrawal breakdown

1. The user burns their proxy tokens.
2. The vault is notified, updates its internal state, and burns the corresponding share of LP tokens.
3. The DEX is notified and sends Toncoins and Jetton tokens back to the vault.
4. The vault swaps the Jetton tokens for Toncoins on the DEX.
5. The DEX transfers the Toncoins back to the vault.
6. The vault returns the Toncoins to the user.

<img src="/files/2xMhzyRJ1IV1QW2EJhel" alt="" class="gitbook-drawing">

## 🔄 Reinvestment breakdown

1. Our automation claims the rewards accumulated for the vault (these rewards can be claimed by anyone, but they will always be sent to the vault).
2. The vault swaps the rewards for Toncoins.
3. The vault initiates the deposit process described earlier, but this time no proxy tokens are minted, which increases the value of the existing proxy tokens.

<img src="/files/94SUrdkngITmw7cEiAas" alt="" class="gitbook-drawing">


---

# 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://settleton-1.gitbook.io/settleton/settleton-ecosystem/smart-contracts/vaults.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.
