What to Build on Shell
An exploration of what you can build on Shell
Shell's Ocean contract acts as a DeFi accounting hub on the EVM, making it simple and more gas-efficient to handle several tokens or interact with many protocols within a single transaction.
If you’re familiar with DeFi, you have probably heard the term “money legos” or “financial primitives” used to describe the various independent DeFi products and protocols. Like lego bricks, the dream is to be able to combine different DeFi protocols together, in order to build more sophisticated financial tools. However, this isn’t as easy as it sounds because it requires the universe of EVM smart contracts to be interoperable. This is the vision of Shell: to make EVM smart contracts more modular and easier to assemble — and in the process, pare down the amount of code overall, reducing the attack surface for the ecosystem.
Specifically, under the Shell architecture builders can extract the “accounting logic” from the “business logic” of any DeFi protocol. Accounting logic is the code that transfers tokens between wallets. Business logic is the code that computes how many tokens to move. In the case of an AMM, the business logic computes the exchange rate. For a lending pool, the business logic computes the interest rate.
Fig 1: Disentangling business logic from accounting logic to make DeFi protocols more modular.
Once we disentangle the accounting logic, it becomes possible to standardize it and outsource it to the Ocean contract, where the same code can be shared by all primitives. It turns out that there is a universal pattern shared by all DeFi protocols: the accounting logic takes a token as input, and then returns another token as output.
As our research shows, the typical DeFi protocol can decompose their business logic from a monolithic mass into smaller, discrete logical components. At Shell, we realized the smallest logical unit of “business logic” in any DeFi protocol could be standardized according to the input and output tokens it sends to an accounting system (before and after it performs its computations). Specifically, a modular financial primitive could look like this:
In this example, the user specifies the input token, the output token and the amount given to the primitive. All the primitive needs to figure out is how much of the output token to give to the user. We can use this interface to standardize an accounting system across all DeFi protocols, without any effect on the infinite possibilities of each one’s internal business logic. We call these standardized smart contracts “DeFi primitives.”
The real magic of standardized accounting is not just that there’s less code to write. It also means that every single DeFi primitive is natively composable with every other DeFi primitive that shares the same accounting hub. That means any protocol on the Ocean may be combined in a permissionless way with many other protocols — all in a single, atomic transaction.
Unsurprisingly, Shell’s network effects will be most useful when it has a large network of DeFi primitives. You can be one of the first to build a primitive on Shell. As an early Shell primitive, not only would you get early access to Shell’s liquidity and devoted community, your primitive (perhaps an AMM, a lending protocol, an NFT market, etc.) could be one of the foundational building blocks incorporated into other protocols in the future.
Speaking of AMMs, you may have heard that the Proteus AMM Engine allows concentrated liquidity and a time-evolving bonding curve, as well as fungible LP tokens. But the real beauty of Proteus is how it can be used within a fractal network of liquidity pools, made possible by the Ocean. (The next article details the process of constructing an AMM using Proteus.)
In other words, it’s a technical stepping stone to the next generation of AMMs: modular and hyper-composable. For example, imagine you hold LP tokens from a DAI+USDC AMM. You could put these LP tokens on one side of an ETH+(DAI+USDC) AMM, and end up holding LP tokens that represent ETH+(DAI+USDC). Using the same principle, you could build any type of multi-asset AMM. Another possibility with Shell is the creation of NFT AMMs. Here’s how it could work:
The Toucoin AMM will be Shell Protocol’s first NFT AMM. It is an AMM composed of two tokens: one a simple USD stablecoin, and the other one is Toucoins. Toucoins are in fact tokens that have been created from another primitive, the Government Toucan NFT “Fungibilizer” — whose purpose, as you may have guessed, is to convert any Toucan NFT into fungible tokens.
Users will be able to provide liquidity to the Toucoin AMM by first “fungibilizing” their Toucan NFTs. And guess what? This action can be batched together with any other token swap or liquidity action that users want to make in Shell.
Perhaps you have your own idea for implementing an NFT AMM. Or perhaps you’re interested in building an AMM for options, perpetuals, interest rate swaps, or something else entirely. Maybe you’d simply like to contribute to the research efforts in this field. Maybe you’d like to investigate which financial or mathematical models we should be implementing in smart contracts in the first place — and perhaps even dream up the next version of Proteus.
If you read about the MEV Harnessing System, you’ll know that the design of Shell makes it possible to build a totally new type of MEV system. Similar to the way limit orders work, the Ocean contract allows users simply to specify the minimum amount of tokens they would accept at the end of a trade, and then lets anyone (i.e., a “good” MEV bot) execute that trade on the user’s behalf. The more efficient the transaction path, the greater the profit for the MEV bot.
In this way, not only does Shell reverse the incentives so that MEV bots must now compete for the user’s benefit — it also means that end users no longer have to hold ETH to pay the gas for their transactions. Instead, the gas cost can be priced into any trade (deducted from whatever tokens the user sent). Only the MEV bot pays the gas, meaning it is the only party that ever needs to hold ETH.
The MEV harnessing system is a brand new concept, so there are still many open challenges in building it out. If you’re already brainstorming a plan for organizing the MEV bots, or you’re inspired by the possibilities of gasless transactions, this could be a greenfield project for you.
The variety of new possibilities offered by Shell requires a dynamic, composable, and intuitive user experience. Not only will we need to develop tools for financial engineers to interact with and compose together DeFi primitives, but we will need a sophisticated graphical user interface for the average user as well, one that incorporates the many possibilities of different types of tokens — LP tokens, NFTs, and other financial products alike. Not only this, but imagine seamlessly integrating MEV protection into that user experience as well.
You could call it… the UX combinatrix!
These are just a few ideas and possibilities. Are you inspired by Shell? Do you have another idea about what to build? Hop in the Discord and share!