# 👋Introduction

WOWswap is a 1-click leverage trading & lending protocol that runs on Ethereum, BNB Chain, Avalanche, IoTeX, Solana and Polygon. Buy and sell your favorite tokens with 5x leverage.

Leverage is a financial tool that allows a trader to get a bigger market exposure with a small amount of initial capital. When trading with leverage a trader funds only a portion of a trading position and borrows the rest from external liquidity providers.&#x20;

Although a trader owns only a portion of the leveraged position, the trader’s profit or loss will be based on the total value of the position. Therefore, by trading with leverage a trader can receive a multiplied profit or loss.&#x20;

Not so long time ago leverage trading was an exclusive domain of highly-trained investment professionals. Crypto has changed this forever — currently, all major cryptocurrency exchanges offer margin trading accounts. On centralized stock and cryptocurrency exchanges traders borrow addition capital from brokers and exchange operators who decide on lending rates, fees and procedures for liquidating risky leveraged positions. However, on centralized trading platforms their operators have full control over leveraged trading rules, including decisions on capital lending rates, assets, available for leveraged trading, and liquidation procedures.&#x20;

![WOWswap app launched on April 12, 2021](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiScDjboSEaaE7Uq34%2F-MYiThoLVFK0dNa1oHII%2Fimage.png?alt=media\&token=c2deeb4d-0cd8-4724-ac74-4189cbdeb952)

WOWswap democratizes leveraged trading further by giving all power to the community. With WOW protocol liquidity providers can create and operate common liquidity pools, and traders can borrow these funds for their leveraged trades according to the rules collectively established by WOW token holders.&#x20;

&#x20;In decentralized finance (DeFi) leveraged trading also should be decentralized: community needs to be able to create and operate common liquidity pools and decide on leverage trading rules.

&#x20;WOWswap is a community-run protocol for leveraged trading on decentralized cryptocurrency exchanges. Using WOWswap’s smart-contracts individual liquidity providers operate common liquidity pools, and traders use these funds to finance their leveraged trades on decentralized AMMs such as Uniswap and Pancakeswap.&#x20;

All critical protocol’s parameters such as tokens approved for leveraged trading, liquidation margins, insurance fees, liquidation rewards, lending rates, fees for traders and liquidity providers are collectively decided by holders of WOW token – the protocol’s governance token.


# ❓FAQ

## Is WOWswap secure?

WOWswap has been audited by Hacken and received a ‘secured’ rating.

The full report can be found [here](https://hacken.io/wp-content/uploads/2021/06/WowSwap_03062021SCAudit_Report_2.pdf).

Additionally, WOWswap is secured by Chainlink Price Oracle to prevent on-chain actions based on manipulated price data.

## Can I stake WOW?

Yes. WOW token holders can stake WOW in WOWSwap Governance Module ( WOW DAO) for a period from 14 to 730 days and receive non-transferable xWOW tokens, which are used for voting.

By staking WOW, you will receive WOW DAO rewards from the protocol fees as well as extra WOW emissions. The rewards are distributed proportionally among all xWOW holders, so by selecting a longer staking period you will be entitled for a larger share of the rewards.

21% of the total supply is allocated for rewards, distributed over the course of 8️ years Currently staking and voting is available on BNB Chain.

## What is xWOW token?

To participate in WOW DAO users need votes, represented by non-transferable xWOW tokens, which users get in exchange of staking WOW tokens and/or Pancakeswap LP tokens (WOW/BNB and WOW/BUSD) in the Governance smart contract.

xWOW token is used for voting and WOW DAO reward distribution. Governance rewards are distributed proportionally among all xWOW holders. Staking by itself is sufficient to get WOW DAO rewards, no actual voting is required.

The number of xWOW tokens received for staking Pancakeswap LP tokens is 1.5 times higher than for staking WOW tokens, because obtaining LP tokens requires 2 times more liquidity (WOW + BNB or WOW + BUSD).

Also, the number of xWOW tokens depends on the length of the staking period, during which the tokens will remained locked: the longer the period, the more xWOW are issued for the same number of WOW / LP tokens.

## How does the WOW DAO work?

Users can vote on critical protocol parameters that define the protocol’s security and profitability. These parameters can be changed on-chain with permissionless governance, that counts every vote and adjusts the protocol's parameters without any downtime.

The procedure is fully automated, and parameters are updated instantly. In order to vote, WOW token or WOW liquidity token holders (on Pancakeswap) will stake their tokens to receive xWOW - non-transferable governance tokens.

The scope of WOWswap DAO includes:

* 1\. WOWswap Financial Parameters- defines all major financial parameters of the protocol.
* 2\. Economic Parameters - defines how WOW protocol generates revenue and redistributes it.

## Can I become a WOWswap Keeper to liquidate positions?

Yes. Anyone can become a WOWswap Keeper. No programming skills are required and is done in a few clicks.

By becoming a WOWswap Keeper you can receive Liquidation Rewards, that are decided by WOW DAO.

Here is a simple instruction how to create WOWswap liquidation bot in less than 5 minutes! <https://github.com/wowswap-io/liquidation-bot>

The liquidation bot will not be installed on your laptop/desktop but on a cloud-based application platform Heroku. Heroku will charge $7/ month per bot per network, so if you want to run liquidation bots both on BNB Chain and Polygon you will pay $14/month. Also, to call liquidation transactions you will need to have just a little bit of BNB/Matic on your liquidation wallet to cover the costs of gas.

## Where can I trade WOW?

1. **WOW is tradable on WOWswap.**<br>
2. **Pancakeswap exchange in WOW/BNB and WOW/BUSD markets**\
   \
   To trade WOW on Pancakeswap please enter the BNB Chain WOW token contract \[0x4da996c5fe84755c80e108cf96fe705174c5e36a] into 'to' box on Pancakeswap exchange.<br>
3. **Quickswap exchange in WOW/USDC market**\
   To trade WOW on Quickswap please enter the Polygon WOW token contract \[0x855d4248672a1fce482165e8dbe1207b94b1968a] into 'to' box on Quickswap exchange.

## What tokens are available for leveraged trading?

WOWswap launched with the top most liquid tokens on PancakeSwap, Quickswap and MDEX for up to 5x leverage trading.

**Tokens available on BNB Chain Network**:  BNB, BAND, CAKE, DOT, UNI, YFI, BIFI, WOOP, UNFI, ALPHA, XRP, BRY, ADA, ATOM, ETH, BTCB, AUTO, XVS, SFP, TWT, SXP, LINK, FIL and LTC and continuously adding more.

**Tokens available on Polygon Network**: ETH, wBTC, CEL, MATIC, LINK, AAVE and continuously adding more.\
\
**Tokens available on HECO:** AAVE, BCH, BTC, COMP, DOT, ETH, FIL, HT, LTC, MDX, SNX, UNI and continuously adding more.

Later the community of WOW token holders will be able to vote to add any token for trading on WOWswap.

## How to participate in the WOW token public sale?

The public sale is now finished.

140,000 tokens were sold on February 25th at $5 USD per WOW token.

## How will the token sale funds be used?

In order to bootstrap an initial liquidity for leverage traders and accelerate the development of the protocol we decided to make a public token sale.

To promote and bring adoption to the WOWswap protocol 90% of the total raised funds will be used to provide liquidity on PancakeSwap, protocol development, marketing, audit and for BNB lending pool. 10% will be kept as a reserve for a further expansion of the protocol:

Details:

* $400,000 for BNB lending pool to enable leveraged trading;
* $200,000 for continuous protocol development;
* $200,000 for marketing;
* $150,000 to bootstrap liquidity on PancakeSwap;
* $50,000 for smart contract audits;
* $105,000 kept as reserves.

## How will community tokens be distributed?

55% (550,000) of the total token supply will be distributed to the community.

**Community tokens** will be distributed to the protocol’s users over a period of 18 months. The preliminary plan is as follows:

* 250,000 tokens will be distributed to liquidity providers
* 100,000 tokens will be distributed to leveraged traders
* 50,000 tokens will be distributed to margin callers
* 200,000 tokens are reserved for marketing activities, community contests, bounty campaigns, white hacking rewards, and airdrops.

## What are the protocol fees?

The protocol charges 5% of net profit made by traders, calculated in BNB.

For example, if a trader buys a token for 10 BNB with 5 X leverage (50 BNB in total) and the token’s price increases by 20%, then the trader’s gross profit is 1.250 – 40 BNB (borrowed) = 20 BNB. Suppose, the cost of capital was 0.5 BNB, so the net profit will be 19.5 BNB. The protocol fees will be 0.0519.5 = 0.975 BNB.

50% of this amount will go to the insurance fund (0.4875 BNB), and another 50% will be spent to buy and burn WOW tokens.

## What is the insurance fund?

The insurance fund is the protocol's native fund to mitigate possible losses for liquidity providers.

We do our best effort to make WOWswap as safe as possible, but in case of a black swan event some trades theoretically can be liquidated below the liquidation price. If it happens, insurance fund will be used to cover the losses of the liquidity providers.

In the future, WOW token holders will have a right to manage insurance fund's assets and may decide to use part of the fund for investments.

## What is the Hourly Interest Rate?

Every time a trader opens a leveraged position, BNB is borrowed from the BNB lending pool to buy a token with leverage. To borrow BNB a trader needs to pay interest, which is commonly represented by APY.

However, since margin traders do not keep their positions for too long and the lending pool's utilization rate can fluctuate throught the day it is not very practical to use APY. Instead, we introduce Hourly Interest Rate. This rate gives a much better understanding to the trader about the cost of capital. Once a leveraged swap is complete, the HIR will be fixed for this swap until the trader interacts with it by buying more tokens or selling a part of them.

For example, if HIR = 0.1%, a trader who borrows capital just for 1 day will end up paying “only” (1+0.01)24-1 = 2.43%

Paying 2.43% interest for 1 day might seem like a lot, but if the token the trader bought grows 20% on the same day, with 5X leverage he will make 90% net profit (after repaying the loan with interest). For instance, let's assume a trader has $100, and borrows $400 to buy a token for $500. After a 20% price surge he will have $600. However, he needs to pay back $400\*1.0243 = $410 to the liquidity pool, so he is left with $600-$410 = $190. The net return for this trade will be ($190-$100)/$100 = 90%.

## I bought a token on WOWswap, but received a proxy-token instead. What is a proxy-token?

WOW protocol uses proxy-tokens to enable leveraged trading & liquidation mechanism.

The proxy-tokens are pegged 1:1 to the underlying tokens and are held by WOW’s smart-contract on your behalf. Every time you sell proxy-tokens, WOWswap automatically converts them to the underlying tokens, swaps them on Pancakeswap, and sends you the funds.

## How will WOW governance work?

Users can vote on critical protocol parameters that define the protocol’s security and profitability. These parameters can be changed on-chain without any human intervention. The procedure is fully automated, and parameters are updated every 24 hours. \
\
In order to vote, WOW token or WOW liquidity token holders (on Pancakeswap) will stake their tokens to receive xWOW - non-transferable governance tokens.

xWOW token is used for voting and Governance reward distribution. Governance rewards are distributed proportionally among all xWOW holders. Staking by itself is sufficient to get Governance rewards, no actual voting is required.&#x20;


# 🤓Functioning of WOW protocol

WOWswap is a 1-click leverage trading & lending protocol that runs on Ethereum, BNB Chain, Avalanche, IoTeX, Solana and Polygon. Buy and sell your favorite tokens with 5x leverage.

WOWswap is a fully community-owned protocol based on a simple idea: liquidity providers can create a liquidity pool , and traders can borrow these funds to buy up to 5 times more tokens. Protocol fees, interest rates for lenders and borrowers, liquidation ratios and other settings are decided by holders of WOW tokens — our governance token.

Making a WOW swap is as easy as making a regular swap on Uniswap or Pancakeswap — extra capital will be automatically borrowed from the liquidity pool.

In the example below with 1 BNB you would be able to buy your favorite token for 5 BNBs, so you will receive 5 times more tokens

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYhYojbuuYVwA5kmL6C%2F-MYh_H-Xrb4aWa7gFhJT%2Fimage.png?alt=media\&token=5d235490-10b7-4676-bd15-e3a3b8c754a2)

