Product Deep-dive #2: Leveraged Perpetual Trading with Cross-Margin Multi-Collateral Management — Trade Up To 1,000x of Your Collateral Value

HMX Marketing
HMX.org
Published in
9 min readJun 16, 2023

This article is the second part of the series that will provide a comprehensive look at HMX and its key features before its official launch on XXX.

In this article, we will be going through the details of our Leveraged Trading Feature, covering the following topics:

  • HMX’s Collateral Management (cross-margin & multi-collateral asset)
  • Asset Classes Listing
  • Fees (Trading, Borrowing, Funding, and Liquidation Fee)
  • Margin Fractions
  • Adaptive Pricing Mechanism
  • Risk Management & Liquidation Process

Collateral Management 🏦

Collateral management is one of the key differentiating features of HMX. Specifically, HMX is the only pool-based decentralized perpetual exchange that offers cross-margin collateral management while also allowing users to use multiple types of assets as collateral:

Cross-margin Collateral

HMX offers cross-margin collateral management, which allows for the sharing of margin balances across multiple positions. With this feature, traders will be able manage their portfolio holistically in a much more efficient and convenient manner. Capital efficiency will be enhanced, improving the flexibility through the reduction of margin requirements.

The cross-margin collateral support allows HMX to offer the experience of using a centralized exchange without sacrificing on the security benefits of decentralization.

If users still wish to use an isolated margin (e.g., for risk management), they can still do so by utilizing the sub-account feature

Multi-asset Collateral Support

HMX accepts multiple assets as traders’ collateral. Allowing users to utilize mulitple assets as collateral provides two key benefits to the users:

  1. Users do not have to convert their holdings into specific assets to start trading
  2. Users can effectively execute many strategies such as carry trade strategy or max long strategy (e.g., use ETH as collateral to long ETH)

As part of the risk management procedure, HMX will assign the LTV (loan-to-value) to each collateral asset, which will determine the borrowing power. The borrowing power will then function as the variable that determines the liquidation threshold and the health of the account against all open positions under that account.

Below is table summarizing the current supported collateral assets.

Note that each collateral will have different Loan-to-Value, which determines the borrowing power for traders at HMX. The borrowing power will then function as the variable that determines the liquidation threshold and the health of the account against all open positions under that account.

Asset Classes Listing 💱

HMX currently offers the trading of four asset classes, including cryptocurrencies, FX, and commodities. Below is the list of assets supported by HMX and their maximum leverage.

We will release the full list of assets in our Docs, which will be released in a couple of days.

Platform Fees 💳

As HMX uses re-hypothecated liquidity from GMX’s GLP and is able to offer much higher yields to the HLP depositors from the increase in capital efficiency, HMX can afford to offer fees to traders that are lower than the market rate. We describe all the fees for using HMX below:

Trading Fee (Position Opening & Closing):

The trading fee is charged as a percentage of the trader’s position size when a trader opens & closes their leveraged positions. The trading fees charged at HMX will vary based on different asset classes.

Borrowing Fee:

The Borrowing Fee is charged on the size of the position of the trader and functions as a way for HMX to compensate the market makers (HLP depositors) for their cost of liquidity. The borrowing rate is determined by the asset utilization rate of the HLP vault.

Below is the graph representing the borrowing rate calculation and its relationship with the HLP asset utilization rate:

Please note that the Borrowing Fee is continuously incurred every second, but is quoted on an hourly basis.

Funding Fee:

The Funding Fee is charged on the traders’ position, similar to the borrowing rate. The Funding Fee helps bring a balance between long and short OI on HMX, thus ensuring our LPs are not too exposed to one side of the market.

HMX has a velocity-based funding rate model, where the funding rate will gradually increase or decrease based on the market skew. Heavily skewed market will see one side of traders gradually paying more funding fee to the other side. Below is the formula for the velocity-based funding rate:

