> For the complete documentation index, see [llms.txt](https://docs.sirius.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sirius.finance/development/smart-contracts/swap.md).

# Swap

Swap provides functionalities that are used to exchange a token for another regardless if it's a stable coin or a standard crypto token.

## Contract info

**Contract name:** Swap

**Contract address**

* 4Pool: 0x417E9d065ee22DFB7CC6C63C403600E27627F333
* Starlay 4Pool: 0x0fB8C4eB33A30eBb01588e3110968430E3E69D58
* BAI Metapool: 0xD18aD1e2992Da974b5A8d69377e6aB3b16e30F29
* JPYC Metapool: 0x3cd1Fa4EeeFdf6c30E66c66A474e8E4dd509f54c
* WBTC Metapool: 0xD25Cf814EeE54840A08Db8dfAbFE445B1DE37f0f
* WETH Metapool: 0x2d5Da7c463B3E8f4CF1AF08a1aA0a5DB9BB644F7
* WBNB Metapool: 0xC9d4f937Fa8e0193b46817a41435a262867ff090
* oUSD Metapool: 0xD18AbE9bcedeb5A9a65439e604b0BE8db0bdB176

View [Sirius on Github](https://github.com/SiriusFinance/siriusfinance-contract)

***

## Interfaces

## Write functions

### **Swap**

```
void swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.sirius.finance/development/smart-contracts/swap.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.