Instead of the original token you will receive a proxy-Token (for example, if you bought CAKE you will get prxCAKE tokens), which is pegged 1:1 to the original in WOWswap’s smart-contract. Proxy-Token will be converted back to the original token when you decide to close your trading position.

If the price of your token goes up, you can swap proxy-Tokens back to BNB and receive a multiplied profit. In this case a 5% fee (set by community) of your profit will go to back to the community via the insurance fund (2,5%) and token buy-back and burn 🔥 (2,5%).

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYhYojbuuYVwA5kmL6C%2F-MYh_98CUktiKAug8xbe%2Fimage.png?alt=media\&token=c7b8184e-72ae-48ee-b5a1-38b2b7e8618c)

If the price of your token goes down below the liquidation threshold, then anyone can become a margin caller by triggering the liquidation of your trading position — in this case you will loose all collateral invested in the trade.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYhYojbuuYVwA5kmL6C%2F-MYh_XhugtjrkQZHRvbF%2Fimage.png?alt=media\&token=08256877-f68a-428c-9921-5a8aa052a978)

The BNB pool will still receive back borrowed funds plus the accrued interest, and the margin caller gets the rest of the funds as a reward.

## Chainlink Integration

WOWswap uses Chainlink Price Feeds as our go-to oracle mechanism to prevent on-chain actions based on manipulated price data. It ensures protection against any potential data manipulation attacks that are funded by flash loans.

WOWswap V2 allows buying a token with leverage if its AMM-based price is less than 102% of the Oracle’s price.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MafW0UJQipPiiI0yfeE%2F-MafXoY9ZWeRlok8JEt1%2Fimage.png?alt=media\&token=5174eb2d-988e-4454-87d0-17262bbd3f85)


# 📉Leveraged short-swap

At WOWswap, we built the simplest way to make 5x leveraged shot-swaps. When you short a token, you loan it from someone and immediately sell that token: Short = Borrow + Sell.

If the token’s price goes down, you buy it back later for a cheaper price, return the loan, and keep the profit.

## **Short-swap functioning**

Let’s assume that token **A** is currently traded on Pancakeswap at $10, and you decided to short it for 100 BUSD (your money) with 5️X leverage. It means that you will borrow **A** token for 500 BUSD (50 tokens). On WOWswap you will borrow these tokens from the lending pool, created by individual liquidity providers who deposited **A** tokens to the lending pool.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MfBTBxLWtQtF5XkXZio%2F-MfBU5mfHPOVXdQCLNsG%2Fimage.png?alt=media\&token=f68651da-b829-4f32-8563-83e741549bc9)

When you make a short swap you will sell 50 borrowed **A** tokens and receive revenue of 500 BUSD. This revenue + 100 your BUSD (600 BUSD in total) will become a collateral for your short position.

Since you borrowed **A** tokens you need to pay interest on your loan. So let’s suppose that after some time your payable interest becomes 10%, so now you owe 55 **A** tokens to the pool.

However, if A-token’s price drops to $8 per token, your position’s value will be:

&#x20;`$600–55*$8 = $160`

&#x20;Since you invested only $100 of your own money your net profit will be $60 or 60%.

## Liquidations

{% hint style="warning" %}
**I**f the price of the token you shorted goes up you can have a multiplied loss, or even loose all the capital invested in the trade position.
{% endhint %}

In case of shorting, a liquidation happens if:

`Collateral < Liquidation price * Number of tokens * (1 +Liquidation margin)`

In the example above, you shorted 50 tokens, while having a collateral of 600 BUSD, so assuming liquidation margin of 5% (decided by the DAO participants) the liquidation price at opening will be:

`Liquidation price = $600/50/(1.05) = $11.43`

It means that if **A** token’s price rises from $10 to $11.43 your collateral might not be enough to buy back **A**-tokens from the market to pay the loan, and this position shall be liquidated by a keeper.


# 💸Lending (Earn)

When a trader opens a leveraged trading position (long or short), the trader takes a loan from the liquidity pool at a current Hourly Interest Rate (HIR). Therefore, to make leveraged trading possible Liquidity Providers (LP) need to maintain enough liquidity in liquidity pools. Anyone can become a liquidity provider by supplying liquidity to the liquidity pools.

WOWswap V2 has two single-asset liquidity pools on BNB Chain (BNB and BUSD), 3 single-asset pools on Polygon Network (MATIC, ETH and USDC), 2 on HECO (USDT and HT), 2 on Avalanche (USDT and AVAX), two on IoTeX (BUSD and IOTX) that are used for opening long positions.

For short positions there are as many tokens for lending as there are tokens listed on WOWswap. In this case, liquidity providers lend tokens to shorting.

When a user deposits asset to a liquidity pool, he/she will get interest-bearing tokens representing the liquidity provider's share of the pool. For example, by depositing BNB or BUSD to liquidity pools, the LP gets ibBNB or ibBUSD tokens.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2F1NmJV7y3sPtNtnhdJDbD%2Fimage.png?alt=media\&token=533b3ddb-cef8-41ee-9fc6-a4030ffbc507)

When a LP wants to withdraw the liquidity from the pool, the LP should convert ibBNB or ibBUSD tokens back to BNB or BUSD.&#x20;

{% hint style="info" %}
&#x20;Please note, that the exchange rates of ibBNB/BNB and ibBUSD/BUSD are supposed to be growing over time, so when you supply liquidity they will not be equal to 1.
{% endhint %}

Under normal conditions, if a LP kept the liquidity in liquidity pools for some time, so that traders borrowed and repaid their loans, the LP can expect that the same amount of ibBNB/ibBUSD tokens will convert in a bigger amount of BNB/BUSD. However, in case loss-making trades were not liquidated on time, liquidity pools might incur losses, and ibBN/ibBUSD tokens will convert in a smaller number of BNB/BUSD.


# 🚨Liquidation

In general, liquidation of a trading position can happen as a result of the following 4 events or their combinations:&#x20;

* The price of a token A that a trader bought decreased.&#x20;
* The price of a token B that a trader borrowed to make a leveraged swap increased.&#x20;
* The position was open for too long, so the value of the debt taken for the position approached the value of the position.&#x20;
* WOWswap’s community significantly increased Liquidation Margin parameter via Governance.&#x20;