Note that the Funding Fee accrues over time and get settled every time a position is modified, opened, or closed. For more details, check the funding rate calculator here.

Liquidation Fee:

The liquidation fee is incurred when the trader’s position is liquidated by the platform. It is charged at a flat rate of $5.0 and is used to cover the gas and operation costs when liquidating high-risk positions.

For more details on the liquidation process, check the “Risk Management & Liquidation Process” section below.

Adaptive Pricing Mechanism

HMX employs a mechanism called “Adaptive Pricing” to help bring balance between the long and short open interest of each trading asset. When a user opens or closes a trading position, the Adaptive Pricing mechanism applies a premium or a discount on top of the oracle price based on the resulting skew after the transaction is executed between the long and short open interest of the asset.

If the long open interest is larger than the short open interest, a premium will be applied to the price of the asset. On the other hand, if the short open interest is larger than the long open interest, a discount will be applied to the oracle asset price. The premium/discount from the Adaptive Pricing mechanism will encourage or discourage traders to open long or short positions on the asset accordingly.

Below is a table summarizing the premium and discount applied to the price in different scenarios:

For the formulas and the example calculation of the Adaptive Pricing Mechanism, please visit here.

Risk Management & Liquidation Process 💧

HMX implements a rigorous risk management process to help protect both the traders and the market makers, and ensure fairness for both parties. To understand how the liquidation process works, please first familiarize yourself with the terms below:

Initial Margin Requirements (IMR): The Initial Margin Requirement is the USD value of equity required to open a position or increase position size. Each market will have a parameter called “Initial Margin Fraction” (IMF), which is a percentage of position size to be treated as IMR for that position. The IMR is displayed in USD.

Initial Margin Fraction (IMF): The Initial Margin Fraction is a parameter set by HMX, and is used to determine the initial margin requirement. It is displayed as a percentage & different asset classes will have different IMF.

Maintenance Margin Requirements (MMR): The Maintenance Margin Requirement is the USD value of equity required to maintain the position before it is liquidated by the platform. Each market will have a parameter called “Maintenance Margin Fraction” (IMF), which is a percentage of position size to be treated as MMR for that position. The IMR is displayed in USD.

Maintenance Margin Fraction (MMF): The Maintenance Margin Fraction is a parameter set by HMX , and is used to determine the Maintenance Margin Requirement. It is displayed as a percentage & similar to IMF, the MMF will be different for different asset classes.

Equity Value: The Equity Value is the net value of your sub-account. It is the summation of unrealized profits/losses, unrealized fees (funding/borrowing/position opening/closing/liquidation), and collateral value.

Collateral Value: The Collateral Value is calculated based on the collateral assets and their respective market prices multiplied by the collateral asset LTV.

Now, let’s take an example of Bob, who deposited 1 BTC as collateral to leveraged trade on HMX. For this example, let’s assume the following:

  • Bob’s Collateral: 20,202.02 USDC
  • USDC Price: $1.00
  • USDC LTV: 0.99
  • Collateral Value: $20,000.00 USD
  • Equity Value: $20,000.00 USD
  • Crypto Asset Initial Margin Fraction (IMF): 1.00%
  • Crypto Asset Maintenance Margin Fraction (MMF): 0.50%
  • Initial Margin Requirement: $200.00 USD (20,000 * 1%)
  • Maintenance Margin Requirement: $100.00 USD (20,000 * 0.5%)

Bob then decided to open two leveraged long positions on ETH and ARB on HMX. Note that for this example, we will ignore fees accrued to the leveraged positions for the sake of simplicity. Below are the relevant info of Bob’s two positions at the time of position opening:

  • ETH Price: $1,700.00 USD
  • ARB Price: $1.20 USD
  • ETH Position Size (ETH): 40.00 ETH
  • ARB Position Size (ARB): 40,000.00 ARB
  • ETH Position Size (USD): 40 * 1,700 or $68,000.00 USD
  • ARB Position Size (USD): 40,000 * 1.20 or $48,000.00 USD
  • ETH Position PnL: 0.00 USD
  • ARB Position PnL: 0.00 USD
  • Net Position PnL: 0.00 USD

