# Proteus AMM Engine

{% hint style="info" %}
This is a developer's guide to building with Proteus. For a complete introduction, check out the [Proteus wiki page](https://app.gitbook.com/s/HcJAAgnAk36Ru4lEnsmj/how-shell-works/proteus-amm-engine).
{% endhint %}

## What is Proteus

Proteus is an AMM (Automated Market Maker) engine that is capable of approximating any bonding curve, enhancing Shell Protocol's market-making strategies. It is capable of extremely precise liquidity concentration across multiple price ranges, but still uses fungible LP tokens.

There are two implementations of Proteus: Static Proteus and Evolving Proteus.

## Static Proteus implementation details

It turns out that in order to create any bonding curve and achieve extremely precise liquidity concentration, all you need is 4 parameters: list of slopes of the radial lines in order to create slices, list of values representing relative scale factors of each slice, a list of a values, and a list of b values representing price points of the particular slice.

Those params are labeled as lists of:

1. ms - representing a list of slopes of the radial lines
2. \_as - list of price points of the particular slice
3. bs - list of price points of the particular slice
4. ks - list of values representing relative scale factors of each slice

## Determining ms, \_as, bs and ks values

Determining `ms`, `_as`, `bs` and `ks` values is not an easy task to do. In order to understand them better you may want to spend some time going through the files in `scripts/params` directory of our [public repo](https://github.com/Shell-Protocol/Shell-Protocol/tree/main/scripts/params). You will find examples of different type of pools in that folder, like well known constant product and stablepool.

## Evolving Proteus

Evolving Proteus is an advanced version of the Proteus AMM engine, with which the bonding curve can change every block (or "evolve") during a specified time frame.\
\
Evolving Proteus also differs from Static Proteus in that Evolving Proteus only has one slice. Evolving Proteus is good for liquidity bootstrapping, or any use case that requires a [Dutch auction](https://en.wikipedia.org/wiki/Dutch_auction). It is also good for creating managed pools.

{% hint style="success" %}
For a thorough understanding of Proteus, it is advisable to first read the initial version of the [Proteus White Paper](https://shellprotocol.io/static/Proteus_AMM_Engine_-_Shell_v2_Part_1.pdf), followed by the [updated (second version) White Paper](https://github.com/cowri/Proteus/blob/main/Proteus_white_paper_UPDATED.pdf), and finally, the [Update 3 document](https://shell-protocol.notion.site/Proteus-AMM-Engine-Update-3-7f33b7e1561347b696874a8ba02b9782). The actual implementation of the Ocean can be accessed in our public repository, located within the Proteus.sol file at the [provided link](https://github.com/Shell-Protocol/Shell-Protocol/blob/main/src/proteus/Proteus.sol).
{% endhint %}

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shellprotocol.io/deep-dive/primitives/proteus-amm-engine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
