Skip to main content


The Replicating Market Maker (RMM-01) protocol is a collection of immutable smart contracts written in Solidity. Inspired by other projects such as Uniswap, the architecture is divided in two parts, the "core" and the "manager", interacting together.

Here is a complete overview of the protocol:

Contracts flow


The core part designates both the PrimitiveEngine and the PrimitiveFactory contract. The former is the actual low-level implementation of the RMM protocol, and the latter is responsible of deploying new engine contracts.

The PrimitiveEngine is designed to be minimal and gas efficient, only implementing the fundamental functions of an AMM: provide liquidity, remove liquidity, and swap between the pool's tokens. This Engine has an extra feature to carry an internal token balance (called margin), which will save gas by reducing token transfers; token transfers are usually a considerable portion of the gas expense.


The manager part designates the PrimitiveManager, PositionDescriptor and PositionRenderer. The former contract is responsible of interacting with PrimitiveEngine contracts and managing users' positions, and the two other contracts are taking care of the metadata and the rendering of the liquidity pool tokens.