mrgnloop: A User Guide to Trading with Leverage

Use mrgnloop to arbitrage interest rates across a diverse range of assets and open leveraged long positions with marginfi flashloans.


How Does mrgnloop Work?

mrgnloop uses marginfi flashloans to make accessing leverage more user friendly than ever. This is because marginfi-v2 flashloans allow Looper to bundle multiple borrow and lend instructions within a single transaction. Flashloans allow marginfi accounts to borrow an outsized position relative to their lend position by circumventing the health checks that are typically performed when a user withdraws liquidity from marginfi.

For example, if a user wanted to open a long position on SOL relative to USDC, marginfi flashloans would handle the process in the follwing order:

  1. The flashloan first borrows all the USDC the user needs.
  2. The flaslohloan swaps the USDC for SOL.
  3. The flashloan deposit the SOL from the swap and the principal lent amount into the user's marginfi account. At this point, the flashloan has ended.
  4. The health check is performed once the flashloan has completed.

Flashloans allow the user to be in bad health during the borrow-lend process without throwing an error, as long as the user is in good health at the end of the transaction.

By using flashloans, mrgnloop ensures that users can access liquidity without the typical constraints of traditional borrowing and lending processes. With mrgnloop, you can maximize your capital efficiency by leveraging their assets, meaning you can control larger positions with a smaller initial investment.

mrgnloop uses flashloans to create a secure and flexible method for optimizing capital and enabling long strategies, all within a secure and user-friendly platform.


Gettting Started with mrgnloop

Step 1. Go to the marginfi app and connect your Solana wallet:

mrgnloop photo

Step 2. Navigate to the mrgnloop page in the navigation menu:

mrgnloop photo

Step 3. Open a long position on a token of your choice by clicking the "Select token" dropdown under "You deposit" in the Action Box:

mrgnloop photo

Step 4. Before specifying how much you want to deposit, click the "Select token" dropdown under "You borrow" in the Action Box:

mrgnloop photo

Step 5. Proceed to enter the amount you want to deposit:

mrgnloop photo

Step 5. Finally, dial in how much leverage you want to take on your position using the slider:

mrgnloop photo mrgnloop photo

Conlcusion

This user guide has outlined the fundamental aspects of leveraged borrowing and lending with mrgnloop. By understanding and utilizing the features of mrgnloop, you can effectively optimize and leverage your capital, while also mitigating risks through overcollateralization and robust risk management strategies. Embrace the future of DeFi with mrgnloop and explore the endless possibilities that decentralized borrowing and lending have to offer.

Stay in touch with marginfi’s latest news by following us on X, and get in touch with the team via our Discord. See you in the arena!

Was this page helpful?