# Trading



<figure><img src=".gitbook/assets/section_trade (1).png" alt=""><figcaption></figcaption></figure>

## Trade up to 200X

We offer perpetual futures with up to 200X leverage on BTC, ETH, and many mainstream crypto assets.

## Keep your assets safe

We do not custody your assets. Your assets stay with you and the margins posted are locked in a dedicated smart contract.

## Margining

All positions are margined in BUSD. Both isolated and portfolio margining will be supported.&#x20;

You can add margins to outstanding positions, but cannot partially withdraw posted margins. When margins are added to an outstanding position, the relevant liquidation price is adjusted.

Multiple stablecoins are accepted as eligible margins. These will be swapped automatically to BUSD.

## Order type supported

You can trade either Market Order or Market Limit Order. Both order types can also have either Stop Loss, Profit Target, or both.

### Market Order

Market orders are filled at the best price offered by the [Liquidity Pool](liquidity-pool.md).

### Market Limit Order (coming soon)

Market limit orders are filled when the limit prices match the best price offered by the [Liquidity Pool](liquidity-pool.md).

### Stop Loss

Stop Loss price can be added to Market Order or Market Limit Order, which will trigger an automatic close of the position if the condition is satisfied.

### Profit Target

Profit Target price can be added to the Market Order or Market Limit Order, which will trigger an automatic close of the position if the condition is satisfied.

## Fee and Market Impact

Prices offered by the [Liquidity Pool](liquidity-pool.md) embed two types of transaction costs - Fee and Market Impact.

`Long/Short Open Price = Oracle Price x (1 +/- Fee +/- Market Impact)`

`Long/Short Close Price = Oracle Price x (1 -/+ Fee -/+ Market Impact)`

### Fee

Fee is 0.10%.

### Market Impact

Market Impact is calculated dynamically as a function of outstanding positions on the platform and the position size. It is a deterministic charge simulating the impact a new position would have on the market.

`Market Impact (%) = (long/short outstanding positions on the platform + Position size) / 1% depth above/below`

`1% depth above/below` is benchmarked to the corresponding liquidity at leading exchanges and regularly updated.

## Opening a position

<figure><img src=".gitbook/assets/Screenshot 2022-12-18 at 10.58.26 AM.png" alt=""><figcaption></figcaption></figure>

Opening a position will transfer the required margin to a dedicated on-chain contract, whose sole purpose is to hold trader margins.

[Liquidity Pool](liquidity-pool.md) which acts as the central counterparty and clearinghouse to all positions.

The initial margin is calculated based on the matched prices ("Mark Price").

You can post margin in many stablecoins, which will then be automatically swapped into BUSD using a third-party DEX (e.g. Uniswap), with the maximum amount of the stablecoin to meet the BUSD margin requirement specified by you.

### Slippage setting

Your execution price is deterministically calculated (see [Fee and Market Impact](execution.md#fee-and-market-impact)) based on the latest oracle price, but, especially during a fast moving market, there can be a gap between the screen price and the actual execution price (primarily due to changes in oracle price and outstanding positions on the platform).&#x20;

To mitigate this risk, you can specify Slippage when opening a position, so that the actual execution meets your execution price requirement.

## Closing a position

<figure><img src=".gitbook/assets/Screenshot 2022-12-18 at 11.06.06 AM.png" alt=""><figcaption></figcaption></figure>

Closing a position will calculate the PnL based on the best price offered by the Liquidity Pool and transfer it to the trader, together with the margin posted.&#x20;

You may request the PnL to be transferred in a stablecoin other than BUSD, in which case the PnL (together with the margin) will be swapped into the requested stablecoin using a third-party DEX (e.g. Uniswap), with the minimum amount of the stablecoin specified by you, and transferred to you.

You can not lose more than the margin posted.&#x20;

### Slippage setting

Your execution price is deterministically calculated (see [Fee and Market Impact](execution.md#fee-and-market-impact)) based on the latest oracle price, but, especially during a fast moving market, there can be a gap between the screen price and the actual execution price (primarily due to changes in oracle price and outstanding positions on the platform).&#x20;

To mitigate this risk, you can specify Slippage when closing a position, so that the actual execution meets your execution price requirement.

## Liquidation

Outstanding positions are subject to liquidation if the relevant liquidation price is breached according to the price oracle ("Index Price").

Outstanding positions eligible for liquidation are liquidated at the earliest chance, to protect the users and the platform.

Liquidation closes the relevant position. It is subject to a liquidation penalty. In order to avoid the liquidation penalty, traders are advised to close a position before liquidation is triggered.

## Risk management

Trading at uniwhale is subject to the following constraints:

* Leverage cannot exceed 200x.
* A trader can carry at most 3 open positions for each pair.
* A trader can carry at most 3 open positions across pairs.
* A trader can carry at most $100,000 of margin across pairs.
* Minimum position (after leverage) is $100.
* A position is subject to the maximum percentage PnL, determined as a function of your margin and leverage (see [Maximum Percentage PnL](execution.md#maximum-percentage-pnl)).
* The maximum possible PnL of all open positions (long and short) across the platform cannot exceed the prevailing market value of Liquidity Pool.

### Maximum Percentage PnL

At Uniwhale, we must ensure that the platform always stays solvent as positions are opened and closed. That means the counterparty to all the trades, ie. the Liquidity Pool, must be able to meet the maximum possible PnL of all open positions (long and short) across the platform.

Because the maximum possible PnL of long/short open positions, by default, is unlimited/very large, respectively, we apply so-called "Maximum Percentage PnL" to each position, which limits the maximum possible PnL of each position and therefore allows us to determine the maximum possible PnL of all open positions.

To determine Maximum Percentage PnL, we take into consideration the leverage of a position, and the higher the leverage a position has, the higher its Maximum Percentage PnL subject to a cap and a floor, i.e.

`Maximum Percentage PnL = Max(Floor, Min(Cap, Leverage / Maximum Percentage PnL Factor))`

The above makes sense because generally you would expect a higher potential return with a higher leverage than with a lower leverage.&#x20;

It also allows the Liquidity Pool to run a far better capital efficiency because the pool then allocates relatively (per leverage) more capital to those with higher leverage than those with lower leverage.