Two days later, ETH price appreciated to $1,780/ETH while ARB price dropped to $0.65/ARB. At this point, the following statistics represent Bob’s account & positions:

  • ETH Price: $1,780.00 USD
  • ARB Price: $0.65 USD
  • ETH Position Size (ETH): 40.00 ETH
  • ARB Position Size (ARB): 40,000.00 ARB
  • ETH Position Size (USD): 40 ETH * $1,780 or $71,400.00 USD
  • ARB Position Size (USD): 40,000 ARB * $0.65 or $26,000 USD
  • ETH Position PnL: $71,400 — $68,000 or $3,400
  • ARB Position PnL: $26,000 — $48,000 or -$22,000
  • Net Position PnL: -$22,000 + $3,400 = -18,400
  • Equity Value: 20,000–18,400 = $1,600

At this point, while the price of ARB dropped significantly, Bob’s Equity Value ($1,600) is still higher than both the Initial Margin Requirement ($200) and the Maintenance Margin Requirement ($100). Therefore, Bob can still freely withdraw his collateral (up to $1,400) and his account will not be liquidated for the time being.

A day later, the price of ARB and ETH moved to $0.91 and $1,495 respectively. At this point, the following statistics represent Bob’s account & positions:

  • ETH Price: $1,495.00 USD
  • ARB Price: $0.91 USD
  • ETH Position Size (ETH): 40.00 ETH
  • ARB Position Size (ARB): 40,000.00 ARB
  • ETH Position Size (USD): 40 ETH * $1,495 or $59,800.00 USD
  • ARB Position Size (USD): 40,000 ARB * $0.91 or $36,400 USD
  • ETH Position PnL: $59,800 — $68,000 or -$8,200
  • ARB Position PnL: $36,400 — $48,000 or -$11,600
  • Net Position PnL: -$22,000 + $3,400 = -19,800
  • Equity Value: 20,000–19,800 = $200

At this point, Bob’s Equity Value ($200) has reached the Initial Margin Requirement ($200) but has not reached the Maintenance Margin Requirement ($100). Therefore, a limit on collateral withdrawal has been placed on Bob’s sub account, but his sub account is not yet liquidated.

A few minutes later, the price of ARB and ETH moved again to $0.90 and $1,500 respectively. Below is the updated statistics of Bob’s account and his positions:

  • ETH Price: $1,500.00 USD
  • ARB Price: $0.90 USD
  • ETH Position Size (ETH): 40.00 ETH
  • ARB Position Size (ARB): 40,000.00 ARB
  • ETH Position Size (USD): 40 ETH * $1,500 or $60,000.00 USD
  • ARB Position Size (USD): 40,000 ARB * $0.90 or $36,000 USD
  • ETH Position PnL: $60,000 — $68,000 or -$8,000
  • ARB Position PnL: $36,000 — $48,000 or -$12,000
  • Net Position PnL: -$8,000 + $12,000 = -20,000
  • Equity Value: 20,000–20,000 = $0

At this point, Bob’s Equity Value dropped below the Maintenance Margin Requirement. As a result, his sub account is liquidated, and the remaining collateral (if any) is returned to him.

Closing Remarks 🙏🏻

So far, we’ve covered our two main products: Leveraged Trading with Cross-margin Multi-collateral Management and Leveraged Market Making. However, while products play a key role in a project success, another key success factor of a project relies on its tokenomics model

In the next part of the series, we will be going through the tokenomics of HMX, and share with you the design principal that inspired the tokenomics model of the project. Please stay tuned for the next article!

Official HMX Links 🐉:

Below are the official links for HMX:

WebsiteTwitterTelegramTelegram AnnouncementMediumDiscordZealy

--

--