# Godex Wzap

## Before Godex Wzap <a href="#before-odos-zaps" id="before-odos-zaps"></a>

In order to exit a liquidity position and enter a new one, a user must make a minimum of 4 transactions. Below is an example of going from a LP position in Uniswap V2 to another one. For this example, the pools will be WETH/DAI and USDC/UNI

1. Remove liquidity from WETH/DAI
2. Swap WETH for UNI
3. Swap DAI for USDC
4. Deposit liquidity into USDC/UNI pool

During these transactions, the market may move, or slippage may occur, resulting in less than a 50/50 split of assets.

<figure><img src="/files/tMKkpfoCT3U10QeSgnzI" alt=""><figcaption></figcaption></figure>

## After Godex Wzap <a href="#after-odos-zaps" id="after-odos-zaps"></a>

Godex simplifies the process of moving from an LP to another LP, but doing it perfectly and in a single, atomic transaction.

<figure><img src="/files/WF4nZn3JGOuqOQ9KM3ha" alt=""><figcaption></figcaption></figure>

### Supported Pools <a href="#supported-pools" id="supported-pools"></a>

Godex Wzapping supports Uniswap V2 and Solidly style pools, along with minting and burning of Curve LP tokens for StableSwap pools within the core Godex SOR.

### Optimal Rebalancing <a href="#optimal-rebalancing" id="optimal-rebalancing"></a>

Godex strives to distribute your input evenly across a pool’s 50/50 ratio requirement. However, price fluctuations during the transaction can create an imbalance, resulting in a surplus that the pool won’t accept and could be lost. To avoid this, Godex Wzap employ two protective measures:

1. **For standard Uniswap V2 pools**: It calculates the exact swap amount to align your contribution with the current pool reserves, optimizing the use of your funds.
2. **For non-standard pools**: It can return any surplus tokens to your wallet, ensuring you’re only contributing what’s needed for LP tokens.

Since both options will have a small additional fixed gas cost, they will only be performed if the quantity of wasted assets is above a specified threshold.

### Multi-input Zaps <a href="#multi-input-zaps" id="multi-input-zaps"></a>

With Godex Wzapping, users can adjust their investments across several liquidity pools or specific tokens in just one step. This tool is particularly handy for streamlining the process of selling off or reorganizing a set of LP tokens. You can go from many LP positions into a single position or into a combination of tokens.

A summary of what is possible with Godex Zaps:

* Any number of tokens to a single LP
* Any number of LPs to a single LP
* Any number of LPs and tokens to a single LP
* Any number of LPs and tokens to any number of tokens

### Usage <a href="#usage" id="usage"></a>

Godex Wzap are accessible through the API and utilize the same smart contract router as the core SOR service. This commonality eliminates the requirement for additional approvals, minimizing security risks. Existing Godex SOR users can conveniently use Godex Wzap to manage their entry into and exit from liquidity positions with ease.

### Fees <a href="#fees" id="fees"></a>

When using Godex Wzap, the `swapMulti` function on the router is always employed, incurring a fee of 0.01%. It’s important to note that no additional fees are collected from positive slippage when `swapMulti` is used.


---

# 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://docs.godex.ai/godex-trading-engine/godex-wzap.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.
