🫐Isolated Margin (GMX)

This product is fully on-chain, sourcing liquidity directly from GMX v2. It currently has access to 15 underlying perpetual markets. In an upcoming product update, you will not only be able to open and close a Long/Short trade in 1 click with up to 50x leverage, but also mint every position as an NFT (ERC-721) giving full composability across DeFi

How does it work?

  1. The user opens Pear Protocol's /trade page. Choose to trade with Isolated Margin.

  2. Then, the user chooses a pair of assets to long and short.

  3. The user confirms the collateral of USDC to use for the transaction, along with the amount in USDC (pre-approved).

  4. Pear Factory contract takes an opening fee and stores in the smart contract to be withdrawn by the treasury (MPC address).

  5. Pear Factory contract determines which Pear Adapter to use, and then deploys a proxy (ERC1967) with the selected Pear Adapter implementation.

  6. Pear Factory contract calls the createPair method from the smart contract, sending the original amount minus the open fee.

  7. Depending on the implementation of the adapter and the external platform, a pair trade will be created there. The owner of the trades will be the proxy. The external platform may or may not take open fees

    1. Depending on the external platform implementation, some more calls by our off-chain components may be needed

  8. Pear Factory contract can mint an NFT (ERC721)

Closing a trade

  1. Select Close Trade from the UI

  2. Proxy closes trades, sends PnL minus fee to position owner

  3. NFT will be burned (the image will remain in your dashboard)


When trading with Isolated Margin the UI will document the estimated liquidation price automatically. However, it is worth noting that each leg shall have its own individual entry and liquidation price.

When using high leverage it is likely that one leg can be individually liquidated without warning. Leaving just the opposing leg running.

The UI will show the Entry Price, Estimated Liquidation Price, Collateral, PnL, and Net Value of just the open leg once this has happened. Users will also get a description of this directly on their position list, indicating which side of the trade was liquidated and which one is still being tracked.

Users can monitor their individual liquidation prices by navigating to the hamburger menu (3 dots) for any given position and viewing their trade details.

Here they will be able to see the liquidation prices for each individual leg:

We have also built the functionality for users to manage their collateral and deposit or withdraw collateral accordingly.

Read more on GMX here.

Last updated