🧊Cross Margin (Vertex)

The Cross Margin product has been built on top of the Vertex CLOB (central limit order book), a cross-margin trading engine.

Vertex brings 37 assets for users to trade, with more being constantly added.

In addition, this integration with Vertex allows multiple improvements such as deeper liquidity, faster execution, and native cross-margining across all positions.

General workflow

The USDC deposit made into the Cross Margin product is used to open a new sub-account for the user. This USDC is shared as margin between all open positions. Calculations of portfolio health are performed automatically.

Deposit Funds

Before starting trading, users should make their first deposit into the trading engine. Deposits are collateral that can be used to trade. By depositing assets, the users are depositing them into Vertex Protocol smart contracts on Arbitrum. Vertex is non-custodial, meaning the user maintains control over their assets and can withdraw anytime. Once the user hits the deposit button, Vertex SDK is called, which triggers Vertex API which deposits the funds in the Vertex Protocol smart contracts.

Enabling One-Click Trading (Optional)

After depositing on Vertex, the user will need to choose a trading mode. There are 2 trading modes on Vertex:

  1. One-Click-Trading (1CT) - After signing one approval transaction, the user is not required to sign any further open or close position transactions. By enabling one-click trading user allows a private key held by Vertex API to sign his open/close position transactions

  2. Sign Every Transaction -- Every action while using Vertex will require a signature.

Opening a Trade

  • The user chooses a pair of asset to long and short.

  • The user chooses collateral amount.

  • The user chooses leverage and slippage.

  • The user clicks the OpenPosition button and confirms the order through a confirmation modal.

  • Then, Vertex API is called through the Vertex SDK which opens both long and short positions on Vertex contracts.

Closing a Trade

  • Once opened a position, it can be found in the positions list

  • The position could be closed by choosing β€œclose trade” and confirmation through close trade modal dialog. After confirmation Vertex API is called through Vertex SDK which closes both long and short positions on Vertex contracts.

Withdrawing Funds

The user is always able to withdraw all available funds by using the UI form provided

Withdrawals are processed on-chain, and flow from the Vertex non-custodial smart contracts back to the user's wallet through our front-end interface. Users may need to wait anywhere between 30seconds - 10 minutes for these transactions to settle on-chain. The latter is only during extremely busy periods on the Arbitrum network.

Liquidations

Since all your positions are in cross-margin, the concept of being liquidated on a single leg (like in Isolated Margin) does not apply in the same way.

Instead, traders have a margin against ALL their positions (portfolio margining). The risk engine then allocates a portion of that margin to a specific leg (subject to initial and maintanance weights for each underlying).

When the margin allocated for a specific leg runs out, the position is identified as closed which takes the margin away from the total Funds Available (funds deposited, used for margin on pair trades) on the account/wallet.

Thus, we cannot show an accurate liquidation level for each pair trade. Users who are familiar with trading on a CEX like Binance, or a DEX like dYdX will be familiar with this idea of account health. The key concept to understand is Liquidation Risk % (Margin), which is shown in the Pear Protocol front end.

Initial & Maintenance Margin (Health) = Health is the amount of capital (quoted in $USDC) your account has to trade with before it can be liquidated. You can think of Health as your Margin, and you have 2 different kinds:

  • Initial

  • Maintenance

Your Health is determined by giving each balance and position a Weighted Value. There are two types of weights:

  • Initial

  • Maintenance

The weights are set so that initial health is always less than maintenance health.

For more details on weighting, please refer to the section on health calculations. Once all of your Initial Health is depleted, your account goes into Maintenance Mode, which means no more risk can be taken.

The remaining Maintenance Health acts as a buffer for the user to de-risk before risking liquidation. Once all of the Maintenance Health is used, your account can be partially or fully liquidated.

Read about Vertex here.

Last updated