Isolated Margin (GMX)

The first trading product is our Isolated Margin Product. This is fully on-chain, sourcing liquidity directly from GMX v1 (GMX v2 is being integrated). It currently has the following assets:
Access to 4 individual assets allows for 12 different pair-trading options. In this version of Pear Protocol, you will be able to open and close a Long/Short trade in 1 click with up to 50x leverage, manage slippage, and mint every position as an NFT (ERC-721) giving full composability.
How does it work?
Visual example of Pear Protocol's Isolated Margin Engine
  1. 1.
    The user opens Pear Protocol's /trade page. Choose to trade with Isolated Margin.
  2. 2.
    Then, the user chooses a pair of assets to long and short.
  3. 3.
    The user confirms the collateral of USDC to use for the transaction, along with the amount in USDC (pre-approved).
  4. 4.
    Pear Factory contract takes an opening fee and stores in the smart contract to be withdrawn by the treasury (MPC address).
  5. 5.
    Pear Factory contract determines which Pear Adapter to use, and then deploys a proxy (ERC1967) with the selected Pear Adapter implementation.
  6. 6.
    Pear Factory contract calls the createPair method from the smart contract, sending the original amount minus the open fee.
  7. 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. 1.
      Depending on the external platform implementation, some more calls by our off-chain components may be needed
  8. 8.
    Pear Factory contract can mint an NFT (ERC721)
Closing a trade
  1. 1.
    Select Close Trade from the UI
  2. 2.
    Proxy closes trades, sends PnL minus fee to position owner
  3. 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.
It is therefore recommended to be careful with the leverage and size of trades when using the platform, thus avoiding potential loss of funds suddenly.
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.​