Liquidity providers (LPs) can use the Primitive RMM-01 protocol to create portfolios that express directional views with respect to asset prices. Setting an out of the money (OTM) strike implies an expectation of positive market movement while setting an in the money (ITM) strike implies expectation of negative market movement. Implied volatility (IV) and time to maturity parameters describe the dynamic behavior of concentrated liquidity.
The key insight is that the directional view that LPs derive from their parameter selections can be used to provide dynamic concentrated liquidity adapted to market conditions. In contrast, Uniswap LPs cannot specify a market direction due to the symmetric behavior of the pricing function. While RMM-01 pools have dynamic concentrated liquidity based on the initial Black-Scholes parameter selection, Uniswap V3 concentrated liquidity is static and does not adjust to changing market conditions.
This article analyzes the performance for a recent ETH/USDC pool created on July 5, 2022 and expired July 10, 2022. Pool profitability hinges on setting parameters that accurately describe the direction and behavior of the market. The efficacy of dynamically concentrated liquidity distributions are analyzed by the statistical kernel density estimate (KDE) tool. Code can be found in this jupyter notebook, and can be easily modified to analyze any other RMM-01 pool.
In April, Primitive launched its first product, RMM-01, a decentralized finance (DeFi) protocol that allows users to earn trading fees from automated trading. When the protocol reached nearly 1000 cumulative users, we analyzed the accounts to determine their authenticity.
On the RMM-01 protocol, nearly 80% of users were identified as suspects in Sybil attacks. In response, Primitive developed a straightforward method for detecting and filtering these users. While Primitive uses this tool to remove noise that Sybil attacks impose on user data, other DeFi protocols can expand the open-source code to suit a large array of their own needs.
DeFi protocols commonly use airdrops as a method to launch tokens. This method rewards early users of the protocol by "airdropping," or giving, the users free tokens. Sybil attacks can be initiated to exploit airdrops in DeFi protocols.
In 2020, the first alpha Primitive contracts were deployed for the V1 protocol. One of the peripheral contracts was discovered to have an approval vulnerability, which was detailed in the postmortem available here.
As the Primitive team prepares to launch the new, fully audited RMM Protocol smart contracts, we want to remind all of Primitive's early users to revoke any outstanding approvals for those vulnerable contracts made between December 2020 and February 2021. Those contracts are non-upgradeable, which means the only action possible must come from the user.
This is a fairly common vulnerability which makes it even more important for every user to be aware of proper approval management. Approvals should be exact instead of infinite, or revoked after users are finished with using a protocol.
Primitive Replicating Market Maker ("RMM") is a supply source for tokens and option derivatives*. Existing as a free, unchangeable, and unowned protocol, RMM is the purest form of decentralized infrastructure.
Anyone has the freedom to provide capital to the RMM pools and earn fees, providing a service of filling the other side of token trades, and eventually option trades. There are no gatekeepers, no pausing (i.e. circuit breakers), and markets run 24/7.
By the end of this primer, you will have a better understanding of using the protocol to hedge risk or take advantage of time-based strategies as a market participant. There are concrete example scenarios to help you grasp the different nuances present in the protocol.
Secret highlight of the week, here’s a keccak256 hash of the description:
Most impactful highlight of the week is Verumlotus's implementation of a Theta Vault built on Primitive. It is based on Ribbon Finance's Theta Vaults, and manages liquidity in Primitive RMM pools on behalf of depositors.
We are now 4 weeks into the RMM Interface Testnet, and the response from our community has been amazing. Since the beta launch, we have collected a litany of detailed bug reports, feature requests, and UX feedback. I bring great news, the devs have been doing something.
Beta 5 is now live at app.primitive.finance.
Optimizing Solidity code allows users to pay less transaction fees when they are interacting with dApps, however mastering gas golfing requires some tools and practice. Here comes Marmite: a Hardhat plugin helping developers perform gas cost comparisons among different Solidity code snippets.
"You can cook good Solidity recipes with marmite."
- Clément Lakhal, Chief of Protocol at Primitive
Around Christmas last year, transmissions11 offered us one of the best gifts a team of Solidity developers could ever dream of: pull requests full of gas optimizations!
We are excited to open source the RMM SDK, a developer tool that makes it easier to build on top of the RMM protocol.
Interacting with any web3 protocol comes with hurdles: parsing on-chain data, modeling smart contract state, and displaying information in a clear way. This developer kit exposes several "entities", which are models of the smart contracts, and "managers" to help construct transactions (but not execute them!). Use the SDK to easily tap into the RMM protocol, derive useful information for users, and safely build transactions for them.
The Primitive team is using the SDK to build an innovative liquidity product on top of RMMs, and now anyone can do that with it being open source. The RMM protocol is designed to be maximally composable through its oracle-less, dependency minimized architecture. These are some of the straightforward use cases for the app layer of RMMs:
Over 2,500 users hold RMM liquidity positions across six different test pools. In addition to that, the discord has almost 3,000 members along with more than 60 feature requests and 60 bug reports for the app.
Today the $1m bug bounty on the Primitive RMM smart contracts goes live. We are ruthlessly hunting any high level or critical issues in the smart contracts before they are launched this month.
View the bug bounty details on Immunefi.
Primitive directly handles a $250k portion of this bug bounty, while Sherlock has committed the remaining $750k. Being under the umbrella of Sherlock Protocol has improved the protocol security by tenfold through direct smart contract review, coverage, and incentivizing bugs to be reported rather than exploited.
The smart contracts have a scheduled audit starting in January with Trail of Bits. These audit weeks will cover the RMM contracts (which have already been audited). This final review will give us full confidence in the security of the protocol, cementing its status as an immutable and anti-fragile system, as all low-level primitives should.
Every user that interacts with a DeFi product runs the risk of total loss. This risk remains elusive to the user, overshadowed by intangible underlying risks. For all Primitive products, no user will walk away with zero if a hack or economic exploit takes place.
Primitive is purchasing $10m of coverage for its users through Sherlock Protocol. This entitles all users to claim a portion of USDC from the pool in the case of an adverse event.
This coverage also comes with the benefits of increased security:
Good documentation for a DeFi protocol is absolutely mandatory, but writing it can be sometimes cumbersome. Here comes Dodoc: a super simple Hardhat plugin allowing you to generate documentation for your smart contracts with no hassle!
A couple of weeks ago while wrapping up the contracts of our brand new Replicating Market Marker, we decided to have a look at the current solutions to generate and host our contracts documentation.
Today, we are ecstatic to introduce the Replicating Market Maker ("RMM-01"), a spot exchange and derivative protocol.