Proteus AMM Engine

An introduction to the Proteus AMM Engine and an overview of its white paper and reference implementation

“Then spake Proteus, great Naiad, and seas churned beneath his mutable form.” — Sir Edmund Hale

Introduction

(Update: Many details of Proteus have been changed and further improved since the publication of this blog post and white paper.)

Off the island of Pharos, an old sea god lives among the waves. He is primordial, more ancient than man, and his power of endless self-transformation is as vast as the ocean. We hope he finds our newest release an appropriate homage.

The Proteus AMM engine is a tool which allows developers to create liquidity pools with custom bonding curves. Like its namesake, Proteus is incredibly flexible, enabling concentrated liquidity with fungible LP tokens. The new algorithm makes it capable of generating more capital efficient curves than Uniswap v3 or Stableswap.

Alongside the announcement of the Proteus engine, Shell Protocol is releasing two pieces of accompanying material. The first is the Proteus white paper, which explains the underlying algorithm responsible for the engine’s abilities. The second is a Solidity reference implementation, which allows developers to explore and test an example liquidity pool built with Proteus. (Note: the reference implementation is meant as a demo, not to be used in production.)

What is Proteus? How does it work?

The purpose of Proteus is not to create the most capital efficient AMM per se. The purpose is to build an AMM engine that that can implement any trading strategy. That way, financial engineers can design trading strategies without ever having to write a line of Solidity code. An operating system is an abstraction layer between application developers and a computer’s hardware. Proteus’ AMM engine is an abstraction layer between financial engineers and the Ethereum Virtual Machine.

How is this possible? An AMM’s trading strategy is determined by the shape of its bonding curve. For example, a flat bonding curve has highly concentrated liquidity, while one with high curvature has diffuse liquidity.

Proteus uses a bonding curve algorithm based on conic sections, highly flexible geometric objects. This allows the algorithm to replicate virtually any curve, any trading strategy. While it may seem complicated, the algorithm is based on mathematics you could teach to a high school student. In the figure below, we fit Proteus to a Stableswap curve.

Because Proteus is the most flexible and precise AMM engine, it is capable of creating the most capital efficient bonding curves. For example, suppose we want to construct a bonding curve for stablecoins. We want most of our liquidity allocated around the peg, $1.00. However, we also want liquidity to gradually taper off the further away we get from the peg, so there would still be some liquidity below $0.99 and above $1.01. In Uniswap v3, such a curve would require minting at least three separate NFTs. The more precise you want your gradient, the more NFTs you need to mint. With Proteus, you can construct a single curve with a precisely defined gradient all represented by a fungible LP token. This higher level of precision means a financial engineer can allocate liquidity exactly where it is needed. The figure below illustrates the difference between Proteus and Uniswap.

Use cases:

Proteus is a general purpose protocol, applicable anywhere one would want to use a liquidity pool. Some early applications include liquidity mining, stablecoin pools and managed pools.

When incentivizing liquidity for their native tokens, protocols are stuck between a constant product pool that dilutes liquidity across all price points or a concentrated pool that unfortunately issues non-fungible LP tokens. Proteus will enable teams to customize a curve for their specific application and benefit from having fungible LP tokens.

Stableswap is a successful algorithm for stablecoin pools. However, is it really the most capital efficient curve possible? Curve Finance used market simulations and back-testing to find the optimal value of the “amplification coefficient,” a measure of liquidity concentration. The same approach can be applied to Proteus to find an even more capital efficient shape. Proteus has six free parameters, which complicates the analysis but also provides greater scope for optimization. Our initial results suggest that an ellipse with the right shape can significantly improve upon the capital efficiency of Stableswap. This research will be the subject of a subsequent paper.

Lastly, for managed pools such as Visor Finance, Proteus lets developers design the bonding curve that they want, rather than having to mint many NFTs to approximate a certain curve. Currently, Proteus only supports static curves that do not change over time. Future iterations will be able to continuously evolve from one curve to another, opening a whole new design space.

A call for collaborators:

We decided to open source a demo reference implementation of Proteus alongside our white paper for three reasons. First, openness and collaboration is the spirit of defi and we think it is important to preserve this ethos. It is what sets us apart from traditional finance. For that reason, we tried to make both the code and the white paper as accessible as possible.

Second, transparent, accessible code is the surest way to achieve secure smart contracts. If you spot any flaws in our implementation, please let us know!

Third, we want to attract collaborators who can benefit from our work. There are many applications of Proteus and we can’t possibly pursue them all ourselves. If you are interested in working with us or are just curious to learn more, don’t hesitate to reach out on Discord or via email.

Roadmap:

Looking ahead, Proteus is just one half of Shell v2. The other is the Ocean, our accounting and settlement layer. We will release a white paper for the Ocean in due time. Our main focus at the moment is to vet our existing system and get it to a point where we feel comfortable putting the smart contract into production, handling real money. As part of that process, we will begin an audit in early November.

The next major milestone will be a guarded launch, gradually ramping up to a full launch alongside the release of our governance token. The Ocean is rising, and we’re glad to have you onboard.

--

Join the Shell community!
Twitter: https://twitter.com/ShellProtocol
Discord: https://discord.gg/shellprotocol
Telegram: https://t.me/shellprotocol
GitHub: https://github.com/cowri/

Join the future of DeFi.

Use the app

no account needed