Introducing Primitive
0x801D
December 7th, 2021

Acknowledgements

Building this protocol was a collaborative effort that could have not been done without the help of Alex Evans, Guillermo Angeris, Tarun Chitra, and Experience.

Introducing Primitive

Today, we are ecstatic to introduce the Replicating Market Maker ("RMM-01"), a spot exchange and derivative protocol.

While derivatives in traditional finance are massive, DeFi derivatives have yet to grow to a comparative scale. This is in part because they are bottle-necked by their dependence on oracle systems and high collateralization requirements.

Oracles are one of the largest sources of smart contract vulnerabilities and perhaps the largest centralization vector, so we sought out an architecture that excluded them.

Primitive is an oracle-free solution to scalable and efficient on-chain derivatives, reflecting our belief that the future of decentralized finance should not depend on expensive (and often brittle) oracles.

The protocol is slated to launch December 2021 on Ethereum L1 mainnet, Arbitrum L2, and Optimism L2.

The features on launch include:

  • Concentrated fungible liquidity
  • Liquidity pool tokens that replicate covered call options

The protocol can be used for:

  • Earning swap fees as a liquidity provider
  • Swapping between tokens of underlying pools
  • Building structured products using the composable liquidity pool tokens
  • Creating liquidity pools for any token pair

Out of the box, Primitive is the base infrastructure for an oracle-free DeFi and the future of on-chain derivatives.

Read on to learn about "derivative tokens" and how the pools concentrate liquidity as an AMM.

Derivative Tokens

Every liquidity provider to the popular automated market makers ("AMMs") has, implicitly or explicitly, held an underlying derivative: the liquidity pool token ("LPT").

Primitive is not an AMM that trades derivatives, the LPT is the derivative. This specific niche of derivative market has seen some early growth, but has yet to reach the spotlight. For example, there are a few protocols that leverage the LPT as a derivative: Onboarding Uniswap V2 LPTs, Aave AMM Markets Released, Balancer as a portfolio manager, and the idea of "Pool 2", Yield Farmer's Guide.

Primitive leans into this market as an AMM whose primary use-case is having financially useful LPTs. This makes the protocol different when compared to other AMMs, which have arbitrary LPTs that are not the most straightforward to value.

Using RMM liquidity pool tokens, virtually any derivative payoff can be offered or created. For example, in a decentralized lending market like Fuse, these LPTs can be shorted, expanding the possible derivative payoff range to call and put options, and therefore nearly any derivative payoff one could imagine. Structured product and liquidity strategy protocols, like Ribbon and Charm, can use a basket of LPTs to make novel products for any token on any EVM chain. Binary options can be created by selling the rights to one side of the LPT, as researched in Replicating Monotonic Payoffs. A basket of these binary options can be used to replicate an unlimited number of instruments!

Spot Exchange

All of the liquidity which backs these LPT derivatives is productively used as a spot exchange for tokens, just like any other AMM. Better yet, concentrated liquidity curves make these swap rates competitive within the DEX ecosystem, which captures more trading flow and generates fees for liquidity providers.

Liquidity providers are exposed to the price risk of the underlying assets and are not neutral. While the swap fees compensate for the risk, being an LP on Primitive is almost the same as market making covered call options. With this complexity, positions will be optimally managed in a more active way and ideally delegated from most users to vault products like Yearn and Charm.

Tokenization

Liquidity within the RMM is not tokenized itself, enabling higher level smart contracts to make the decision on their own. This allows any token standard to be used: ERC-20, ERC-721, ERC-1155, etc.

Primitive's Manager contract uses the ERC-1155 standard to tokenize liquidity. This comes with several important features:

  • All metadata of the liquidity pool token is aggregated into a single location, the token URI
  • Each token id matches the pool id
  • Multiple LPTs can be batch transferred, enabling more efficient structured products
  • Reduces on-chain state bloat by using one smart contract for all pool tokens, rather than one per pool
  • On-chain image constructed from the metadata, for easy viewing in any wallet!

Cheap Liquidity Management

The core smart contracts can hold internal balances, allowing liquidity to be moved in and out of pools without paying the gas cost of transferring tokens. These token transfer costs are usually 1/3 of the total gas cost for providing liquidity to AMMs. Now liquidity can be moved in and out of pools (for the same pair) with much lower friction.

TWAP Oracles - Spot and Implied Volatility

The state of reserves for these pools are valuable on-chain resources which can be weaponized into TWAP oracles. This is done by utilizing the cumulative reserves of a pool and viewing it over a select time range.

While this oracle would be for spot prices, a TWAP oracle for volatility can also be created using the cumulative liquidity of a pool. Mapping the most liquid pools to their respective volatility curves gives incredible insight into the implied volatility of the token pair.

Although ideally, oracles wouldn't be needed in an RMM world.

Audits and Bug Bounty

Several professional smart contract security firms were engaged to review the core and peripheral contracts of the Protocol:

While we believe such a range of serious audits is the absolute minimum safety measure in the DeFi, the complexity of the protocol and the ecosystem means that a completely bug free codebase can't ever be guaranteed.

As such, an open bug bounty of $250,000 is offered through Immunefi to anyone who finds a critical bug within the smart contracts.

Launch Details

The Primitive Protocol will be deployed to testnet during the week of December 7, 2021, allowing anyone to use the protocol in advance of the launch.

  • View the Primitive RMM Core repository for the source code of the AMM.
  • The Primitive Manager repository has the smart contracts which users will be interacting with.
  • Visit the Primitive Examples repository to check out some of the early ideas for products on top of the protocol.
  • Use the RMM Simulator developed by Experience to model LPT payoffs.

For launch to go smoothly, we will focus during the remainder of December on these priorities:

  • Testing and review of the protocol's smart contracts
  • Supporting integrations with other products and protocols
  • Interface design and functionality finalized
  • An analytics site to explore the Primitive pool ecosystem
  • Further documentation, tools, and examples to support the ecosystems growth

Community

Go tell your friends about the oracle-free derivative protocol launching this month with concentrated and fungible liquidity.

To meet the rest of us, join the Primitive discord.

Published on Mirror

Read this post on mirror: mirror.primitive.eth.

Published on Primitive

Read this on the Primitive blog: blog.

Learn More

Visit the website: primitive.finance.
Visit the docs: primitive documentation.
Follow Primitive on twitter: primitivefi.

Arweave TX
h7FHv0ugNaez4k0vxOKtVcFON6fXKUdhCyZBoi8ZVl0
Ethereum Address
0x801D5e44960C5934181B04290Ec7F6A27d96cFF1
Content Digest
l5F1BLMhfmcm_B1R2w-by003_oiAz2-Ir_Jj_rCvGCs