A liquidation event cannot happen by itself, it should be triggered by a margin caller – a person or a company that runs special software capable of tracing numerous leveraged trading positions and making timely liquidations.&#x20;

Anyone can become a margin caller by running the liquidation software provided by WOWswap. In case of a successful liquidation, a margin caller receives a liquidation reward, calculated as a percentage of the total position size. The liquidation reward is defined via the Governance.&#x20;

When a margin caller makes a liquidation transaction, WOWswap’s smart contract verifies whether the liquidation condition is satisfied, and, if so, proceeds with the liquidation. During the liquidation, all parties are paid according to the following order:&#x20;

1\. the margin caller gets a liquidation reward (LR)&#x20;

2\. then the liquidity pool receives the debt with accrued interest&#x20;

3\. if any funds are left, the trader receives the rest of the funds.


# 💹Portfolio Page

After successfully swapping any token available on WOWswap your position information will be available in the portfolio section.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FhcWO20PyM9Hk1DGKfqlZ%2Fimage%20456%20\(1\).png?alt=media\&token=2f5d2e15-4c55-4cbe-ad23-9cf8519e7ad1)

The portfolio will show your current position size in the token you bought and its value in BNB or BUSD on BNB Chain and ETH or USDC on Polygon Network. The debt is shown in the asset you borrowed for the leveraged trade with the Hourly Interest Rate displayed below. The net value is the position size minus debt.

Your position health is shown in percentage. The higher the percentage, the lower the liquidation risk. When the health falls to 0% your position is liquidated.

The portfolio page also shows if you had set Stop Loss or Take Profit limit orders.

{% hint style="info" %}
To increase position's health, users can open a new 1x position for the same token and it will merge with already open position.
{% endhint %}


# 💲Hourly Interest Rate

In DeFi we always talk about APY — Annual Percentage Yield. However, while the APY you see on your bank’s account gives you a good idea about future profits, APYs you find on liquidity mining websites just do not make any sense: they might vary from 130% to 5000% to 20% — it’s impossible to rely on those numbers if you want to forecast your actual returns.

In WOWswap we like simplicity and precise math. Therefore, we took a new approach and introduced **Hourly Interest Rate (HIR)**. Our target users — degens who want to buy promising  tokens with 5X leverage — do not care too much about the cost of capital, because they won’t keep their long positions for too long: maybe a few days, or even hours if the market is up. For example, if HIR = 0.1%, a trader who borrows capital just for 1 day will end up paying “only” (1+0.01)²⁴-1 = 2.43%

Paying 2.43% interest for 1 day might seem like a lot, but if the token you bought grows 20% on the same day, with 5X leverage you will make 90% net profit (after repaying the loan with interest). For example: let’s assume you have $100, you borrow $400 and buy a token for $500. After a 20% price surge you will have $600. However, you need to pay back $400\*1.0243 = $410 to the liquidity pool, so you left with $600-$410 = $190. Your net return for this trade will be ($190-$100)/$100 = 90%.

Now, let’s see the system from the perspective of liquidity providers: if many traders frequently borrow and return capital to the liquidity pool, 0.1% HIR would be equivalent to 619,485% APY. &#x20;

Of course, the actual “realized” APY will be lower, because we did not take into account the average utilization rate of the pool and it can’t be always 100%. For example, if the pool’s utilization rate is 50%, it means that only half of the pool’s capital is generating compounding profits, which then will be divided by the total pool’s size to calculate the realized APY.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiB_6oTmmjNMhFJ-nx%2F-MYiCX892TZOzXabhC2y%2Fimage.png?alt=media\&token=faf21dd9-d8c8-4b0f-9919-c369ebf5aac3)

Hourly Interest Rate for a particular swap depends on the lending pool utilization rate (PUR) and the initial leverage (IL) of the swap. The logic behind is as follows: a higher Pool’s utilization rate should incentivize liquidity providers put more liquidity to the pool, so the HIR should increase when the pool utilization rate grows. Also, the higher initial leverage for the swap, the higher risk this swap brings to the liquidity pool and this risk should be adequately compensated.


# 💰Insurance Fund

We make the best effort to make WOWswap as safe as possible for everyone, but in case of a black swan event some trades theoretically can be liquidated too late, so to mitigate possible losses for liquidity providers the protocol builds up the insurance fund, which receives 2.5% of every swap’s net profit.

If a token’s price drops significantly below the liquidation price of a particular swap, then, after liquidating this swap, the liquidity pool might incur a loss. Since token prices can change dramatically as a result of one sale transaction or within one block, it is technically impossible to liquidate all leveraged trading positions without losses.&#x20;

Therefore, WOWswap protocol created an internal insurance fund, which receives a small portion of profit from every profitable leveraged swap and uses these funds to cover losses caused by certain liquidated swaps.&#x20;


# 💱Fees

The protocol charges a percentage of net profit made by traders, calculated in BNB. The fee is decided by WOWswap Governance.

Let suppose that a net profit fee is 5%, and a trader buys a token for 10 BNB with 5 X leverage (50 BNB in total). If the token’s price increases by 20%, then the trader’s gross profit is 1.2*50 \* 50 – 40 BNB (borrowed) = 20 BNB. Suppose, the cost of capital was 0.5 BNB, so the net profit will be 19.5 BNB. The protocol fees will be 0.05*19.5 = 0.975 BNB.

50% of this amount will go to the insurance fund (0.4875 BNB), and another 50% will be spent to buy and burn WOW tokens.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MafV9OgFhvA3nidCr2k%2F-MafVrYR4jxrGsSY8jmd%2Fimage.png?alt=media\&token=77ef383a-18dc-4fe2-b66f-688e32a1dad6)


# 📊Trading overview on WOWswap

Unlike margin trading accounts on centralized exchanges, WOWswap has an extremely simple interface: just select a token you want to buy for BNB or BUSD on BNB Chain, and ETH or USDC on Polygon Network and move the leverage slider to the right to set the leverage coefficient 😎

For more professional experience users can choose to use WOWswap Pro.

Leverage can vary from x1️ (no leverage) to x5️ (maximum leverage). At launch for a few days the maximum leverage is set to x3️— this constraint will be removed shortly.

## Opening a leveraged position

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FtOwRPBCYK1AfkfwwrSBa%2FGroup%201390.png?alt=media\&token=ca586e05-1986-49c5-9a8e-3b06054f7ba0)

When you buy a token with leverage you finance only a portion of the purchase with your own capital — the rest of the funds you borrow from a liquidity pool. In the lower part of the swap screen you can see information about your loan and Hourly Interest Rate (HIR).&#x20;

Offered HIR depends on the utilization ratio of the liquidity pool and the leverage coefficient set by you. However, once you make a swap, the HIR for this swap will remain constant until the position gets closed or is liquidated.

After you complete a swap you will get “proxy-tokens”, which are pegged 1:1 to real tokens held by WOW smart contract on your behalf. Proxy-tokens are needed for the protocol to guarantee the repayment of your loan once you sell proxy-tokens back for BNB or BUSD: the protocol will change proxy-tokens to real tokens, exchange real tokens for BNB/BUSD on Pancakeswap, repay the loan to the liquidity pool and transfer the rest of the funds to you.

{% hint style="info" %}
*If you buy more of the same token, your new purchase will be merged with the previous one, and the balance of your proxy-tokens will be summarized. Also, your existing loan to the liquidity pool will be merged with a new one. Finally, the HIR for the combined loan will be updated as a weighed average of interest rates for both loans.*
{% endhint %}

## Closing a leveraged position

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FeTtpwjdIGnksGq9woVBm%2FGroup%201389.png?alt=media\&token=ec9a4443-7772-4f71-806c-d18940a66e14)

If you want to close your leveraged trading position you can simply press on any arrow down ⬇ or manually select tokens for a swap. Please, note that in version 1 you can only sell tokens for the same currency that you bought them for.

When a trader closes a leveraged trading position, WOWswap performs the following actions:&#x20;

1\. sell underlying tokens on Pancakeswap, Uniswap or any other supported decentralized exchange;&#x20;

2\. repay the trader’s debt with interest to the liquidity pool;

3\. calculate the trader’s net profit and, if any, takes a profit fee;&#x20;

4\. return the rest of the funds to the trader;&#x20;

5\. burn a corresponding amount of proxy-tokens owned by the trader.

## Opening a position on WOWswap Pro

WOWswap interface is minimalistic and is extremely easy to use. In fact, opening leveraged short or long position takes just 1-click.

Yet we recognize the demand for more professional trading experience that gives you the most options and control of your assets.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FAEJzI0F0pU3vnQ4aMyMb%2Fimage.png?alt=media\&token=c79844a9-9e7d-4b20-b1e4-ebda88ac8b98)

Opening a position on WOWswap Pro is similar to the original WOWswap.&#x20;

\
To open a long position just move the slider to the right. To open a short position move the slider to the left.

Besides the different design, WOWswap Pro brings the following improvements:

