As more and more organizations enter Web3, MetaMask Institutional (MMI) has put its focus on meeting these organizations’ diverse requirements for participation in the ecosystem—from distinct key management needs to a range of compliance, monitoring, and reporting features, and more. One of the most prevalent demands we’ve seen is for access via APIs (application programming interfaces) instead of through a standard user interface (UI). With this in mind, the MMI team has launched programmatic access.

Organizations that employ sophisticated trading strategies may require direct access to Web3 via APIs for a number of reasons: 

  • A need to execute multiple transactions across several decentralized applications (dapps) and/or several custodians.

  • A need to automate processes in order to speedily execute hundreds or thousands of transactions per day.

  • A preference to limit interaction with the front ends of DeFi applications for security purposes.

With programmatic access, organizations deploying funds into DeFi (decentralized finance) will now be able to connect to MMI using APIs, instead of using our browser extension or portfolio dashboard. This will enable organizations to automate processes for faster transaction execution and signing, as well as perform all the above-mentioned actions while leveraging MMI’s extensive custodial integrations.  

How to Use Programmatic Access

In the third quarter of 2022, we open-sourced a Python version of our SDK (software development kit), with which all of our custodian partners are integrated. This means that organizations can use code to facilitate and submit a transaction payload directly to their chosen custodian for signing.  

To get started with programmatic access, organizations must sign up to MMI and work with one of our custodian partners. They will need access to a ‘refresh token’ provided by their custodian. 

A refresh token is a JSON web token that is essentially a compact, secure, and fast way to exchange and authenticate information between two parties. While on the MMI browser extension, authentication is completed within the UI; when accessing MMI programmatically, a refresh token is needed to substitute this interaction.

Organizations can install the MMI Python SDK and then instantiate a client for their custodian with a simple function. Once they have their refresh token provided by their chosen custodian, they can authenticate their API and begin accessing DeFi and Web3.

Why it matters

MMI’s programmatic access capability allows organizations to execute programmatically across multiple custodians. Instead of having to connect to each custodian independently, an organization can simply connect to one unified SDK and create transactions across all their chosen custodians. They can do so because MMI unifies all custodian APIs. 

MMI’s Python library enables organizations to build scripts to craft complex execution strategies. For example, an organization could write a script to make multiple deposits and borrows into a lending platform, trigger a swap on a decentralized exchange upon specific price activity, or build automatic rebalancing scripts for liquidity provisioning positions.

MMI’s Python library is intended to act as a base layer on top of which organizations can create their scripts. The team also intends to build out this library further with a range of methods in order to make crafting different execution strategies as simple as possible—Like building blocks on top of the base layer. 

Conclusion

Our mission is to bridge all organizations into Web3, and we continuously work to evolve our offerings to realize this mission. The launch of programmatic access alongside a growing Python library is part of that evolution. 


To get a complete picture of all the features we’ve shipped since MMIs’ launch in 2021, check out our changelog.

Learn more about MetaMask Institutional