Inspiration

DeFi, like for many others, changed our lives. It changed how we planned for our future and how we experienced truly decentralized financial management. However, we found ourselves dedicating many hours a week to managing our funds. We desperately needed a solution to cut down time spent creating our desired financial instruments while still maximizing the number of protocols we got to explore.

We also wanted to deploy code for financial instruments quicker, as audits were so expensive and time-consuming!

Thus, the Malloc (Money-Allocation) Protocol was born.

What it does

Malloc is a low-code protocol for splitting money arbitrarily through the DeFi ecosystem. Users can split their money through different contract calls such as swaps, farms, and transfers using a no-code frontend to make directed acyclic graphs (DAG).

Once a “flow” is created, anyone can call that flow at any time with any volume of tokens to repeat the process automatically. The beauty of this is that it limits the need for developers to run audits for already pre-created flows. This saves significant time developing.

Malloc's domain-specific language allows users to export the flow created in our frontend, so developers can immediately integrate their flow into their project or business. People can create complex one-click flows that could change the speed of deployment for projects and businesses.

The potential uses of Malloc are staggering. Users can create any financial instrument in minutes: token sets, mints (NFTs or tokens!), airdrops, saving accounts, index funds, and complex trades. The options are endless!

How we built it

We used Rust to write our smart contracts, Project Serum’s Anchor framework was used for the smart contracts and frontend smart contract libraries. We modified Anchor to allow for a Vector of Account Info’s to be passed in and opened a subsequent Pull Request on Anchor’s Github. We used React and Typescript for the frontend and used D3.js to render the flowcharts. We also used Typescript to render the flowchart, and Netlify to host our frontend.

Challenges we ran into

Early on, we realized that Solana's account model makes it challenging to have flows where multiple types of tokens are used and where users may be receiving tokens for mints for which they do not have an account. Malloc's SDK now handles creating associated token accounts in real-time to ensure that the user can always execute their flow. This is another benefit of using Malloc for developers, as they do not have to worry about token accounts.

Project Serum's Anchor framework did not support passing in a list of accounts. We had to go through the framework's codebase and modify it. We ended up opening an ongoing Pull Request in the framework.

Testing on devnet posed challenges as there were no markets for project serum that we could find, so we had to set up our own markets.

Orchestrating and simulating the DAG proved difficult and necessary. In order to know which token accounts and mints are assigned to which actions, we had to topologically sort the graph to determine an ordering of which actions get called first. We were then able to determine what input mints and accounts go into every action based on the prior action’s output mints.

Creating a generic abstraction that allows actions to do any arbitrary contract call while maintaining guarantees about the amount it gives out also proved challenging.

We got to know the Solana ecosystem more and more throughout these challenges, and we couldn't be more excited to see it grow!

Accomplishments that we're proud of

Optimizing our Domain-Specific Language and seeing the first interaction with Serum via our frontend was awesome! We were also thrilled to see some of the more complex flows run flawlessly.

When testing our MVP and seeing the potential power of a tool like this added to the blockchain ecosystem, we are incredibly thrilled to see how people will use Malloc!

What we learned

In experimenting with our front end, we realized the potential implications for people having access to a frictionless sandbox to manage the money they truly own. We couldn't be more excited for the future of finance.

What's next for Malloc Protocol

We're thrilled to be developing on such a vibrant ecosystem like Solana! We plan to go live on mainnet and roll out new features to make Malloc a leader in money allocation!

We hope to build out our team in the next few months and start realizing the full potential of the Malloc Protocol!

Head over and test it out! Make sure to read our user guide before using our MVP.

Malloc App

MVP User Guide

Contact

[email protected] Telegram: @nishadpasricha Discord: nishadpasricha#8034

Built With

Share this project:

Updates