{"content":{"body":"### Introduction\n\nPrimitive 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.\n\nAnyone 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.\n\nBy 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.\n\nRead more to learn about the primitive behind the magic.\n\n\\**Replicated option derivative payoffs, not option contracts. [\"In layman’s terms, replication is four fives for a twenty: they behave exactly the same (they’re each worth twenty dollars), but they look completely different (one is four pieces of paper, the other is one piece of paper)\"](https://www.analystforum.com/t/replication-in-derivatives/124631). There are no promises the payoffs will be received.*\n\n## Decentralized Exchanges are Liquidity Sources\n\nThis primer assumes a basic knowledge about decentralized exchanges, token trading, and popular protocols like Uniswap, Curve, and Balancer. Token trading is the most fundamental backbone to decentralized finance - enabling more markets like lending and derivatives.\n\n#### Dex Volume 2019 - 2022\n\n![](https://hackmd.io/_uploads/H15WOIUAF.png)\n\nWithout knowing anything about these protocols in the chart, it goes far to know that the majority of them rely on the same \"idea\", and together they make up almost all of the token trading activity on Ethereum.\n\nThis section is a brief overview on how these dexes work and how they can be used for token and option trading.\n\n### How to Make a Decentralized Exchange\n\n#### Trading curves of different protocols\n\n![Different AMMs](https://hackmd.io/_uploads/B1Pr5gy19.png)\n\nConstant Function Market Maker (\"CFMM\") based decentralized exchanges (e.g. Uniswap, Curve, Balancer) facilitate the lion's share of on-chain token trading volumes. The success of CFMMs as spot markets can be attributed to several crucial properties that they all share: ability to support any token pairs, high degree of capital efficiency, predictable behavior, and a relatively straightforward user experience. At a high level, CFMMs facilitate trades between two counterparties, \"traders\" (users that swap one token for another) and \"liquidity providers\" (users that make their tokens available for trades to earn fees).\n\n#### Constant Function Market Maker Trading\n\n#### Trading in a Primitive RMM Pool\n\n![RMM pools with different IV](https://hackmd.io/_uploads/HkafJ60AY.png)\n\n#### Buyers\n\nTraders are users that own one token (e.g. ETH) and demand another (e.g. USDC). Traders swap assets on a CFMM by sending transactions specifying some amount of tokens for other tokens, less a small fee. The average price a trader pays is dependent on both the ratio and amount of tokens in the pool prior to the swap (e.g. 100ETH/100,000USDC), the trade size (smaller swaps beget a better average price), and the trading function (we'll get to this later).\n\n#### Suppliers\n\nOn the other side of this trade are the liquidity providers. Liquidity providers add two tokens to a liquidity pool contract. This liquidity contract accepts transactions swapping from token A to token B and token B to token A. Whenever traders execute swaps from either direction, liquidity providers collect fees proportionally based on their provided tokens compared to the total tokens in the pool.\n\n#### Market Making\n\nFrom a high level, tokens are made available by market participants to be the other side of trades for users who want to swap their tokens. The tokens available are implictly priced by a rule, called the trading function, which comes from basic math. This technology works exceptionally well on networks like Ethereum because it automates the process of supplying tokens to the other side of trades; a reason they are often called Automated Market Makers (\"AMMs\").\n\n## How to Earn a Return using CFMMs\n\n#### Payoff of Liquidity in CFMMs\n\n![Payoff Comparison](https://hackmd.io/_uploads/BJ0ZSWky9.png)\n\n#### Liquidity Providers\n\nIn this section we will dig a bit deeper into what it means to provide liquidity to a CFMM, as well as how/when you might want to do so.\n\n#### Price of the Asset over time\n\nThe final payoff of a liquidity position on a CFMM is determined by the trading function and the asset's *price path*. Price path is taking into account the prices that the asset has reached over a time period. There are unique price paths along which providing liquidity to a CFMM can be advantageous or disadvantageous. Say, for example, your portfolio (a liquidity position) has 1 ETH and 0 USDC. If the price of ETH doubles, your portfolio value will also double.\n\n#### Impermanent, or Divergence, Loss\n\nIn the case of the ETH 2x price path, if you had provided liquidity to a CFMM that demands an equal weighted (50% ETH, 50% USDC) portfolio, you would have suffered what's known colloquially as \"Impermanent Loss\" (opportunity cost) by not capturing the full increase in ETH's price because the portfolio was not 100% exposed to it. This phenomenon occurs because as the price of one asset in a CFMM pool increases, LPs are effectively buying the cheaper asset (in this case USDC) on the way up. You would've profited in the end, but you would've missed out on that sweet sweet 2x.\n\n#### Status Quo Strategy\n\nSo when does providing liquidity to a CFMM work to your advantage? The strategy name for adding liquidity to a CFMM which maintains a constant portfolio weight of an amount of assets is \"mean reversion\". A mean reversion strategy wants the prices of the token pair in a liquidity pool to be correlated in the medium run. In the ETH 2x case described earlier, in order to obtain the optimal terminal payoff the price of ETH would have to drop 50% to that at which you had initially added liquidity (hence the name, impermanent loss).\n\n#### In summary\n\nProviding liquidity to a CFMM creates a portfolio that is implicitly long a mean reversion strategy where price variation works in your favor so long as the prices of the assets revert to that which it was originally.\n\n## Options\n\n### What is a call option?\n\n#### Long Call Option\n\n![Long Call Payoff](https://hackmd.io/_uploads/Bk2fHZky9.png)\n\n#### Buying Calls\n\nBefore getting back to CFMMs, let's walk through a brief primer on call options. A call option gives the right to purchase an asset for a pre-determined price up until an expiration date. These properties of an agreed upon price and expiration date give the **call option** itself its own value, beyond the underlying asset. To own a call option in traditional markets, it is purchased from another party on an options exchange.\n\n#### Short Call Option + Asset - Covered Call\n\n![Covered Call Payoff](https://hackmd.io/_uploads/Bkm7S-yk5.png)\n\n#### Supplying Calls\n\nThe party selling (shorting) a call option is liable to sell their assets if the option buyer chooses to exercise, (buy the asset for the strike price). In traditional exchanges, most of these assets do not need to be put up as collateral because the terms of the option contract are legally enforceable. However, in DeFi, there is no way to enforce the delivery of the underlying assets, unless they are already deposited. It's for this reason that call options in DeFi are collateralized, and this **combined position of selling a call option + depositing the collateral is a covered call option**.\n\n## Covered Call Options and CFMMs\n\nEarlier in this article we discussed how **CFMM liquidity maps onto a unique payoff structure** (mean reversion). Likewise, covered call options offer their own distinct payoff structure.\n\nCovered call strategies and mean reversion are similar in that they both offer what's called a \"concave payoff\". To summarize, a concave payoff is a payoff that has a discrete central barrier at which returns are maximized (see above graph).\n\nIn the case of a call option, that barrier is located at the strike price (K). That is to say, the max payoff for a party selling a call option is obtained if the price of the underlying is equal to exactly K at expiry. Similarly, the max payoff of a CFMM liquidity provider is obtained if the price of the underlying token reverts to its initial price.\n\nThe **important difference** between these two strategies is rooted in the fact that covered calls allow you to take a directional view on future price. Choosing a strike price greater than the market price of an asset implies a **directionally bullish opinion** on the asset price.\n\n## RMM is a Covered Call CFMM\n\n#### The Curve\n\n![RMM](https://hackmd.io/_uploads/BJnXS-1y5.png)\n\n**RMM curves value pool assets based on price, volatility, and *time*.** It is these properties which make RMM a new primitive.\n\n#### The Payoff\n\n![Payoff of RMM](https://hackmd.io/_uploads/H1SzAfJ1c.png)\n\n#### Change in Implied Volatility - All else constant\n\n![RMM Parameters - IV](https://hackmd.io/_uploads/HJqVrCCCY.png)\n\n#### Price of swapping on different IV Curves\n\nRMM curves with different implied volatilities will have different costs when swapping. Trading in a higher IV curve will lead to a higher price of the asset being purchased, while trading in a lower IV curve is the opposite. This will affect the external arbitrageurs who only rebalance pools when it is profitable to do so - there must be a larger profit opportunity in higher IV pools to warrant a rebalance. This has the consequence of affecting the fees that will be generating, as less rebalancing means less fees.\n\n#### Change in Time until Expiry - All else constant\n\n![RMM Parameters - Maturity](https://hackmd.io/_uploads/SkQwAlJy5.png)\n\n#### Price of swapping as pool gets closer to expiry\n\nIf only time changed, the curve also experiences \"Liquidity Compression\" until trades can be executed at a fixed cost equal to the strike price. This compression is sometimes described as \"concentration around the strike price\", as the price of the asset is constant and equal to the strike price as expiration.\n\n#### RMM Curve Changes over Time\n\n![RMM Parameters - Maturity](https://hackmd.io/_uploads/S1ZmS00Ct.png)\n\n#### Time until expiry affects expected fees\n\nThe distance between the curves with a lot of time until expiry and zero time until expiry is equal to the total fees expected to be earned by the liquidity provider. This does depend on the implied volatility and swap fee of the curve, as these parameters impact the probability of capturing the expected fees.\n\n### RMM Liquidity\n\nPrimitive RMMs benefit from the same properties present in other CFMMs, but with the distinct advantage of being able to express more nuanced opinions about future price.\n\n![Example #1](https://hackmd.io/_uploads/Skh8z11yq.png)\n\nThese are some of the additonal benefits you can see from using RMM in lieu of other CFMMs:\n\n1. Liquidity providers choose the point at which impermanent loss begins (K).\n2. Liquidity providers can directly bet on volatility (σ), earning more or less fees depending on the accuracy of the bet.\n3. Liquidity providers earn theta over time, i.e. fees generated as pools get closer to expiration (τ).\n\n#### Choose a price strategy\n\nWith RMM you're not limited to mean reversion strategies. Instead, you can deploy a position that expresses a directional view on the future price of a token. Doing so requires thoughtful strike price (K) and expiry (τ) selection. For example, if the price of ETH is 3000 USDC, but you believe that one month from now that price will be 4000 USDC, you can express that view by providing liquidity to an RMM that expires in one month (τ = 1 month) with a strike price of 4000 USDC/ETH (K = 4000 USDC). This position has the highest expected return if the price of ETH reaches a terminal value of 4000 USDC at expiry. The caveat to this is that if you're incorrect about the price path, for example if ETH goes to 2000 USDC in that same timespan, you are exposed to greater impermanent loss and will likely make *less* fees relative to a comparable xy=k position (how about hedging with another RMM?).\n\n#### Choose a volatility strategy\n\nHow about that volatility (σ) thing? In general, a volatility near the market IV ([just check the chain](https://lambert-guillaume.medium.com/on-chain-volatility-and-uniswap-v3-d031b98143d1)) for a given pair should serve as a good proxy for volatility selection. Volatility in an RMM prescribes the degree of liquidity concentration around the strike price. If the strike price of the curve is set to 4000 USDC, a 100% position will have *less* concentrated liquidity at 4000 USDC versus a 90% one. That means the 100% position would likely earn less fees than the 90% one, should the terminal price at expiry land at 4000 USDC. The tradeoff here comes in the form of greater impermanent loss for lower volatility positions.\n\n#### RMM Liquidity Tokens\n\nEvery liquidity token minted from depositing into a CFMM has a **payoff**. For RMM, the **liquidity token payoff is a covered call**.\n\nThe method to convert this payoff into the trading function is explained in the [Replicating Market Makers](https://rmm.eth.xyz) paper. Primitive's RMM protocol is an implementation of this.\n\n## Ways to use\n\n### Provide Liquidity\n\n* Each RMM is a two token pool which accepts deposits and mints RMM liquidity tokens. These liquidity tokens are a new DeFi primitive designed to replicate the payoff of a covered call by capturing theta decay through trading fees.\n\n### Swap\n\n* Every pool is composed of two tokens which can be exchanged for one another at any time up until the *expiration date* of the pool. Trading fees are earned by the liquidity providers on a continuous pro-rata basis and are re-invested into the pool.\n\n### DeFi Protocols\n\n* The RMM liquidity tokens are instantly redeemable at any time for their underlying assets. This makes it a highly composable instrument that can be **used as a collateral asset** for borrowing. Adoption for CFMM LP tokens has grown immensely in 2021, which are now supported across some of the top protocols like Tribe and Aave.\n\n### As a Market Making Vault\n\n* Liquidity in RMMs must be rebalanced based on time, volatility, and price. Along with that, the pool's trading fee is also a parameter than can be chosen by a pool creator. Vault strategies can be built around time preferences or volatility preferences, giving end users easy access to a huge source of sustainable yield: theta.\n\n### As a Structured Product Vault\n\n* Structured products maintain a portfolio of assets or derivatives which follow a strategy on behalf of depositors. RMM liquidity tokens can be used as a tool to hedge out risk (e.g. underlying asset price risk) or tap into specific exposures, like theta.\n\n### As a Large Yield Optimizing Vault\n\n* One of the hurdles for yield optimizing vaults is as they scale into TVL of $ billions, there are not many sources which can sustain strong returns. The theta from options comes with risk, but it also is sourced directly from the volatility of the underlying asset. Vaults which utilize option strategies can earn outsized yields in high volatility environments.\n\n## Comparisons\n\n![Comparison Table of Payoffs](https://hackmd.io/_uploads/rysjaAAAY.png)\n\n### Compared to Uniswap xy=k curve:\n\n* Impermanent loss only occurs after the strike price, making liquidity provision *directional*.\n* RMM curves concentrate liquidity over time vs. Uniswap V3's fixed concentrated liquidity.\n* Trading fees are designed to be dependent on time and volatility, while Uniswap's fees are dependent on volatility.\n\n### Compared to Covered Call Options in DeFi:\n\n* No reliance on oracles reduces risk and easily supports long-tail assets.\n* No need for a direct counter-party to generate theta/fees.\n* Instantly redeemable for underlying and quote asset vs. covered calls which is a position that needs to be closed in an exchange.\n* Highly composable and a better collateral asset because of redeemability.\n\n## Liquidity Provision in Practice\n\nCovered calls are inherently directional bets which are best to take advantage of in high volatility environments. It is ideal to provide liquidity when the underlying asset's volatility is high, and the expected price of the asset will not exceed the strike price by expiration.\n\n#### Choosing your strategy\n\n![RMM Curve Parameters](https://hackmd.io/_uploads/rywlOky19.png)\n\nEach RMM Pool is a \"theta curve\" with the following set of parameters:\n\n* **Strike price**: Each liquidity token is composed of strike price amount of quote tokens if the price of the underlying asset is greater than this strike price. When the pool expires, the underlying asset can be bought or sold for this strike price amount. This will incentivize the re-balancing of the pool such that the each liquidity pool token is worth strike price of the quote asset.\n* **Implied Volatility**: The expected volatility of the underlying asset over the time period until the expiration date. Higher implied volatility will make trades have higher price impact (cost), and lower implied volatility will make trades have lower price impact. If realized volatility of the asset is less than the chosen implied volatility, there is a lower chance that liquidity providers get their expected theta (trading fees).\n* **Maturity**: The expiration date at which no more trading in the pool can occur, and thus no more trading fees can be generated. Liquidity providers can withdraw their liquidity at any time, before or after.\n* **Gamma**: Used to compute the trading fee of the pool. For example, if a pool's trading fee is 1%, its `gamma` will be 99%. Each swap must pay the trading fee to the liquidity providers, which gets automatically re-invested into the pool.\n\n### Example #1 - Choosing a Far Strike Price\n\nOn January 10, 2022, Alice notices the volatility of YFI has increased sharply since announcing their new tokenomics plan. The coin trades at $32,000 right now, and Alice believes it won't exceed $100,000 by March. Alice also believes it can double in value to $64,000 by then. She wants to take advantage of the volatility and price movement, so she provides liquidity to an RMM that expires March 11, 2022, with a strike price of $100,000 and implied volatility of 150%.\n\nThe amount of value in stable units (e.g. $) of liquidity that Alice must provide is calculated using the **Portfolio Value formula**:\n\n![](https://hackmd.io/_uploads/ByDYr-y19.png)\n\n### Depositing Tokens\n\n#### To summarize the initial position on January 10:\n\n* Current Price: $32,000\n* Strike Price: $100,000\n* Maturity: March 11, 2022\n* Time until expiry: \\~3 Months\n* Implied Volatility: 150%\n* Value of Alice's deposit V(S) in $: (0.8737 + $2909) = $30,868\n* Value of Alice's deposit V(S) in YFI: (0.8737 + $2909/$32000) = 0.964\n\n#### Derived information:\n\n* Call price with those parameters is C: \\~$1,132\n\nNotice how the value of the covered call is just the current price less the premium. E.g. S - C = V(S), $32,000 - $1,132 = $30,868.\n\n#### Capital Efficiency\n\nTherefore, liquidity is being **efficiently** used to \"back\" these tokens that have the payoff of a covered call. When compared to covered calls issued on other option protocols, full collateralization is required, sometimes even locked, to mint the call tokens. Going further, these LP tokens are instantly redeemable for their underlying assets at any time, which makes it a strong collateral asset. Using the LP token as a collateral asset to leverage a position is capital efficiency increase that RMM is capable of supporting - but that is left to a future primer.\n\n#### On or After Expiration\n\nLet's say assumptions proved right for Alice, and three months later YFI is trading at $77,000 with implied volatility over the period being effectively realized. The most important assumption here is the choice of implied volatility (IV). If the realized volatility of the underlying asset diverges from the choice of IV, its possible the replication is not as precise. In that scenario, Alice would have been better off moving their liquidity a lower IV curve. But, because RV was close to IV, the replication was very precise and Alice got the expected payoff. This is a **critical** choice that is being made when liquidity is provided.\n\n#### Exiting Position at Expiry\n\nThe pool has eclipsed its expiration timestamp, and Alice decides to exit her position. Assuming the pool had sufficient liquidity to attract traders and arbitrageurs, the trading fees and final swaps should cause the pool to be 100% composed of YFI.\n\nThis is because the underlying assets in an expired RMM pool can be bought or sold for the strike price. This will incentivize traders/arbitrageurs to purchase all the underlying assets from the pool if the price of asset (e.g. on another dex) is more than the strike price. In the opposite scenario, traders/arbitrageurs will sell as much underlying assets to the pool until the pool only has underlying assets in the if there exists a reference price of the asset that is less than the strike price.\n\n### Withdrawing Tokens\n\n#### March 11, 2022: Alice removes liquidity when YFI is $77,000 and realized volatility over that period was 155%.\n\n* YFI Price: $77,000 (\\~2.4x increase).\n* Realized volatility >= Implied volatility, therefore high probability that the LP token in practice has this payoff.\n* Liquidity token composition: 0.00% in $, 100.00% in YFI\n* Value of Alice's deposit V(S) in $: $77,000 (\\~2.5x increase, $77,000 / $30,868).\n* Value of Alice's deposit V(S) in YFI: 1 (+3.73% increase in YFI, 1 / 0.964 ).\n\nAlice took the risk of redeeming $100,000 if YFI's price was above that by expiration date. In exchange, she is rewarded with the 3.73% gain in YFI. This extra return denominated in the asset also led to an overall higher return when denominated in a stable coin. Notice that YFI's price increased by 240% and Alice's position increased by 250%, 10% more.\n\n### Example #2\n\nAlice loves using RMMs, she made a strong risk-adjusted return and felt confident in the security of the protocol.\n\nShe continues to believe that in 3 months YFI will not be above $100,000, so she decides to enter in a new position.\n\n### Depositing Tokens\n\n#### March 20, 2022: Alice provides liquidity when YFI is $80,000\n\n* Current Price: $80,000\n* Strike Price: $100,000\n* Maturity: June 21, 2022\n* Time until expiry: \\~3 Months\n* Implied Volatility: 150%\n* Value of Alice's deposit V(S) in $: (0.469 YFI + $25062) = $62,582\n* Value of Alice's deposit V(S) in YFI: (0.469 + $25062/$80000) = 0.782\n\n#### Derived information:\n\n* Call price with those parameters is C: \\~$17,418\n\n#### On or After Expiration\n\nUnfortunately, this time Alice was wrong. Its June 21, 2022 and YFI is trading at $135,000. What happened to her deposit?\n\n### Withdrawing Tokens\n\n#### June 21, 2022: Alice removes liquidity when YFI is $135,000 and the realized volatility over that period was around 150%.\n\n* YFI Price: $135,000 (\\~1.6875x increase).\n* RV >= IV, high chance replication success if sufficient liquidity in pool during lifetime.\n* Liquidity token composition: 100.00% in $, 0.00% in YFI\n* Value of Alice's deposit V(S) in $: $100,000 (\\~1.5979x in $, $100,000 / $62,582).\n* Value of Alice's deposit V(S) in YFI: 0.7407 (-5.3% decrease in YFI, 0.7407 / 0.782).\n\nWhile Alice did get a good return in $, if she wanted to earn a return denominated in YFI she would have been better off to hold all of her deposit in YFI. The actual price of YFI was more than the strike price of the pool, $35,000 more, which incentivized arbitrageurs to buy all the YFI from the pool at a price of $100,000. The pool is then 100% composed of $, which liquidity providers like Alice eventually withdraw.\n\n#### So, what was the tradeoff that Alice took?\n\n* Trading lower probability of potential gains (YFI price increase above $100k) for higher probability of profits (trading fees).\n\nIn the opposite scenario, If YFI's price was *below* $100,000 at the maturity:\n\n* Alice withdraws 1 YFI, earning a 28% (!!!!) return on YFI. *Note: High return because of IV parameter curve being high, and realized volatility was close to it*.\n\nAnd what was the belief/purpose of providing liquidity to RMM?\n\n* Not confident in YFI being above $100,000 in 3 months.\n* Wanted to capture trading fees, i.e. theta decay, generated from YFI's volatility.\n* Wanted to earn a return denominated in YFI.\n\n## RMM Strategies\n\n### Choose Impermanent Loss Price Point\n\nIn short term bearish environments, like a prospective FOMC meeting, prices are dampened and volatility is heightened. This is an optimal time period to take advantage of RMM. By providing liquidity, the exposure to the underlying asset will be maintained assuming the strike price is high enough, and higher volatility will warrant higher fees (if the liquidity is there).\n\nIn comparison to a CFMM like Uniswap, any price change in the underlying asset which does not revert to the initial entry price will miss out on potential gains (opportunity cost) from the asset, while RMM pools will only miss gains on the asset if the pool expires \"in the money\"; when the market price of the asset is above the strike price of the pool.\n\nOn the other hand, this opportunity cost in Uniswap would be in the LPs benefit in the scenario the underlying price fell off a cliff. In that scenario, the RMM LPs will be left holding 100% the underlying asset, which could potentially go to zero.\n\nThis directionality is not available in any AMM curves because those curves are not aware of time or strike prices.\n\n### Hedge Options with RMM\n\nHedging options is called a dynamic hedge because it is a position which counters another position's *greek* exposures. Greeks are planned to be explained in a future option primer, but for now they can be thought of as symbols to represent the change in the option's value depending on price, volatility, or time. For example, if an option changes value because of time (theta), the dynamic hedge will also change by the same magnitude from the same change in time.\n\nAn option's value is derived in part from the underlying asset's price. The greek symbol `delta` is used as a quantitative metric for how much value the option's value changes when the underlying asset's price changes. Going further, the greek symbol `gamma` is the metric for how much the `delta` changes when the underlying asset price changes. Gamma exists for options because if the underlying asset price gets closer or further away from the strike price, there is more/less probability the asset price will be above the strike. If the option is not above the strike by its maturity date, then it's worthless. Therefore, `delta` is sometimes used as a proxy for the *probability of being in the money*. Gamma is one of the primary reasons options are such a popular instrument, because purchasing gamma (buying the call option) is cheaper (but has the same returns) as purchasing delta (buying the asset).\n\nCall options have a positive gamma, which means a hedge cannot only be in the underlying asset (which has no gamma), it must be a negative gamma position. Uniswap liquidity tokens have negative gamma, but it's not a straightforward hedge for a call option because it does not match its gamma.\n\nRMM liquidity tokens replicate a covered call payoff, which means its close to a perfect hedge (almost) for calls. Along with that, it's negative gamma so it can be used to hedge other gamma positive positions.\n\nWhy hedge a call option with a short call option? A rough example of an opportunity is if call options on another protocol are underpriced, they can be purchased and then hedged with an RMM liquidity position, capturing the difference in premiums.\n\n## RMM Risks\n\nWhile these are the expected results of providing liquidity to RMM, its entirely possible that no fees are generated at all. However, in that case it would mean the pool's liquidity is not rebalanced. This might end up in the LP's favor anyway. For example, if no trading occurred in the pool Alice deposited to, and thus no fees were generated, the initial deposit would be the same. At that point, she'd be withdrawing some YFI along with the $, rather than only $.\n\nA no trading fees scenario occur for several reasons:\n\n* Realized volatility is lower than the curve's implied volatility, increasing the arbitrage profit window and reducing the amount of trading fees generated.\n* Liquidity in Alice's pool is too small for many trades to happen.\n* Liquidity in Alice's pool does not create enough profitable opportunities for arbitrageurs to trade the pool.\n* The pool is not known well/integrated into a dex aggregator/known by arbitrageurs/searchers.\n\n## Oracle Risks\n\nNone.\n\n## Smart Contract Risks\n\n### Have the smart contracts for RMM been audited?\n\nYes. RMM protocol contracts have been audited by five security firms, **making it one of the most audited set of smart contracts in DeFi** (if not the most):\n\n* Trail of Bits - 8 weeks\n* ChainSecurity - 8 weeks\n* ABDK - 4 weeks\n* Dedaub - 4 weeks\n* Sherlock - continuous\n\nWhile these audits give high confidence in the protocol's security, the smart contracts still have the possibility of containing bugs. Along with the audits, Primitive has a **$1,000,000** bug bounty on [Immunefi](https://immunefi.com/bounty/primitive/), and **$10,000,000** of coverage by [Sherlock](https://sherlock.xyz).\n\n## Conclusion\n\nPrimitive RMM is a highly composable primitive for DeFi that will bring more liquidity to on-chain options. Liquidity tokens can be used as a collateral asset in lending and derivative protocols, increasing the capital efficiency and usage of the underlying tokens.\n\nRMM protocol fixes the poor liquidity environment for on-chain options and it's going live in a couple of weeks. You in?\n\n### Resources\n\nVisit the website here: [primitive.finance](https://primitive.finance)\n\nFollow Primitive on [twitter](https://twitter.com/primitivefi).\n\nFrequently answered questions: [FAQ](https://docs.primitive.finance/faq).\n\nCommunity Discord: [Discord](https://discord.gg/primitive).","timestamp":1644339507,"title":"RMM Primer - A friendly guide for Primitive and AMMs"},"digest":"Audtl29HY_rnhN4E2LwnP7-zjDcDGAyXZ4h3QpDeajg","authorship":{"contributor":"0x801D5e44960C5934181B04290Ec7F6A27d96cFF1","signingKey":"{\"crv\":\"P-256\",\"ext\":true,\"key_ops\":[\"verify\"],\"kty\":\"EC\",\"x\":\"xw2D8vhNi3e5scJmFTOX8rOaKjGwAjLHGxBzh4ZYGBY\",\"y\":\"BRp6gLMde1E6LekTRPvfpAhEyXO4ickSPDj04daxPsI\"}","signature":"2zaXL9XEgaGHdu_to2P49ElQ8Sp20NTAwj5LAQ9aZYL2yH7ynyBq-lGmeY54WZPBanIHP6vdaqjwZrq88zJPHQ","signingKeySignature":"0xf9bf5d25965d011005f8c66f3b2db1d7d2299449bb59d2c21d7c222e2d5809752a636c6f1c87407c475745fb003f0ef7cb31114b730402e239503714ec4c70ba1b","signingKeyMessage":"I authorize publishing on mirror.xyz from this device using:\n{\"crv\":\"P-256\",\"ext\":true,\"key_ops\":[\"verify\"],\"kty\":\"EC\",\"x\":\"xw2D8vhNi3e5scJmFTOX8rOaKjGwAjLHGxBzh4ZYGBY\",\"y\":\"BRp6gLMde1E6LekTRPvfpAhEyXO4ickSPDj04daxPsI\"}","algorithm":{"name":"ECDSA","hash":"SHA-256"}},"nft":{},"version":"12-21-2020","originalDigest":"Audtl29HY_rnhN4E2LwnP7-zjDcDGAyXZ4h3QpDeajg"}