[Proposal] Margin Trading

Introduction: Mirror is currently missing margin trading. Margin trading typically refers to the practice of using borrowed funds from a broker to trade a financial asset, which forms the collateral for the loan from the broker.

Within Mirror, I propose that margin should work as follows:

I. Margin should be applied at a portfolio level and risk should be assessed across all assets in the portfolio. A risk score should be applied to each portfolio, with risky assets having different margin levels (these levels could be decided by the community, similar to how we decide what collateral is required for minting an asset).

II. For many assets, the default risk level would be 50%. If a person owns 1 share of mAAPL and it is currently trading at $132.00, this 1 share of mAAPL is collateral for up to $66 UST of value (50%).

Margin would be displayed in real-time on the user’s account.


The example above is a person with 1.2M worth of collateral across the Mirror platform. That person would be able to borrow against half of that and have the current value reflected on the site.

III. To close a margin position, any of the following can occur:

  1. A user can sell an mAsset. Selling an mAsset reduces the margin balance.
  2. A user can take UST from their wallet and use it to pay down the margin balance.
  3. A user can take money from their Anchor account and use that to pay down their margin balance.

IV. The system should automatically close out positions that exceed the maximum margin threshold. In the above example, if the values of the underlying mAssets are reduced so that the margin equals or exceeds the overall portfolio margin level, the protocol will close the users position.

  1. Optionally, a user may pre-authorize their Anchor savings account to be used to cover any maintenance requirement within Mirror. If this were pre-authorized, the system would first try to pull money from the users Anchor savings account. If there were not enough funds, the system would then close the open margin by selling mAssets to meet the margin requirements.

V. Margin isn’t free. There should be a cost_to_borrow, which is the APY that is applied to margin on an annualized basis. This could be tied to the same rate as Anchor’s borrow, or it could be a discounted rate for people who are providing Liquidity in the pools. A discount for liquidity providers incentivizes people to add more liquidity to the pools.

I believe that this system will be fair, equitable and beneficial to all Mirror users. It will generate revenue and offer traders the opportunity to get leveraged exposure to mAssets in a familiar environment.

Thanks for reading.


This is a good suggestion, and something that we already have the smart contract specs written for margin/leverage, and I have attached a rough user flow below.

We plan to integrate this with various money markets as well to allow for a borrower-lender structure. This won’t be immediately available in v2, but should follow soon after.