# xWIN Swap Engine

### What is xWIN Swap Engine?

xWIN v2 performs all the token swap during the deposit or withdrawal from the users. To issue a real time v2 vault token back to the user, the protocol swaps the input currency, USDT into the allocated tokens such as BTC, ETH or XWIN in various decentralized exchanges.

### Why does xWIN v2 Need xWIN Swap?

There are many DEXes in the BNB chain ecosystem. Each of the DEX has a different level of liquidity for each trading pair. Therefore, as a portfolio management platform, xWIN v2 must be able to swap different tokens in different DEX to achieve the optimal trading output.&#x20;

### How does xWIN Swap is built?

xWIN Swap integrated various DEXes in the ecosystem such as PancakeSwap, Biswap and Apeswap. xWIN Swap was built to perform token swap during the deposit and withdrawal of xWIN v2 public and private funds on-chain. If the public vault is allocated 40% of CAKE and 60% of BANANA. Then the xWIN vault will swap USDT to CAKE token in Pancakeswap, while swapping into Banana in Apeswap because they have more liquidity in the DEX respectively. &#x20;

### What is Pancakeswap, Biswap and Apeswap DEX?

A DEX (decentralized exchange) is a peer-to-peer marketplace where users can trade cryptocurrencies in a non-custodial manner without the need for an intermediary to facilitate the transfer and custody of funds. DEXs substitute intermediaries—traditionally, banks, brokers, payment processors, or other institutions—with blockchain-based smart contracts that facilitate the exchange of assets. PancakeSwap has the largest number of daily in BNB ecosystem. See the liquidity volume in these 3 DEXes

| Pancakeswap | $2.16b～$2.6b |
| ----------- | ------------ |
| Biswap      | $205m～$224m  |
| Apeswap     | $45m～$63m    |


---

# 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.xwin.finance/v1.1-docs/technical/xwin-swap-engine.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.