📈Always on chart for all assets supported on WOWswap for a professional analysis when to open and close a position.\
👌Monitoring and managing all the opened positions, debt level, liquidation price & health in one page.\
👍Liquidation price is displayed before opening a position.\
🤑Display of daily gainers & announcements.\
🦊Set limit orders before you open a trade.

## Example of a leveraged position

Let's imagine a situation that a trader buys $CAKE tokens through WOWswap for 300 BUSD at the price of 10 BUSD per $CAKE. Let’s also assume that for this swap the trader uses own capital of 100 BUSD with 3x leverage, which mean that the trader borrows additional 200 BUSD from the liquidity pool. As a result of this swap the trader should receive 30 $CAKE tokens. However, since the trader owns only a part of the trading position, the trader receives 30 proxy-CAKE tokens, while 30 real $CAKE tokens are held by the protocol as a collateral against the 200 BUSD loan given to the trader.&#x20;

Using the following formal definitions, let’s calculate CAKE’s liquidation price at the time of the swap:&#x20;

CP – Current token price ($10)&#x20;

N – Number of tokens (30)&#x20;

CV = CP \*N – current value of tokens ($300)&#x20;

UF – User’s own Funds ($100)&#x20;

D – Total debt for this swap position ($200)&#x20;

IL – Initial leverage factor (3) \
`𝐼𝐿 = (𝑈𝐹 + 𝐷)/𝑈𝐹`&#x20;

LM – Liquidation margin (for example, 3%). Liquidation margin is a “safety buffer”, which also includes a reward for a margin caller, who triggers the liquidation. The liquidation margin can be changed via the governance at any time.&#x20;

LP – Liquidation price:

`𝐿𝑃 = (100% + 𝐿𝑀)*𝐷/𝑁`

At the time of the swap (while the interest on the loan has not yet accumulated), the position liquidation price (CAKE’s liquidation price) can be calculated as follows:&#x20;

`LP = (100%+3%)  $200/30 = $6.87`&#x20;

This means that if $CAKE’s price becomes $6.87 or lower, the whole trading position will be liquidated, and the trader will lose all (or almost all) capital invested in the trade. In our example, if $CAKE’s price drops to $6.87 immediately after the swap then upon the liquidation the protocol receives revenue of $6.87  30 = $206.1.&#x20;

After paying back $200 to the liquidity pool, the margin caller gets a reward of $6.1. Since in reality all debts accumulate interest, the liquidation price will be also growing over time.&#x20;

Now, let’s imagine that $CAKE’s price rises to 15 BUSD per $CAKE and the trader decides to buy more $CAKE tokens for 150 BUSD with 2X leverage, by borrowing additional 150 BUSD from the liquidity pool. At the current price for 300 BUSD the trader will buy 20 $CAKE tokens. Once again, the trader will receive 20 proxy-CAKE tokens, while leaving 20 real $CAKE tokens to the protocol as a collateral.&#x20;

To avoid having multiple trading positions for the same token, WOWswap will merge the new trading position with the previous one. Let’s assume that by the time of the second trade the first 200-BUSD loan accumulated 20 BUSD as interest. In this case, the total debt of the trader will be 200 BUSD + 20 BUSD + 150 BUSD = 370 BUSD. At the same time, the total collateral against this loan equals to 50 $CAKE tokens, which current value is 50\*15 BUSD = 750 BUSD. $CAKE’s liquidation for the merged position also will be updated as follows: 103% \* $370/50 = $7.62.


# 👍Opening a trade

Trading on WOWswap is very easy compared to most exchanges. You aren't going to be overwhelmed by charts or jargon, and calculations are all handled for you.

## Setting up your wallet

Before you can trade, you will need one of the BNB Smart Chain, Avalanche, Polygon or any other WOWswap supported blockchain and connect the wallet. You will also need to have some supported tokens to trade with.

## Making a leveraged trade

