🍐
Pear Protocol Docs
  • Introduction
    • 🍐What is Pear Protocol?
    • ⛓️What is Pairs Trading?
  • Getting started
    • πŸ‘‹Entering the dApp
    • ❔How to Trade (Isolated Margin Mode)
    • ❔How to Trade (Cross Margin Mode)
    • πŸ§‘β€πŸ«Examples Of Narrative Trading
    • πŸ›‘Considerations
  • πŸ—οΈArchitecture and Infrastructure
    • 🫐Isolated Margin (GMX)
    • 🧊Cross Margin (Vertex)
    • β›ΊIntent Based RFQ (SYMM)
    • βš™οΈAPIs
  • Trading Costs and Incentives
  • πŸ’³Trading Fees
  • 🀝Referrals
  • βœ‚οΈstPEAR-based trading discounts
  • πŸ“ŠFee Rebates
  • Tokenomics
    • 🀝Token
    • πŸ₯©Staking
    • πŸ‘¬Staking walkthrough
    • Staking FAQs
    • 🌐DAO & Governance
    • Token Allocations
  • Smart Contracts
    • πŸ“—Smart Contract addresses
    • πŸ”Audits and Security
  • Resources
    • πŸ—ΊοΈRestricted Territories
    • πŸŽ’Brand Assets
    • πŸŽ’Portfolio Margin Explained (Vertex)
    • ⁉️FAQs
  • Privacy Policy
  • Terms of Service
Powered by GitBook
On this page
  1. Architecture and Infrastructure

Isolated Margin (GMX)

PreviousConsiderationsNextCross Margin (Vertex)

Last updated 7 months ago

This product is fully on-chain, sourcing liquidity directly from GMX v2. It currently has access to 21 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)

ISOLATED MARGIN RISKS

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.

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.

Read more on GMX

πŸ—οΈ
🫐
here.
Visual example of Pear Protocol's Isolated Margin Engine