Mainnet (alpha)

Edgar Pavlovsky
marginfi
Published in
5 min readJun 28, 2022

“The end is inevitable, Maverick. Your kind is headed for extinction.”

“Maybe so, sir. But not today.”

If you’re reading this, congratulations: You’re navigating historic financial times. Markets down 85% from ATHs, persistent supply chain congestion colliding with military conflict, and rate hikes reaching levels unseen for thirty years.

In digital markets, risk management has become the topic of conversation: price risk from volatile markets has met infrastructure risk from nascent technology.

There has never been a more important time to build.

At mrgn labs, it’s been a packed year. We’re building marginfi: A single interface to trade across defi. marginfi — affectionally typed in all lowercase letters — is an omniprotocol margin engine. It’s one account you trade an entire ecosystem of financial markets through, on Solana and (🔜) beyond. marginfi doesn’t have its own native markets — it integrates with the trading protocols that you already know, like Mango, 01, and Drift.

You get improved capital efficiency (that means your money goes further ⛽️) and improved risk management (that means you’re better protected 🛡) by unifying your on-chain liquidity in a single account and operating within marginfi’s overlayed risk framework.

In these times of volatility, marginfi is the most important tool you could have in your toolkit.

The team has slept little as we’ve raced to market. There’s a balance to strike when building premier trading tools: speed is important, but robustness is paramount. In an age that highlights the infrastructure risk that comes with new blockchains and new financial infrastructure built on top of them, marginfi’s ethos is one of security and reliability.

An αlpha on a βeta

This week, we’re excited to announce the beginning of a pre-chorus: marginfi launches an alpha to Solana Mainnet-beta, and live market testing begins with a private group of traders.

marginfi infrastructure is packed with mechanism design details — expect to see expanded content and documentation on the architecture in the coming weeks.

For now, here’s a sneak peek:

A never-before-seen lending pool

marginfi infrastructure implements a next-generation lending mechanism, designed to optimize both the lending and borrowing experience.

Most protocols today use a static piecewise linear function to set interest rates:

Market research, courtesy of Jet Protocol

This landscape is evolving, with Jet, Mango, and others pushing the frontier.

Inspired by a design to build beautiful user experiences, marginfi seeks to take things further: the protocol will introduce an Adaptive Interest Rate Curve.

AIR-C will adjust interest rates in tandem with the topology of the interest rate curve itself, intelligently optimized for borrow/lending dynamics to create safe and attractive yield opportunities.

Look out for mrgn research on the details, coming soon.

A never-before-seen liquidation engine

With an omniprotocol architecture that requires liquidations to manage solvency risk, marginfi employs a proxy approach to liquidations by supporting position liquidation at the marginfi level — without obstructing liquidations on underlying trading protocols.

Solvency is the theme here, and you’ll see an intuitive approach to solving this problem in marginfi’s v1 implementation. That said, we believe there’s a long road here of opportunity to innovate — user experience, liquidator incentives, and overall systemic health of the defi ecosystem stands to benefit.

Look out for mrgn research on this topic as well, with v2 implementation coming as quickly as it can be built.

Realtime automated lending, borrowing, and rebalancing

Automated capital efficiency and liquidity management best practices are core pillars imbued into marginfi.

Analogous to Coral’s Anchor framework for development, marginfi seeks to empower you to use best practices by default. The protocol takes care of:

  • Automated lending on your stables.
  • Automated borrowing within appropriate constraints to maximize capital efficiency.
  • Automated liquidity management to protect your capital from unnecessary liquidation.

UTP Integrations

Cross-margining happens across underlying trading protocols, or UTPs. Our initial integrations focus on derivatives, with a nod towards the freedom that derivatives unlock in helping traders build opportunities for healthier, risk-managed portfolios.

Our team placed a heavy emphasis on the most liquid derivatives venues for our alpha, giving traders the most flexibility to take advantage of the new capabilities we offer.

Our first cohort of UTPs will include:

  • Mango Markets
  • 01 Exchange
  • Drift — built on devnet, with an upcoming integration of Drift v2 as it’s launched

Derivatives are a primary case study for the value a realtime, dynamic margin engine brings to traders — but this is a journey in its nascency, with new products and diverse liquidity venues slated to come.

For protocols, marginfi is a source of liquidity: as traders enter the marginfi ecosystem, cross-margin infrastructure helps trader capital flow seamlessly across markets.

If you work on a trading protocol and are interested in discussing a marginfi integration, reach out.

Access

We’ve started testing with our first cohort of trading firms and individual traders. If you’re a trader and this excites you, shoot us a DM. Our initial testing has been focused on traders who prefer to trade programmatically — look out for the marginfi SDK to be open-sourced soon.

Interested in the marginfi web app? We’re working with users to help shape the product — reach out and tell us what your dream trading UI looks like.

What’s next?

SMS==Solana Margin Summer, right? 😏 For marginfi, it’s a summer of launching, sharing, and continued evolution towards building the best defi-native way to trade.

Look out for product, research, and community releases over the next couple months. We expect to release publicly accessible tools in the coming weeks and intend to iterate quickly with ecosystem partners. ◼️

Keep up with us, here on Medium and everywhere else:

--

--