Overview
Over the last several months, the DAO R&D team and the Foundation Engineering team have worked together to finalise the mechanism design. Currently, the Foundation Engineering team is part way through the implementation work, where they are coding the RAMM in Solidity. During this phase of the new tokenomics project, the R&D team will start the parameter discussions with the wider Nexus Mutual community.
Timeline for parameter discussions
- Pre-Discussion: Education and call for questions
- Timeframe for discussion: 3 weeks | 24 July to 14 August
- Liquidity Parameters: How much ETH should go in the pool and how quickly
- Opening parameters for liquidity, liquidity injection speed and ratchet speed
- Long-term parameters for target liquidity, injection speed and ratchet speed
- Transition from opening to long-term state
- Timeframe for discussion: 4 weeks | 14 August to 12 September
- Oracle Buffer, Internal Price, and Initial Price Parameters
- Timeframe for discussion: 2 weeks | 12 September to 26 September
The Pre-Discussion: Education and call for questions post is included below.
Preparing for New Tokenomics Parameter Discussion: An Educational Guide to Understand the Ratcheting Automated Market Maker (RAMM) System
This guide is designed to provide a simplified overview of the Ratcheting Automated Market Maker (RAMM) design, where we explain:
- How the RAMM works
- What the parameters are and why they play an important role in the RAMMâs launch
Our goal is to further simplify the explanations provided in the draft whitepaper, draft technical specifications, and the regular tokenomics updates ahead of the parameter discussions. We want to ensure all members understand how the system works before the parameter discussions start, so all members can engage in productive discussions and understand the impact and importance of each parameter.
The R&D and Community teams will be available to answer questions throughout this two week period. Please ask questions if thereâs something that is unclear!
How the RAMM Works
The Ratcheting AMM is a two-pool system, which is built on the Uniswap V2 design with added featuresânamely, the ratchet, which, in the absence of members selling NXM or buying NXM, will move the price toward the Book Value, i.e., the value of assets in the capital pool per NXM.
The Below Pool and Above Pool are the two pools present in the system. These pools would contain a defined amount of ETH liquidityâwhich will be determined in the first parameter discussionâpaired with âvirtualâ NXM. This creates two internal pools, which have one-sided ETH liquidity; the NXM reserves in the pool will be represented by a virtual NXM balance that changes over time as NXM is sold and purchased.
The two pools are described below:
- Below Pool. This pool handles swaps below the Book Value. NXM sold in this pool is burned and ETH is distributed from this pool. NXM can be swapped for ETH in this pool only at an NXM spot price less than or equal to the Book Value. NXM can only be sold in this pool; NXM buys occur in the Above Pool.
- Above Pool. This pool handles swaps above the Book Value. ETH is contributed to this pool and, in return, NXM is minted. NXM can be purchased from this pool only at an NXM spot price greater than or equal to the Book Value. NXM can only be purchased in this pool; NXM sells occur in the Below Pool.
Above Pool | Below Pool |
---|---|
1) When NXM is purchased in this pool, the price increases as the ETH liquidity increases and the virtual amount of NXM decreases. | 5) During periods where no NXM is being redeemed for ETH, the ratchet mechanism will move the price back toward the Book Value. |
2) This pool operates within the following price range: [(100+x)% * Book Value,â) |
6) This is the Book Value, which the ratchet mechanism will âratchetâ up to in the absence of NXM redemptions in this pool. |
3) During periods where no NXM is purchased, the ratchet mechanism will move the price back toward the Book Value. | 7) When NXM is redeemed in this pool, the price decreases as the ETH liquidity decreases and the virtual amount of NXM increases. |
4) This is the Book Value, which the ratchet mechanism will âratchetâ down to in the absence of NXM purchases in this pool. | 8) This pool operates within the following price range: (0, (100-x)% * Book Value] |
How Liquidity is Managed within the System
Once the Minimum Capital Requirement (MCR) floor, which is 162,425 ETH, is removed, the MCR will be driven by the Total Cover Amount. When MCR is driven by actual cover sales, the MCR will equal:
f(Cover) = Total Active Cover Amount / 4.8
- As at 2023/06/14, this would result in an MCR value of approximately 7000 ETH
When this change is made, the protocol will have capital in excess of the MCR.
In the first parameter discussion, members will determine:
- How much liquidity will be allocated to the Pools
- How quickly liquidity will be replenished
- Parameter adjustments for the opening phase
To understand why these parameters are important and how they impact the system, letâs review how liquidity is managed in each pool.
Liquidity in the Below and Above Pools
Members will decide the target liquidity for the pools, or the amount of ETH the pool will maintain over time. If the amount of ETH in pools drops below the target liquidity, then liquidity will be injected into the pools over time.
As members redeem NXM for ETH, there will be less ETH held in the pools until more liquidity is injected to reach the target liquidity valueâthis happens automatically, given the system checks if the liquidity in the pools is less than the target liquidity value at each swap. The only scenario where liquidity will not be added to the pool will be when the ETH balance in the Capital Pool is less than or equal to the MCR plus the target liquidity.
Capital Pool < MCR + target_liq
As members purchase NXM with ETH, the amount of ETH liquidity in the pools will increase. If the ETH liquidity is greater than the target liquidity, then ETH will be removed over time and returned to the Capital Poolâthis also happens automatically, given the system checks if the liquidity in the pools is greater than the target liquidity value at each swap.
During periods where members are not redeeming NXM for ETH or contributing ETH in return for NXM, the ratchet mechanism moves the price. Weâll review that in the next section.
How the Ratchet Mechanism Works
The ratchet mechanism allows for price discovery over time by either moving the price toward the Book Value over time in the Below Pool and/or the Above Pool. The selling price will decrease when NXM is redeemed in the Below Pool and the buying price will increase when NXM is purchased in the Above Pool, but the ratchet mechanism moves the prices to the Book Value over time.
In the first parameter discussion, members will determine:
4. How quickly the ratchet will move the NXM spot price toward the Book Value
Ratcheting Up in the Below Pool
During periods when NXM is not being redeemed for ETH, the ratchet will move the spot price by reducing the number of NXM in the virtual pool.
In the example below, you can see a scenario where NXM is redeemed for ETH at Step 1 and Step 6.
The graph on the left shows the spot price dropping in Steps 1 and 6 when NXM is redeemed for ETH and subsequently increasing again as the ratchet moves.
In the graph on the right, you can see the amount of ETH in the pool. As NXM is redeemed for ETH, liquidity is reduced. When the liquidity in the pool is below the target (e.g., in this case, 5000 ETH is the target), more ETH is injected into the pool over time. As the pool reaches the target liquidity, no more ETH is injected into the pool.
Ratcheting Down in the Above Pool
During periods when NXM is not being purchased with ETH, the ratchet will move the spot price by increasing the number of NXM in the virtual pool.
If someone purchases NXM, the price will increase and then, if no other NXM purchases are made, the ratchet will move the spot price back toward the Book Value in the Above Pool.
The graph on the left shows the spot price increasing in Steps 1 , 6 and 17 when NXM is purchased with ETH and subsequently decreasing again as the ratchet moves toward the Book Value.
In the graph on the right, you can see the amount of ETH in the pool. As NXM is purchased with ETH, liquidity increases. When the liquidity in the pool is above the target (e.g., in this case, 5000 ETH is the target), more ETH is removed from the pool over time. As the pool reaches the target liquidity, no more ETH is removed from the pool.
Oracle Buffer
The Oracle Buffer is the percentage value that accounts for oracle lag when calculating Book Value in ETH terms. It also serves to create a spread around Book Value. The Below Pool ratchet will actually be capped by the price ceiling and the Above Pool ratchet will be capped by the price floor.
- Price ceiling. Once the NXM spot price for the Below Pool has reached this value, the ratchet stops moving the price upwards.
Price ceiling = (1 - oracle buffer) * Book Value
- Price floor. Once the Above Pool NXM spot price has reached this value, the ratchet stops moving the price downwards.
Price floor = (1 + oracle buffer) * Book Value
This value is important, since it provides an extra layer of protection against arbitrage opportunities resulting from slight mispricings of the values of the different assets in the capital pool.
As an example, imagine there is a delay in updating an oracle for one of the assets in the pool and the true value of the pool is 1% higher than used in the instantaneous Book Value calculation. An actor who knows this could buy NXM at a cheaper price, wait until the Book Value updates and the ratchet mechanism moves the price up, then sell the NXM for a profit.
In the second parameter discussion, members will determine:
- The parameters for the Oracle Buffer.
How the Internal NXM Price is Determined within the System
Within the Nexus Mutual protocol, NXM is the default currency. Cover capacity, cover fees, staking rewards, claim assessment rewards, and NXM burns (when claims are approved) are all denominated in NXM terms. An unstable NXM price can have significant negative impacts on the protocolâs core functions.
For this reason, the RAMM needs to determine an internal NXM price using a stable, reliable oracle. The proposed solution is to use a Time Weighted Average Price (TWAP), which is based on trades in the Above Pool and Below Pool.
In the second parameter discussion, members will determine:
2. The parameters for the Internal Price and the initial spot prices.
Time Weighted Average Price (TWAP) and Internal Price
The TWAP mechanism would work by calculating the TWAP on trades in each pool, where:
- The TWAP in the Above Pool is represented by
twap_a
- The TWAP in the Below Pool is represented by
twap_b
In order to avoid arbitrage, the TWAP mechanism also needs to have a limit set for both average prices equal to the spot prices:
- Price in Above Pool (
price_a
) =min(twap_a, spot_price_a)
- Price in Below Pool (
price_b
) =min(twap_b, spot_price_b)
The final internal price is determined by moving both the Price in the Above Pool and the Price in the Below Pool toward Book Value at the same speed: one price will reach Book Value and the other price is the one that will be used. This is represented by the following formula:
internal price = price_a + price_b - book_value
TWAP Min and Max Values
To avoid large swings in cover capacity and provide extra protection against manipulation of the internal price, a minimum (min) TWAP and maximum (max) TWAP value will be used within the system. Those TWAP values are subject to discussion, but will likely be expressed as percentages of the Book Value.
If the actual market price sat outside of the TWAP (min, max) range, then the TWAP min/max values would provide a boost/dampener to the available cover capacity respectively, which would work in favour of the mutual in bear/bull market scenarios.
List of Parameters
Parameter | Description |
---|---|
book_value |
Capital Pool in ETH / NXM Supply |
oracle_buffer |
Margin to allow for oracle lag when calculating Book Value in ETH. Secondary function - create spread. |
liq |
ETH liquidity across both pools |
liq_NXM_a |
Notional NXM reserve in the Above Pool |
liq_NXM_b |
Notional NXM reserve in the Below Pool |
target_liq |
Target ETH liquidity across both pools |
liq_speed_out |
Max amount of ETH that is removed from the pools daily |
liq_speed_in |
Max amount of ETH that is added to the pools daily |
spot_price_a |
Current price at which members can exchange ETH for NXM |
spot_price_b |
Current price at which members can exchange NXM for ETH |
ratchet_target |
Value towards which the spot_prices move |
floor_price_a |
Value towards which spot_price_a moves |
ceil_price_b |
Value towards which spot_price_b |
ratchet_speed_a |
Daily decrease in spot_price_a price when above target value |
ratchet_speed_b |
Daily increase in spot_price_b price when below target value |
twap_duration |
Duration over which the TWAPs are calculated |
Parameter Discussions
Discussion #1: Liquidity Parameter Discussion : How much ETH should go in the pool and how quickly
This will be the main body of the parameter discussion. We will mainly focus on the amount of ETH that is available in the pools immediately after launching the mechanism, in the short term and in the long term.
The parameters to be discussed are summarised in the table below.
Parameter | Description |
---|---|
liq |
ETH liquidity across both pools |
target_liq |
Target ETH liquidity across both pools |
liq_speed_out |
Max amount of ETH that is removed from the pools daily |
liq_speed_in |
Max amount of ETH that is added to the pools daily |
ratchet_speed_a |
Daily decrease in spot_price_a price when above target value |
ratchet_speed_b |
Daily increase in spot_price_b price when below target value |
While the parameters fulfil separate functions, they are interlinked in many ways and setting one at a specific level to achieve one outcome often has knock-on effects on other parameters in order to preserve parity elsewhere.
There are often ways in which to achieve similar outcomes with different parameter adjustments.
We may also want separate short-term and long-term parameters, with triggers for transitioning from one set to the other.
Some of the behaviours of the mechanism affected by the parameters in this section:
Total ETH available for member exits over time
Chiefly impacted by the liq_speed_in
and the opening liq
value. The combination of those two parameters sets a limit on how much ETH can exit the protocol and how quickly.
Slippage
How much the price changes upon each buy and sell. Depends on the liq
in the pool, which is influenced by target_liq
and liq_speed
parameters.
Price outcomes
Price outcomes will depend chiefly on open market behaviour, but the RAMM pool parameters can provide a greater or lesser influence on the market.
The larger the liq
in the pool, the stronger the ratchet pull towards the Book Value will be, as arbitrage trades will move the RAMM price less and the open market prices more.
Ratchet_speed
parameters by themselves are unlikely to significantly impact the final price outcome (assuming arbitrageurs are always active), but will enable faster price discovery within the RAMM if set to high values, but also lead to a more volatile spot price within the RAMM.
Oracle Buffer, Internal Price, and Initial Prices
The second stage of the parameter discussion will focus more on technical parameters, which should not have a significant long-term impact on the goals the system can achieve.
The oracle buffer will be the main point of discussion, as it will also act as a buy/sell spread in certain scenarios.
Parameter | Description |
---|---|
oracle_buffer |
Margin to allow for oracle lag when calculating Book Value in ETH. Secondary function - create spread. |
spot_price_a |
Current price at which members can exchange ETH for NXM |
spot_price_b |
Current price at which members can exchange NXM for ETH |
twap_duration |
Duration over which the TWAPs are calculated |
Questions and Comments
For the next three weeksâstarting on 24 July 2023 and ending on 14 August 2023âwe will be in the Pre-Discussion phase, where we are focused on educating all members ahead of the parameter discussions. Our goal is to answer any questions now and make sure all members are on the same page ahead of the discussions, so everyone understands the importance of each parameter and how each one impacts the system.
During this phase, @Rei and @BraveNewDeFi will make themselves available during Office Hours, which will be held in the Community Calls channel on the Nexus Mutual Discord from 3:00pm UTC until 3:30pm UTC every Tuesday and Thursday.
In the meantime, if you have any questions, please share them below and weâll provide an answer as soon as we are able to.