1. Go to the exchange page [here](https://wowswap.io/swap).
2. Connect your wallet to one of the supported chains by clicking Connect to a Wallet (you can also Connect in the top right-hand corner).

![](https://lh3.googleusercontent.com/kYBqITBY_MuuBNvi1gBMbKGUdwFVI_VPUZrFT8z2y1GRt7-396VVtzjfgamfODUIJyq-bXz4JEqm2ZozxYSohbu8KyOPeIsSlxl5dBPBPMc5MIr2_V-ZJyASf3XOKPFqdTbM01Lo)

**3.** Select your **long** or **short** trade.

![](https://lh6.googleusercontent.com/o3Lvs2dBBqbs95BtajjJyDnaGHj0DNhQqProL1wd3poBsiH_a4RgJeJzVGEMXr49E86SC1eJTQNTe4PbdRnqriAJAtZG7wdWTyYjB01Tr4cdjx2ViCHkUaZcp8cl8ccid86aAsGL)

4\. Choose the token you want to trade from the dropdown menu in the "From" section.

![](https://lh3.googleusercontent.com/Fpc80iiB58751EFg15QxcPoH-eibzEEXVCYaz0v2hfJW2mfJdgrh2eiv0F9oB8CG75P45Pn5XyEIc-tAsW1c-tzbycvBLCEGweMlnWhQXSnfBZh28GzzYjYFnqUh5tpaTll_Z4Tw)

Whichever token you choose, you will need to make sure you have some to trade with. Your balance is shown above the token dropdown menu.&#x20;

5\. In the settings, when you click on the gear above the token selection field, you can select the slippage you want and the time for the transaction.

![](https://lh3.googleusercontent.com/GNz0_Cnil0pZPUt8zGo-ruhIdo8YEODgPM9TyjJvuW6MWOODtpJ9COVJu1e8ChnLBb6WiXWFXJjScinQ_XFjIQ6G4KBKWhvNmPPW5JPNhCVYVucq3MNr9YHUUY58U5IHxMEENhlH)

6\. Choose the token you want to trade to in the "To" section as above. Next, type an amount for your "From" currency by clicking inside the input box.

7\. Next, you can set the leverage you want by dragging the slider to the desired value. Your "To" currency amount will be estimated automatically.

![](https://lh6.googleusercontent.com/1WTHozjdHjd_5PDew83hLjZ5rs8qDH3M5nqRoMZKnQI-cPUAhm96MQdbKN8krbJdV_8eILGGDNmSf2lKJGjWVU-g7i77Uo1hvDdPmJlvnD3avroXlrT0gZBebspFnaR2Ln2_mGq7)

8\. Check the details, and click the **Long Buy** button.

![](https://lh3.googleusercontent.com/rNImt8eyOAKPa-sXl59H4IA1ULVnbAamH0hZpH3B99T5HbwhUIl292mGcsR2dSaGyEZRxse3L_ZxQ6QlG3XQl8CbVvuU_-3SNlXYgTOBeerVTmo5PoLnJy6y0r5qTu0as-m62Cpk)

A window with more details will appear. Check the details are correct.

![](https://lh5.googleusercontent.com/gg--uhL_2SmEdIkuL1wl-xUVJJEFYzQ_EbORD_l95Mu7int29B8wI_npL1pPlhD-lpuouBEYtyGqhp0MFCT9uyBZfMg98t3sstFcwZx5JjnmBZPSTsiv5m4BK9Og8pR3xSYSVKiJ)

9\. When you are ready, click the **Confirm Swap** button. Your wallet will ask you to confirm the action.

10\. Done! You can click **View on explorer** to see your transaction details on the explorer.

![](https://lh3.googleusercontent.com/s4xRo6zWW9To3Cvzxnge3N731dCONl0w0GghXgBHZ386leUAZtdE5DJ5_QKnhst8pVMWtc9wuxa8XmeEP_QBCCUVAAg8hpwh8chRYCgpJTayo_-mG3GFlamB4y-dQtkG8tou2Y6Y)

11\. Click on the "**Portfolio**" button in the header and track the deal.

![](https://lh5.googleusercontent.com/kMT2gAyOXRWxkhITWd7u4x-neMOyvYbwWXmvu109KE-E5ksJ9uOTORDFj1OR_oKZNJ1tah41Hykhkdv8kng37XK144xtYD1mI0FFymtgnjL-IA1fshWeaCxRAq9c0Y7R-G3lkdIe)

A deal on a short position works the same way.


# 😮How to stake WOW in Governance

By placing WOW tokens in staking, users are rewarded proportionally between all xWOW token holders that they receive in exchange for the tokens placed in staking.

Users can also use these tokens to participate in protocol changes. Participation in protocol changes is optional. The mere presence of xWOW tokens already means that users will receive rewards.

## Getting ready to stake

1. Go to the exchange page here.
2. Connect your wallet by clicking **Connect to a Wallet** (you can also Connect in the top right-hand corner).

![](https://lh3.googleusercontent.com/p-FuI9ehyyiREV6_vC-NJjMOB491uP5Wl30WIOP7F54mapkgfpi4RG6t4TtdejwoN0edOgjsZsB8yySC26BSnlVKOk6nCGqiQ3GkboHL-D1sAQQG_feAfi-rfXYdLKf7nybD_fqU)

3\.  When you have connected the wallet, press the "**DAO**" button.

![](https://lh6.googleusercontent.com/BSLyl7J2ThqFziGs_rpeZOTEVwM_sPlrypUnsokZkFK_VQNHpWD8IjR4YUPpcfCcNpGbLQbcy7vjw_rWACfB_mvVYokFgGMNbEppFMIVZT4-R7BhK7fS9a_4ww1ja_yB0ho6wIGJ)

On the page that opens, you will be able to see the current percentages for staking WOW.

4\. You need the bottom window to add tokens to staking. Choose the token you want to **staking** from the dropdown menu in the "From" section.

![](https://lh4.googleusercontent.com/8Epba2kv1xdRVCLudZFIygLapv7fxNHIFFANiRPJvbk9QmCviykHQiHlDCFTiRl6L5ooQZQBJep5_cfQ8xK4j_4CzCYyGzoj8CqkV0WGrLi34HYKLFqIQAnqmYv91m2Fma1IK2m5)

Whichever token you choose, you will need to make sure you have some to staking. Your balance is shown above the token dropdown menu.

5\. Specify the desired **stake period** using the slider bar.

![](https://lh3.googleusercontent.com/iAc25G2uS94q2XMPoQm4yo0pg2S_raP8nHI6r-ml6eC89eeDSOh2q8kAfOGCrTELW9icmbvotBoNKsCWAZ50HBX6sfsrZMs6yfr7Vs3Q_NJ2tgH_SgcP7vMmNuzKOt19mz3D8s94)

The number of tokens from the "To" section that you get will be automatically calculated like and the APY.

![](https://lh3.googleusercontent.com/V8njCQe0AHwhZAYg-xyLOqxj7JGQ-h7vrhuuWrvqXXuumqwVQvxqekkFLX1TiwRb6hMfNSYMtt9l-4-x4T_ES4N0MiyYe4bSgcsNP5zu_wOHx2H2tTIlrfDyh4tAEKBXs2Y0EZeL)

6\. Check the details, and click the **Stake** button.&#x20;

Confirm the transaction on your wallet. \
![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FZSpp6n3zkoG2T0EgD43d%2Fimage.png?alt=media\&token=7b9360fb-877b-4d78-a474-4bcd1a689a0d)

7\. Done! You can click **View on explorer** to see your transaction details on an explorer.

![](https://lh3.googleusercontent.com/8y3lZjADENdkmkBe3lWkFNFwPBotPT3nDbm_KxbiJ0qnN1UtpetwKR3ghPNFfG5P71Jncf06S8QkNADpTy8zckJQzRmsvGpHw82Xwrcp48GLrIGZdmgcWXoRTzKAH-oGGtoQZzgN)

8\.  On the left side of the window, you can track the statistics of the tokens you have added to the staking.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FQw3ltDB4MJCXXPmhrqcH%2Fimage.png?alt=media\&token=8c6a6b83-4aa6-40bb-b980-aa03fe28a3ba)

When you receive the reward you will see it in the window below.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2Fwg8XBMDzcUd5e5W4nJRM%2Fimage.png?alt=media\&token=5d3545c9-e5ff-4ace-b693-849ff7b9f167)

9\. Click **Claim All** to get rewards to your wallet. Your wallet will ask you to confirm the action.


# ⛓Depositing Assets to Polygon and Connect to WOWswap

Users can deposit Ethereum tokens to the Polygon Network via [Matic Bridge](https://wallet.matic.network/bridge/) using Metamask and then, if needed, withdraw them back to the Ethereum mainnet. You **will need some MATIC tokens**, because the MATIC token is used to pay transaction fees. You can purchase [MATIC on Uniswap](https://app.uniswap.org/#/swap?inputCurrency=0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0\&outputCurrency=ETH).

Before you start, make sure you have added Polygon Network to Metamask.

#### Connect MetaMask to Polygon Custom RPC

You need to configure the Matic Network custom RPC in your MetaMask.&#x20;

* Click on the network selection button at the top of the app.
* Click on the “Custom RPC” to add the Polygon mainnet information.
* Select ‘Custom RPC’.

![](https://cdn-images-1.medium.com/max/800/0*UnLHpdNMm4cyJkFq)

Enter in the Matic mainnet details as follows:

> **Network Name:** Polygon

> **New RPC URL:** [https://rpc-mainnet.matic.network](https://rpc-mainnet.matic.network/)

> **Chain ID:** 137

> **Symbol:** MATIC

> **Block Explorer URL**: <https://explorer.matic.network/>

#### Deposit Ethereum assets to Polygon

***Ensure you are using the POS Bridge and NOT the Plasma Bridge. The Plasma takes up to a week to transfer funds. The POS will take 7–8 minutes.***

1. Go to <https://wallet.matic.network/> and connect Metamask.

![](https://cdn-images-1.medium.com/max/800/1*4G_goWG9whVir3hzwYwRXQ.png)

2\. Clicking the Metamask button as shown above will prompt a signature request. Click on ***Sign***.

![](https://cdn-images-1.medium.com/max/800/1*Zn7PCwv5ZonhXVHyfq4Etw.png)

3\. For moving funds to Matic, click on “***Move Funds to Matic Network***” as shown.

![](https://cdn-images-1.medium.com/max/800/1*v97izQRHjwcHD3VN6LimBg.png)

4\. Once you have done that, the ***Matic POS Bridge module*** will open on the wallet as shown below. The token shown by default on this transfer module will be ***Ether***. You can choose to move other tokens by clicking the arrow. For this example, we will move 0.01 ETH.

![](https://cdn-images-1.medium.com/max/800/1*X7p_xvpyp5ah1yUHRfTS_Q.png)

5\. Click on **transfer**. The system will show a warning message for you to read. Click on ***Continue***.

![](https://cdn-images-1.medium.com/max/800/1*dXClPQMQMBGcm64da1GfYA.png)

6\. The next window will show the estimated costs of moving the funds. Please note, that **depositing ERC-20 tokens will require an additional transaction to ‘Approve’** spending the token. ETH does not need an approval and is cheaper to migrate.&#x20;

![](https://cdn-images-1.medium.com/max/800/1*_j0e9L0HpVkvX3WxcEuWfg.png)

7\. Make sure once again that PoS Bridge is selected, then click Continue. Metamask pop up will open and click ‘Confirm’.

![](https://cdn-images-1.medium.com/max/800/1*dDgHFheR6dqfe_2ArTqMmw.png)

8\. Once you confirm, the system will take around 7–8 minutes on the Matic POS Bridge to move your funds from Ethereum to Polygon.&#x20;

![](https://cdn-images-1.medium.com/max/800/1*9nUsV5865QnajLIvLFoKlA.png)

That’s it! 🎉

Right now you can go to wowswap.io to trade on Polygon. To switch the network from BNB Chain to Polygon, simply click the network button at the top right corner. Make sure the correct network is selected on Metamask.


# 🤖Set Stop Loss and Take Profit Orders

Limit orders are available for both versions of WOWswap: WOWswap Pro and the original WOWswap.

To turn on Limit Orders, simply toggle the On/Off button and options to set Stop Loss and Take Profit will appear.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FiRUetAkONkCrCmZN0kIZ%2Fimage.png?alt=media\&token=e49c16a4-6cd5-4807-8382-198e9a3a88a4)

📈**Take Profit** specifies the exact price at which to close out an open position for a profit. If the price of the token does not reach the limit price, the take-profit order does not get filled. Learn more [here](https://www.investopedia.com/terms/t/take-profitorder.asp).

📉**Stop Loss** specifies that a token is to be sold when it reaches a specified price known as the stop price. Learn more [here](https://www.investopedia.com/terms/s/stop-lossorder.asp).

{% hint style="info" %}
Both values on WOWswap are specified in percentages.
{% endhint %}

The key advantage of using Limit Orders is that, you don’t need to monitor your holdings daily. It also allows you to follow your strategy before you open a trade, therefore, minimizing the number 1 enemy of a professional trader — your own emotions.

## Functioning of Limit Orders

👉Limit orders are executed in a decentralized way by liquidation bots that track and close trading positions which satisfy limit order conditions. For example, if a trading position reached a target profit or stop loss percentage, any liquidation bot can call WOW smart-contract and close this position.

💵**Executing limit orders is free for users**, liquidation bot operators pay for gas and don’t get any extra rewards or compensating for closing these positions.


# 🔔Receive Notifications for Profits, Liquidations and High APY

You can set up WOWswap Alerts that tracks your profits, liquidations and high APY for WOWswap lending pools.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYhYcw9WN6xTQqOD_-A%2Fuploads%2FFGib82onUtXoGaxjUZ1w%2Fimage.png?alt=media\&token=7b36dca9-5b0f-4d3e-b5ef-e6c6d3844248)

🤑Profit alerts can be set up to send you a message when any of your open positions is in 20%, 50% or 100% in profit.

📈Liquidations alerts serve 2 purposes: alert you when your position’s health falls to below 10%, and when your position is liquidated 😭

🚀High APY alerts are unique to WOWswap protocol. If set up, you will get a notification when any of the tokens in our lending pool generate 20%, 50% or 100% APY. This way you never miss the most profitable pool to lend your assets.

## How to set up alerts

All alerts can be delivered via 3 methods:

📧Telegram alerts are set up by adding a bot to your Telegram. To set it up you will need to:

1. Add **@wownotify\_bot** account as friends on Telegram
2. Enter your name & Inbox ID with a command code. For example, /WOWdegen 159841231
3. Inbox ID is your unique code which is issued based on a unique wallet address.

🔊Browser alerts can be delivered directly on your browser. Make sure you allow click on Enable button after you activate the alerts on WOWswap.

📨Email alerts will be delivered to a specified email address.


# 🩺Running WOWswap liquidation bot

No technical knowledge is required. Here is a simple instruction how to create WOWswap liquidation bot in less than 5 minutes!

## Liquidation BOT

### Installation

To simplify your experience we are using Heroku to deploy liquidation bots.

#### 1. Prepare Heroku account

To get started, you should sign up to [Heroku](https://heroku.com/) and login to the dashboard (1 minute).

#### 2. Create a liquidation wallet

Create a new wallet (if you are using Metamask, click on the circle in the top right corner and then + Create Account), deposit a small amount of BNB/Matic to this wallet ($100 should be enough), and obtain its Private key (in Metamask: click on 3 dots in the top right corner ->Account details ->Export Private Key -> Enter your password to see the Private Key).

> If you still have a question [check here](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key)

#### 3. Deploy and run bot

Select a bot for BNB Chain or Polygon Network:

* [**BNB Chain**](https://signup.heroku.com/deploy?redirect-url=https%3A%2F%2Fdashboard.heroku.com%2Fnew%3Fbutton-url%3Dhttps%253A%252F%252Fapp.gitbook.com%252Fs%252F-MYhYcw9WN6xTQqOD_-A%252F~%252Fchanges%252FZYLPonIVGrczwDXSeApf%252Fhowtoguide%252Frunning-wowswap-liquidation-bot%26template%3Dhttps%253A%252F%252Fgithub.com%252Fwowswap-io%252Fliquidation-bot%252Ftree%252Fbinance-smart-chain)
* [**Polygon** (formerly Matic)](https://heroku.com/deploy?template=https://github.com/wowswap-io/liquidation-bot/tree/matic)

In the field "App name" provide a name for your bot and paste the Private Key obrained at the previous step - the bot requires Private Key from your liquidation wallet because it will be submitting transactions on your behalf and pay for gas from this wallet. Don't change other parameters. Click "Deploy app".

![](https://camo.githubusercontent.com/c0fde5a955ec57dd5673eea610b60ded0298b2ba1034c6354a89dbacfc037370/68747470733a2f2f692e696d6775722e636f6d2f496443554953682e706e67)

#### 4. Prepare for continuous work

The Heroku stops instances with no incoming requests. To prevent undesired halting of the liqudation bot, enter [Heroku Dashboard](https://dashboard.heroku.com/apps) and find your bot.

On the configuration page of selected bot click on "Configure Dynos":&#x20;

![](https://camo.githubusercontent.com/ab61a23478391c2258158978d84064c4c673faa6d8ae99fc3659083c22956f7f/68747470733a2f2f692e696d6775722e636f6d2f554a696d6278312e706e67)

And then click on "Change Dyno Type".

Select **Hobby** plan ($7/ month) and complete the payment. If you running 2 bots both on BSC and Polygon you will need to pay twice.

### Monitor your bot

You can check the bot's activity on Heroku by going to <https://dashboard.heroku.com/apps> -> Click on your bot's name -> Click on More… (in the top right corner) -> Click on "View Logs".

![](https://camo.githubusercontent.com/1650924365b4a4f01e567bdb5eac6ecb1842d723348561cc751a3f5b2dd023e3/68747470733a2f2f692e696d6775722e636f6d2f6a3033766855322e706e67)


# 🕶️Trading on WOWswap Pro

WOWswap swap version is easy to use like you would use Uniswap style interface.&#x20;

However, some traders need more functionality for trading, so the WOWswap released the Pro version of WOWswap. In this guide you will get the most detailed guide on all the functionality of WOWswap Pro.

## Opening a position

In order to get into WOWswap Pro, you need to select the Pro tab on the main page of the website.

![](https://lh4.googleusercontent.com/QzsBymV-5_khr8L_e8wrr-PIQmQgZO92p1u8nC7yvMtient0MtxHErswuIDdrEiKaCI3YV0BGW9P2Qu3q4W9IZ0OQ6qJfQDKgBPMuFmck39jwFjLptzdfoF8embs7JO6372rtILB)

Now only the dark version of WOWswap Pro is available. To get started, you need to connect your crypto-wallet by clicking “Connect Wallet” button. In the window that opens, select your type of crypto wallet and then confirm joining WOWswap Pro.

![](https://lh4.googleusercontent.com/v7a86f1XqbFEpVi5a1hr1Z2xbD_pAbrOsdaUqb8kNT647v5nC8GM-01e6d2FctWSvhoyGXZphg0pruOSSBl2NGQ3CcsQukS1hkETFGzQD41ccmXxg8Ge4wEaIYznwvXAxNeOgiNd)

WOWswap website offers several features:

**Swap** - when you click, you are taken to the simplified version of the site originally created.

**Earn** - section for placing your assets to earn passive income

**Portfolio** - this section displays your open long and short positions

**Alerts** - in this section you can set up notifications via Telegram, e-mail or browser that your position has reached a certain level of profit or is about to be liquidated

Also, there is a button in the top dashboard that you can click to select a network for trading:

![](https://lh3.googleusercontent.com/yym4jcwuFKuGImOAM41BwYsvY1WBNmqcpP3cND6c75COYT7sLCM21MuxWdxG3DMt63VVnn2Hzc2Gz_SPiNSvtnpfFZh0SPOAkK60OV9lQf6z9Y0wvpEAydl1bCUseUeM811fRJ57)

To the left of the selection button is your wallet balance (only the balance in BNB is displayed for the BNB Chain)

Let's take a look at the side dashboard:

![](https://lh6.googleusercontent.com/7KceliBZfdnAP65aSeiOHLrdqx8cXWr9Ke3qrRIC48Y_YY5GZ62disAo72URKT4FOloz9gtg64EwjiJ9Y7gDTtLeAY4C9L_4WKZfYBP8ohjs6W2_YUy29hJEczXpxcOdx3YvIFu8)

The gear icon opens the settings menu:

![](https://lh6.googleusercontent.com/jF9b3FOTGtEg6giyqypxFAjwiCUVq15TlJarQhhII4SMrwL83ulkGblLn1ymwZ-kEzGOMTlS5-JGMpwv0Px92oA8AdmQXbENgoRkTylOyYCoYt4YaOFvs0yFyy7BwdR5BzhRMTsZ)

Here you can configure the Slippage and Transaction deadline

The Amount section shows the amount of tokens you're contributing to the transaction.&#x20;

{% hint style="info" %}
Please note that the transaction cannot be the equivalent of less than $23 on BNB chain&#x20;
{% endhint %}

When you click on the MAX button, the transaction will use the entire amount of tokens you have. You can select the token you will use for the exchange using the drop-down menu. Above the drop-down menu button displays the balance of those tokens in your wallet.

![](https://lh3.googleusercontent.com/w3e9Q4yzmij2A91URT-Yx4Lt2gYsDRWcprz0eMbkY-W0ze4KWdRX-guYnvE5d2zR7bI5OI_jzoy0DIQFepPLLOcbJ41Ia_jwWXIz8r7UuItRjqj9Fx4MfbAKV61GRdQf5IUvJHV9)

You can use the scroll bar to apply any leverage up to 5X. Moving the slider to the right will set the leverage and a long position. Moving the slider to the left will set your leverage and position to short.

Under the scroll bar, you will see the size of your position, including leverage, and the token selected to open the position.

![](https://lh3.googleusercontent.com/JKELd9Lw1UkKaPgjzCo2rEYPK0v0xGlf9bVlT3LpwDQqwG7Gker16W4V6fsNBSONhawdX9044AV2poWI5NutlSKNQo1vrclBuUr6aft-7Ngt4KSdCEpQ9vh5_Zw5GpB9zcpuHM6E)

One of the important innovations was the introduction of limit orders for setting **Take Profit** and **Stop Loss**. They are set as a percentage of the point of entry into the position. To apply them, you must move the slider from the "**off**" position to the "**on**" position.

On the right side there is a chart, similar to the TradingView chart. You can mark on it various elements of technical analysis and your positions.

Let's look at an example of opening a trade.&#x20;

![](https://lh5.googleusercontent.com/_7qJlQPbm1yd33AjX56ftdTux3XgFIcKfh7kr_hhXVMfle475U2ofwZuwIkg72NSjgjrjD9evCML7cp69g4Xk9Ewxz0R70DZwOC0DFPG2ODUq7KIr7SRW1XnB_gd2qVg8uFvkhjf)

In this example, we open a short position on $ADA token using 2X leverage and $BUSD token as an exchange token. Also, we use limit orders to place a Take Profit of 3% and Stop Loss of 1%. Our position will be $58 $ADA.

To confirm the position opening, we need to click Open Position and confirm the transactions in our wallet. by clicking Confirm Swap in the window that will open:

![](https://lh3.googleusercontent.com/hfKYT2ipYX5IztX8PkDAQZBieVKq0xj_ZMVCnRZVbA7Iz2weMPvK5tQeQ13-CS6eMljmdiDgGoCLIegOthg0if-adl7NKEqBW_TXAS36IPevi0G4KynsJVvIkVqDQFx8lug1UliE)

After confirming the transaction, you can add the purchased token to your crypto wallet or just close the window.

Now your open position will be displayed in WOWswap Pro. To close the position, click "Close" and confirm the transaction:

![](https://lh5.googleusercontent.com/OBs3uMr8uYkNjSXZG5MTfmZgeMZ1tYOvWJkIPh-0ED-jGUns61tTlad0UNwG5asWJeKJRLmUfb_bYV6s7kZokcO1kHl0Eq-vEks1pTzdliQ9mD9tk14iMZQJ5dd_Ob01dM6salen)

WOWswap allows you to apply any trading strategy and comfortably control your positions.


# 🏛WOW Governance Model

## Instant Governance

Governance is a mechanism, through which holders of WOW-token can change important protocol’s parameters, as well as submit and accept WOW improvement proposals. Everyone, who participates in the Governance, receives Governance rewards, which calculated as a percentage of the protocol’s total revenue.

Users can vote on critical protocol parameters that define the protocol’s security and profitability. These parameters can be changed on-chain without any human intervention. The procedure is fully automated, and parameters are updated every 24 hours. A new value of a parameter is determined as a weighted average of values supported by each vote: for example, if value “7” received 5 votes, and value “4” received 10 votes, the new parameter’s value will be “5” because 7 *(5/15) + 4* (10 / 15) = 5. The following table contains parameters that define the protocol’s financial model.

![WOW Financial Model Governance Parameters](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiCnFjTrk7OttEVXV0%2F-MYiG10zmyZOx8uLJ3VC%2Fimage.png?alt=media\&token=5ca9f5ed-74a3-4b5b-a262-43548f764e68)

The Economic Model of the protocol defines how WOWswap generates and distributes revenue. Currently, there are two revenue streams: fees taken from traders’ profits and fees taken from liquidity providers’ profits. Also, there are five cost centers where this revenue can be distributed: governance rewards, the development fund, the insurance fund, donations, and the WOW token buy back and burn program.

![WOW Economic Model Governance Parameters](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiCnFjTrk7OttEVXV0%2F-MYiGL91VkAXAH9iuYug%2Fimage.png?alt=media\&token=197bb2d4-2251-44bf-81c4-5d770f9ab9e1)

## WOW Improvement Proposals

On the contrary, some protocol’s features cannot be fully automated because their changes require manual work, such as upgrading or deploying new smart contracts. In this case these changes can be submitted as a form of WOW Improvement Proposals or WIPs.&#x20;

Any user with a certain minimum number of xWOW tokens can submit a proposal through WOWswap’s website for the community to vote with their xWOW tokens. The on-chain voting will be open for 72 hours and if the majority of votes are cased “for” the proposal, this proposal will be implemented by the WOW development team.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiCnFjTrk7OttEVXV0%2F-MYiGjzC6yZYlDMYvug0%2Fimage.png?alt=media\&token=4462a703-883a-4f02-8da2-4ffd8f33f606)


# 😮WOW token & contracts

WOWswap is a community-driven project governed by WOW token holders.

## WOW smart contract addresses:

1. **BNB Chain**:[0x4da996c5fe84755c80e108cf96fe705174c5e36a](https://bscscan.com/token/0x4da996c5fe84755c80e108cf96fe705174c5e36a)
2. **Polygon**:[0x855D4248672a1fCE482165e8DBE1207b94b1968a](https://polygonscan.com/address/0x855D4248672a1fCE482165e8DBE1207b94b1968a)
3. **HECO**: [0xefaeee334f0fd1712f9a8cc375f427d9cdd40d73](https://hecoinfo.com/address/0xefaeee334f0fd1712f9a8cc375f427d9cdd40d73)
4. **Ethereum**: [0x3405a1bd46b85c5c029483fbecf2f3e611026e45](https://etherscan.io/token/0x3405a1bd46b85c5c029483fbecf2f3e611026e45)
5. **Avalanche**: [0xA384Bc7Cdc0A93e686da9E7B8C0807cD040F4E0b](https://avascan.info/blockchain/c/address/0xA384Bc7Cdc0A93e686da9E7B8C0807cD040F4E0b)
6. **IoTex (Web-3)**: [0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454 ](https://iotexscan.io/address/0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454)

   **IoTex (Native)**: io16e77pc9ql4a3thyrfzaehe6z70zc2pz5x60q22

**To migrate WOW, please bridge via Anyswap:**

1. BNB Chain to Polygon:&#x20;

   <https://anyswap.exchange/bridge?inputCurrency=0x855d4248672a1fce482165e8dbe1207b94b1968a&network=polygon><br>
2. BNB Chain to Ethereum:\
   <https://anyswap.exchange/bridge?inputCurrency=0x3405a1bd46b85c5c029483fbecf2f3e611026e45&network=eth><br>
3. BNB Chain to HECO:\
   <https://anyswap.exchange/bridge?inputCurrency=0xefaeee334f0fd1712f9a8cc375f427d9cdd40d73&network=huobi>
4. BNB Chain to AVALANCHE \
   <https://anyswap.exchange/#/bridge?bridgetoken=0xa384bc7cdc0a93e686da9e7b8c0807cd040f4e0b&network=43114>
5. BNB Chain to IoTeX

   <https://anyswap.exchange/#/bridge?bridgetoken=0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454&network=4689>

## WOW is tradable on:

1. **WOW is tradable on WOWswap.**<br>

2. **Pancakeswap exchange in WOW/BNB and WOW/BUSD markets**\
   To trade WOW on Pancakeswap please click [here](https://pancakeswap.finance/swap#/swap?inputCurrency=0x4da996c5fe84755c80e108cf96fe705174c5e36a)

   Or if it does not work, enter the BNB Chain WOW token contract \[0x4da996c5fe84755c80e108cf96fe705174c5e36a] into 'to' box on Pancakeswap exchange.<br>

3. **Quickswap exchange in WOW/USDC market**

   \
   To trade WOW on Quickswap please click [here](https://quickswap.exchange/#/swap?inputCurrency=0x2791bca1f2de4661ed88a30c99a7a9449aa84174\&outputCurrency=0x855d4248672a1fce482165e8dbe1207b94b1968a)

   Or if it does not wor&#x6B;**,** enter the Polygon WOW token contract \[0x855d4248672a1fce482165e8dbe1207b94b1968a] into 'to' box on Quickswap exchange.<br>

4. **MDEX exchange on HECO in WOW/USDT**\
   To trade WOW on MDEX please click [here](https://ht.mdex.com/#/swap?inputCurrency=0xefaeee334f0fd1712f9a8cc375f427d9cdd40d73)

   Or if it does not work, enter the HECO WOW token contract \[0xefaeee334f0fd1712f9a8cc375f427d9cdd40d73] into 'to' box on MDEX exchange.

5. **Sushiswap exchange on Ethereum WOW/ETH**

   To trade WOW on Sushi please click [here](https://app.sushi.com/swap?inputCurrency=0x3405a1bd46b85c5c029483fbecf2f3e611026e45)

   Or if it does not work, enter the Ethereum WOW token contract

   \[0x3405a1bd46b85c5c029483fbecf2f3e611026e45] into 'to' box on Sushiswap exchange.

6. **Pangolin exchange on Avalanche WOW/AVAX**

   To trade WOW on Pangolin please click [here](https://app.pangolin.exchange/#/swap?inputCurrency=0xa384bc7cdc0a93e686da9e7b8c0807cd040f4e0b)

   Or if it does not work, enter the Avalanche WOW token contract

   \[0xA384Bc7Cdc0A93e686da9E7B8C0807cD040F4E0b] into 'to' box on Pangolin exchange.

7. **Mimo exchange on IoTeX WOW/IOTX**

   To trade WOW on Pangolin please click [here  ](https://swap.mimo.exchange/#/swap?inputCurrency=0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454)

   Or if it does not work, enter the IoTeX WOW token contract \[0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454] into 'to' box on Mimo exchange.

## Tokenomics

WOWswap has a **fixed supply** of 1️,0️0️0️,0️0️0️ W😮W tokens, which are used for the protocol’s governance and community rewards.  55% of WOW tokens will be distributed to liquidity providers, margin callers, and traders for contributing to the protocol’s expansion.

## Token distribution

* 55% distributed to the community;
* 23% via public and private sale
  * Public sale was held on February 25th at $5 USD per WOW token.
* 20% team tokens
* 2% used to provide initial liquidity on Pancakeswap.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiL6Ln72dmZyJAT3LM%2F-MYiNVdRRgFsY2m7uaPb%2Fimage.png?alt=media\&token=07904d85-9b8c-45e4-8c82-eba1f1d2161d)

**Community tokens** will be distributed to the protocol’s users over a period of 18 months:

* 200,000 tokens will be distributed to liquidity providers
* 100,000 tokens will be distributed to leveraged traders
* 50,000 tokens will be distributed to margin callers
* 200,000 tokens are reserved for marketing activities, community contests, bounty campaigns, white hacking rewards, and airdrops.

&#x20;**Team tokens** have a vesting period of 18 months, unlocked quarterly.

## Deflationary mechanism

WowSwap charges 5% on profits made through leveraged trades to buy back and burn WOW-tokens and build up an insurance fund.&#x20;

For example, if a trader buys a token for 10 BNB with 5 X leverage (50 BNB in total) and the token’s price increases by 20%, then the trader’s gross profit is 1.250 – 40 BNB (borrowed) = 20 BNB. Suppose, the cost of capital was 0.5 BNB, so the net profit will be 19.5 BNB. The protocol fees will be 0.0519.5 = 0.975 BNB.

50% of this amount will go to the insurance fund (0.4875 BNB), and another 50% will be spent to buy and burn WOW tokens.


# 🔵xWOW token

To participate in Governance users need votes, represented by non-transferable xWOW tokens, which users get in exchange of staking WOW tokens and/or Pancakeswap LP tokens (WOW/BNB and WOW/BUSD) in the Governance smart contract.

xWOW token is used for voting and Governance reward distribution. Governance rewards are distributed proportionally among all xWOW holders. Staking by itself is sufficient to get Governance rewards, no actual voting is required.&#x20;

![xWOW Staking APY on https://wowswap.io/governance-your-wallet](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MafUcqv9Ao_NDfdl39O%2F-MafV04EpCzIeMr2HKdk%2Fimage.png?alt=media\&token=15b6cc96-78b9-44b5-9f2e-74ac1eb781e2)

The number of xWOW tokens received for staking Pancakeswap LP tokens in 1.5 times higher than for staking WOW tokens, because obtaining LP tokens requires 2 times more liquidity (WOW + BNB or WOW + BUSD).&#x20;

Also, the number of xWOW tokens depends on the length of the staking period, during which the tokens will remained locked: the longer the period, the more xWOW are issued for the same number of WOW / LP tokens. For example, if a User A chooses to stake WOW for a maximum period of 730 days, the User A will get 10 times more xWOW tokens than a User B who decides to stake WOW tokens for a minimal period of 14 days.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MYiH9urzVD7caK6e_wl%2F-MYiHxrptc9w-gDU-r9n%2Fimage.png?alt=media\&token=127a2d69-7bda-43ce-925c-aa49c6769f36)

If a user stakes a certain number of WOW tokens for a short period of time and then stakes another number of WOW tokens for a longer period of time, then the first staked tokens are automatically re-staked for a longer period of time. Once staked, the tokens are locked and it is not possible to re-stake the tokens for a shorter period of time or withdraw them before the staking period ends


# WOW Architecture

The following diagram describes the high-level architecture and workflow of WOWswap protocol.

![](https://3431135529-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MYhYcw9WN6xTQqOD_-A%2F-MafW0UJQipPiiI0yfeE%2F-MafXt3dKnDZkfrViEOx%2Fimage.png?alt=media\&token=8fbd3ea7-6b9a-4a3f-9b03-3c992f86e9fe)

**Reserve** is a smart-contract for liquidity pools. Liquidity Providers (LP) can deposit liquidity to Reserve in lendable tokens (BNB or BUSD). Reserve contract has ERC20 token interface – LP receive these tokens according to their share of the pool.

**Pair** is a smart-contract responsible for opening, closing and liquidating trading positions. Pair contracts are created for each tradable/lendable token pair, for example, CAKE-BNB. Pair contracts temporary hold all tradable tokens bought by traders, and mint proxy-tokens, which are sent to traders instead of real tokens. Proxy-tokens are necessary to make sure that traders pay back their debts to the liquidity pools. Proxy-tokens are pegged 1:1 to real tokens held by Pair contracts on behalf of traders.&#x20;

**Factory** is a smart-contract factory: it creates Reserve contracts for new liquidity pools and Position contracts for new tradable/lendable token pairs. For security reasons only Factory is authorized to call some methods, for example, borrow, which borrows liquidity from the Reserve smart-contract.&#x20;

**Router** – is an entry point for users, who interact with WOWswap though this smart-contract. Router allows adding and withdrawing liquidity, as well as opening, closing, and liquidating trading positions. **PancakeSwap Route**r and **Uniswap Router** are entry points of decentralized exchanges, where actual swaps of tradable tokens take place.

**Chainlink Price Guard** - WOWswap checks if the price on AMM does is not less than 102% of the Oracle’s price. If the price is lower or higher, transaction is not allowed.&#x20;


# Smart contracts

To be updated


# Trading ABI and Documentation

## ABI&#x20;

<https://github.com/wowswap-io/evm-sdk-public>

### Structs

### **ClosePositionRequest**

📄 Configuration parameters for a closing position transaction

Developer should use `pragma experimental ABIEncoderV2`; to pack struct to calldata with struct

All positions tokens support EIP-2612 for disbursement via an offchain signature, not a approve of transaction

**Fields:**

➡ **short** should be true if a short position is closed (false if a long position)&#x20;

➡ **amountIn** the number of position tokens to close (can pass `type(uint256).max` to close the all position)&#x20;

➡ **amountOutMin** minimum allowed number of tokens to be received lendable after closing (if the exchange returns less during the closing process - the transaction will be rejected)&#x20;

➡ **lendable** is an address of lendable token&#x20;

➡ **proxy** is an address of proxy token (should be address(0) if direct swap)&#x20;

➡ **tradable** is an address of tradable token if position is long, overwise is shortable&#x20;

➡ **trader** is an address of position holder&#x20;

➡ **deadline** deadline of permit on spending position tokens for Router instance&#x20;

➡ **referrer** is an address of position holder referrer (should be address(0) if no referrer)&#x20;

➡ **permit** is a structure of **v , r , s** with ERC-2612 permit&#x20;

➡ **convertToNative** should be true if lendable is wrapped native currency and expect unwrapping to native at the end of transaction

### OpenPositionRequest

📄 Transaction configuration parameters for opening a long position

Developer should use `pragma experimental ABIEncoderV2`; to pack struct to calldata with struct Developer should call **PriceSigner** service to obtain guarded field data before call open position

➡ **amountIn** the number of lendable tokens to open a position and to be used as collateral for the position&#x20;

➡ **leverageFactor** determines the leverage of the position (specified in decimals, i.e. x1 is 10000 and x1.5 is 15000)&#x20;

➡ **amountOutMin** minimum allowed number of received position tokens after opening (if the exchange returns less during the opening - the transaction will be rejected)&#x20;

➡ **lendable** is an address of lendable token&#x20;

➡ **proxy** is an address of proxy token (should be address(0) if direct swap)&#x20;

➡ **tradable** is an address of tradable token if position is long, overwise is shortable&#x20;

➡ **trader** is an address of position holder&#x20;

➡ **deadline** deprecated field&#x20;

➡ **referrer** is an address of position holder referrer (should be address(0) if no referrer)&#x20;

➡ **guarded** a signed message from the oracle with the expected value of the asset (protection against flash-loan attacks)&#x20;

➡ **terminationConditions** user-signed position auto termination conditions (can be initialized with zeros to cancel auto termination)&#x20;

➡ **terminationReward** amount in native tokens to compensate for the gas and work of the termination bot (must be added to `msg.value`)&#x20;

➡ **convertFromNative** If lendable token is wrapped native currency (e.g. BNB in BNB Chain), can pass the amount as transaction value and setting convertFromNative as true to wrap the native currency into ERC20 token

### OpenShortPositionRequest

📄 Transaction configuration parameters of short position opening

Developer should use pragma experimental ABIEncoderV2; to pack struct to calldata with struct\
Developer should call `PriceSigner` service to obtain guarded field data before call open position

➡ **amountIn** number of lendable tokens (stablecoin) to open a position and to be used as collateral for the position&#x20;

➡ **baseBorrowAmount** base loan. Calculated as baseBorrowAmount \*leverageFactor = loan, where loan \* tradablePrice <= `amountInleverageFactor` determines the leverage of the position (specified in decimals, i.e. x1 is 10000 and x1.5 - 15000)&#x20;

➡ **amountOutMin** minimum allowed number of received position tokens after opening (if the exchange returns less during the opening - the transaction will be rejected)&#x20;

➡ **lendable** is an address of lendable token&#x20;

➡ **proxy** is an address of proxy token (should be address(0) if direct swap)&#x20;

➡ **tradable** is an address of tradable token if position is long, overwise is shortable&#x20;

➡ **trader** is an address of position holder&#x20;

➡ deadline deprecated field referrer is an address of position holder&#x20;

➡ **referrer** (should be address(0) if no referrer)&#x20;

➡ **guarded** a signed message from the oracle with the expected value of the asset (protection against flash-loan attacks)&#x20;

➡ **terminationConditions** user-signed position auto termination conditions (can be initialized with zeros to cancel auto termination)&#x20;

➡ **terminationReward** amount in native tokens to compensate for the gas and work of the termination bot (must be added to `msg.value`)&#x20;

➡ **convertFromNative** If lendable token is wrapped native currency (e.g. BNB in BNB Chain), can pass the amount as transaction value and setting `convertFromNative` as true to wrap the native currency into ERC20 token

**WithdrawRequest**

📄 Withdrawal parameters from the reserve All ib tokens support EIP-2612 for disbursement via offchain signature, not approve transaction


