MMI's DeFi Adapters are Powering the Future of DeFi
Explore how MMI is pioneering the future of DeFi with its innovative adapters and open-source standards, aiming to simplify data access, enhance user experiences, and foster interoperability within crypto.
Decentralised Finance (DeFi) is one of the core areas in crypto that has found product-market fit. Since the advent of yield farming kicked off the DeFi summer, we have seen an explosion of innovation that is second to none. DeFi has rebuilt the financial system from first principles. It offers basic primitives for swapping, lending, borrowing, saving, investing, options and derivatives in a transparent, interoperable, permissionless way. DeFi democratises access to these primitives for anyone, anywhere.
In the traditional world, one might think of these tools as simple building blocks. DeFi takes it a step further, creating complex strategies like self-repaying loans, recursive yield strategies, the yield farming of airdrops and the ability to connect all these primitives seamlessly to achieve the highest reward rate possible. This level of innovation is generating interest from professional traders and institutions, who are stepping into on-chain in a meaningful manner for the first time.
DeFi, therefore, can and has profoundly and positively impacted the world. However, navigating this complex world becomes difficult, especially when it comes to access toDeFi data. Users can stake into a decentralised exchange (DEX) to receive yield and rewards and an LP token to reflect their position. They can then lock that LP token into a vesting contract to boost their reward rate further and receive a Locked or Vested LP token. These staking, re-staking and recursive loops are common due to the interoperable nature of DeFi and can result in token exposure and claimed and unclaimed rewards several layers deep. In the world of institutions, having accurate valuations of these positions and rewards is profoundly crucial. Net Asset Values (NAV) and performance are tied to accurate marked-to-market valuations and the ability to make precise decisions based on profit, loss, and performance.
Today, the challenges related to DeFi data are being solved by several players in the market, most notably through the indexing of data and tagging, labelling and categorising different smart contracts. This allows a data provider to determine the balance of a position in a pool and show the underlying token balances of a position. Despite these efforts, there is a constant race with cutting-edge users (like professional traders and DeFi Funds) to stay updated with the latest protocols.
At MetaMask Institutional (MMI), we have been deeply involved with solving these data challenges. We have a user-centric culture and our product principles denote that we speak with users every day. Over the last two years, we have spent 10,000 hours in the DeFi data trenches:first building with sub-graphs; then building simulators to simulate closing position and the value of the underlying tokens; and lastly, speaking with the consumers and producers of DeFi data. Namely users who need accurate DeFi positions, and with DeFi protocols that need and want users to interact with their protocols. In conjunction with this race for data in a world of permissionless innovation, we also found:
- DeFi protocols were not being connected with users at scale
- There is no standard for both read and write DeFi access
- Few scaled approaches benefit the wider ecosystem
As a result, we set out to build a DeFi adapter standard that is focused on achieving the following goals:
- Provide a standardised adapter implementation specification for both read and write data. We want to enable any protocol engineer to build an adapter in less than four hours.
- Provide Rich and in-depth DeFi data. We resolve an LP token into the underlying token exposure to value a position. We also offer proper time-weighted profit & loss (P&L) and return data, therefore accounting for inflows and outflows, claimed and unclaimed rewards to arrive at the correct P&L and performance position.
- Benefit the wider ecosystem. We want to create an open-source standard that benefits consumers of the data, drives users to DeFi protocols and allows anyone to fork and use the repository.
What Are MMI's DeFi Adapters?
The simplest way to think of our DeFi adapters (aptly named) is to think of DeFi as a new on-chain world with its own electricity, which is DeFi data. Our adapters are literally (and metaphorically) equivalent to adapter plugs that can take this DeFi electricity (on-chain DeFi data) and convert it into DeFi views in an easily understandable user interface. The best example of the output of this data can be found in the MMI Portfolio Dashboard, where we show rich DeFi views of the underlying token exposure.
We also show P&L and performance using accurate time-weighted return calculations. This means we account for the value of a position today, the deposits (inflows) and withdrawals (outflows), and both claimed and unclaimed rewards to determine the accurate return and performance of a position over the last day, seven days and one month. The DeFi adapters will also power MetaMask Portfolio in showing DeFi data to users.
We have created this standard and repository to make the DeFi adapter building as seamless as possible. When a DeFi protocol is built and adopted, its LP tokens are immediately shown in the MMI Portfolio Dashboard, followed by MetaMask portfolio. This ensures LP tokens and positions are visible to institutions and consumers and gives a DeFi protocol broad access to the most extensive user base in crypto. Users, therefore, benefit from seeing their position, and DeFi protocols benefit from users being able to interact with accurate data.
Our eventual goal is to make the adapters a standard on par with MetaMask wallet support, ensuring depth and breadth, and long-tail access to any DeFi protocol. This means we foresee a future where as soon as a DeFi protocol is created, it will immediately add support for MetaMask and build an adapter so that MMI and MetaMask users can access the DeFi protocol and also have their LP tokens shown across MetaMask and MMI user experiences. This helps us to avoid having to race our users to provide data in cutting-edge protocols, as wallet access and LP tokens support will be there since inception.
Developer Experience
With our user-centric product principles, we have built a repository with several features to empower developers to build and consume DeFi adapters. Our explicit goal is to allow any protocol engineer to spend a maximum of four engineering hours to build a new DeFi adapter.
We have also created communication channels to support engineers in creating adapters. We have a seamless command line interface (CLI) that guides developers through the primitive they are building and offers existing templates that provide most of the required code. Once an adapter is built, we offer a UI for developers to review and quality assure their output. We also offer a video tutorial and an FAQ section to guide through the process and make the developer experience as simple and seamless as possible.
On the consumer side of the DeFi data, besides the open-source repository, we currently offer a DeFi API with all the necessary endpoints to value positions and get profits and performance. We also offer a write endpoint to seamlessly generate transaction parameters for a wide range of DeFi protocols, therefore offering programmatic trading. Lastly, we provide a DeFi SDK with automated prompted methods for each supported protocol to empower developers to build further with our adapters.
If you want to learn more about MMI’s DeFi API, read here.
Next Steps
Our goal is to scale the DeFi protocols that we support over the next two quarters. Our goal within MMI is to offer unrivalled access to any asset anywhere and empower institutions to monitor, manage, control and report on their web3 assets. Our open-source DeFi adapter standard has these first principles at heart and aims to empower users and DeFi protocols and benefit the wider community.
If you are a DeFi protocol looking to collaborate, contact us here. If you want to learn more about our DeFi API, contact us here. Join us in shaping the future of DeFi.
Keep reading our latest stories
Developers, security news, and more