# BOB Swap

BobSwap (also called BobVault) is a unique AMM designed to issue BOB from inventory into the circulating supply via stable-only swaps.BobSwap does not have it's own UI, but is integrated into [**1inch exchange**](https://app.1inch.io/) on Ethereum and Polygon. Those interested in swapping USD-pegged assets (USDC, USDT or DAI) to BOB can simply visit 1inch and enter their desired swap. BobSwap is optimized to provide lower fees than many other available trading routes, offers 1-to-1 stable swaps (USDC/USDT/DAI to BOB), and is used when it provides the best swap rate.Current volume and other statistics related to BobSwap are available in Dune analytics (scroll to the bottom of the page to BobVault) <https://dune.com/zkbob/zkbob>​&#x20;

**BobSwap on Polygon**

* Contract: [`0x25E6505297b44f4817538fB2d91b88e1cF841B54`](https://polygonscan.com/address/0x25e6505297b44f4817538fb2d91b88e1cf841b54)​
* Deployed on: 20.02.23 as per [GP 3](https://app.gitbook.com/o/-Loxl4rmid_XZStTXG0U/s/-MjSwkv4zokqCUebt-98/bob-stablecoin/bob-governance-and-inventory/protocol-governance/gp-3-enable-bobvault-bobswap-for-public-use)​

**BobSwap on Ethereum**

* Contract: [0x15729Ac1795Fa02448a55D206005dC1914144a9F](https://etherscan.io/address/0x15729Ac1795Fa02448a55D206005dC1914144a9F)​
* Deployed on: 20.02.23 as per [GP5](https://app.gitbook.com/o/-Loxl4rmid_XZStTXG0U/s/-MjSwkv4zokqCUebt-98/bob-stablecoin/bob-governance-and-inventory/protocol-governance/gp-5-enable-bobvault-bobswap-on-ethereum-mainnet)​

### BobSwap parameters <a href="#bobswap-parameters" id="bobswap-parameters"></a>

Each collateral in BobSwap includes the following dynamic parameters. See [GP3](https://app.gitbook.com/o/-Loxl4rmid_XZStTXG0U/s/-MjSwkv4zokqCUebt-98/bob-stablecoin/bob-governance-and-inventory/protocol-governance/gp-3-enable-bobvault-bobswap-for-public-use) and [GP5](https://app.gitbook.com/o/-Loxl4rmid_XZStTXG0U/s/-MjSwkv4zokqCUebt-98/bob-stablecoin/bob-governance-and-inventory/protocol-governance/gp-5-enable-bobvault-bobswap-on-ethereum-mainnet) for specifics related to the deployments on Polygon and Ethereum mainnet.

1. **price** - amount of collateral with value equal to **1 BOB** (18 decimals)
2. **inFee** - proportional fee for buying BOB with given collateral (18 decimals, 1e18 = 100%)
3. **outFee** - proportional fee for selling BOB for given collateral (18 decimals, 1e18 = 100%)
4. **yield** - optional implementation contract for earning yield through lending markets (AAVE)
5. **buffer** - Collateral buffer for tokens to be kept outside of the yield-earning market. This reduces the frequency of deposit/withdraw operations and lowers expected value of the swap transaction gas fee.
6. **dust** - amount of collateral tokens that cannot be withdrawn as a farmed revenue, designed to account for unexpected rounding errors within the yield protocol and accrued permanent losses (if any).

### Optional Yield Implementation <a href="#optional-yield-implementation" id="optional-yield-implementation"></a>

This feature is currently enabled on Polygon and disabled on Ethereum mainnnet. When activated, a portion of the stable assets locked in the BobSwap contract are loaned to AAVE to generate additional revenue for the protocol.There is a buffer of each stable coin kept within the contract to support small stable swaps. If a single swap request is greater than the buffer, a call is made to the AAVE protocol to remove the necessary collateral and return it to the requester in one transaction.Yield implementation may be activated on mainnet and/or undergo parameter updates in the future via a governance process.


---

# 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://bob-docs.zkbob.com/bob-info/bob-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.
