unshETH Research: Towards a General Approach for Creating Multiplier Curves (Pt. 1)

February 25th, 2023

Incentivization is a critical part of any successful DeFi protocol. Without proper incentivization, it can be difficult to attract and retain participants, which can hinder the growth and sustainability of the network. Custom incentivization curves are a powerful tool for driving participation and promoting decentralization in these protocols.

In this article, we'll explore how to create custom incentivization curves for protocols using the vdMining curve from UnshETH as an example. We'll start by defining what custom incentivization curves are and how they differ from linear models. Then, we'll break down the steps involved in deriving the vdMining curve, including how the Euclidean distance is calculated and how the curve is defined using a differential equation.

Custom incentivization curves are a powerful tool for promoting a specific behavior. Unlike linear incentivization models, which typically provide a user-specific reward based on liquidity deposited and time locked, custom incentivization curves can be designed to reward participants in a way that encourages specific behaviors that benefit the network as a whole. In this section, we'll define what custom incentivization curves are and how they differ from linear models.

One way to think about custom incentivization curves is as a way to align the interests of network participants with the interests of the network as a whole. By incentivizing certain behaviors, such as holding a certain ratio of assets or participating in specific governance processes, custom curves can help to promote decentralization and drive participation in the network. Custom curves can also be designed to take into account different variables, such as network growth or changes in the price of different assets, which can help to ensure that the incentives remain aligned with the overall goals of the network.

Creating custom incentivization curves for protocols is a powerful way to promote participation and decentralization. In this section, we'll explore how to derive the coordinationMultiplier formula for UnshETH's vdMining protocol.

The problem we want to solve is how to incentivize users to stake their LSDs in a manner that aligns with the **optimal decentralization** **ratio** set by the UnshETH community. To achieve this, we need a function that rewards users for staking their LSDs in a ratio that is close to the optimal ratio. For this purpose, we use the Euclidean distance, which is defined as:

where **a** and **b** are the current ratio of staked LSDs and the optimal decentralization ratio, respectively. Next, we define the function **f(d)**, which maps the distance between the current ratio and the optimal decentralization ratio to the **coordinationMultiplier.** We choose a function that decreases rapidly as the distance increases, but is asymptotic to some maximum value. One such function is:

Here, **a**, **b**, and **m** are constants that control the shape of the curve. We chose a visually-optimized set of values (s/o desmos.com) for these constants, after discussing the domain and range of the curve and how the bounds should be determined based on the minimum and maximum values of the multiplier –– we set this to [1,3] for unshETH vdMining.

After deriving and testing the `coordinationMultiplier`

function, the next step was to implement it in Solidity. Since the function uses exponential calculations, special care needed to be taken with regards to gas costs and floating-point math.

To reduce gas costs and avoid floating-point math, we first decided to modify the function to use fixed-point arithmetic. We converted all floating-point numbers to fixed-point numbers with 18 decimal places, and used integer math operations to perform the calculations. We then tested the modified function extensively to ensure that it produced the same results as the original function.

Next, we integrated the modified function into our smart contract. We used Paul Berg’s `PRBMath`

library to handle the fixed-point arithmetic, and carefully designed the contract to minimize gas costs where we could.

Here is the algorithm we implemented and tested in a sandbox environment:

1. Calculate the Euclidean distance between the current ratio and the optimal decentralization ratio:

2. Scale the Euclidean distance by a constant b, and call the result **L** hat:

3. Calculate the Hell function:

4. Calculate the Hella function:

5. Calculate the final coordination multiplier by adding 1:

This is the version of the multiplier formula that is currently running on mainnet on unshETH v1:

Unfortunately, our devs have yet to discover a more elegant substitution. If you think of one, our DMs are open.

In our upcoming article, we will explore the process of bounding and testing the coordination multiplier used in the vdMining protocol. We discuss the numerical methods employed in ensuring that the multiplier function satisfies the required conditions, such as the boundary and asymptotic behaviors. We also delve into the simulation techniques used to test the function for correctness and performance, including using Dirichlet distributions for simulations and benchmarking methods for rounding error of different methods. Stay tuned for a deep dive into the rigorous process of designing and testing the vdMining coordination multiplier!

Our goal of documenting our R&D process in public is to enable other protocols to incorporate these findings within their own incentive engineering efforts. The first part of this series will conclude with the unshETH team presenting a generalized approach for creating multiplier curves for voting, staking rewards, or other functions within DeFi.

Subscribe to unshETH

Receive the latest updates directly to your inbox.

Mint this entry as an NFT to add it to your collection.

Verification

This entry has been permanently stored onchain and signed by its creator.

Arweave Transaction

KUSz4IlynTrv_ha…8GEbYXI_oGDvT-E

Author Address

0x749Dc728A68265e…cc2649BD42a8f8a

Content Digest

1X2efAG-k1mQ8YC…8wqfekAhbPjMDOg