Original article: "Working on the incentive layer, learn how Merkl builds a new incentive paradigm on Uniswap V3"
Author: Jaleel
To incentivize liquidity in centralized liquidity AMMs, Angle launched Merkl, a new mechanism platform for incentivizing Uniswap V3 type liquidity funds. Any DAO or individual can customize the type and method of incentivizing Uniswap V3 in Merkl, including setting their own allocation parameters to encourage stricter ranges, etc. With these new features, can Merkl become the most effective and flexible way to incentivize Uniswap V3 mining pools?
Angle & Merkl
Angle is a decentralized, capital-efficient, and over-collateralized stablecoin protocol launched in November 2021. On September 28, 2021, it completed a $5 million seed round of financing led by a16z, with participation from Fabric VC, Wintermute, Divergence Ventures, etc. Angle can be used to issue stablecoins called agTokens, which are designed to reflect the value of the assets they are pegged to. The protocol consists of several different modules or sets of smart contracts from which stablecoins can be issued or minted.
Angle, while launching its first stablecoin agEUR with a single minting module (core module), also introduced a lending module that allows borrowing Angle stablecoins as collateral. The protocol also participates in a direct deposit module, also known as algorithmic market operations (AMO), allowing it to enhance the liquidity of agTokens in other protocols.
While the Merkl mechanism is built and maintained by Angle Labs, it is separate from the Angle protocol.
What is Merkl
Essentially, Merkl is a mechanism platform that incentivizes Uniswap V3 type liquidity funding, where liquidity providers (LPs) on Uniswap V3 and other types of AMMs with centralized liquidity can receive compensation from incentivizors who incentivize liquidity in one or more pools.
Incentivizers enjoy a great deal of flexibility in how to distribute rewards: they can choose to reward LPs more for providing more liquidity in a single token, or better reward LPs that set tight ranges and earn more trading fees from their positions. They can also choose whether to incentivize liquidity outside of a range, or whether to give holders of certain tokens enhanced rewards.
Using Merkl does not require any capital risk, nor does it require LPs to perform any specific smart contract interactions: they can retain liquidity while still receiving rewards. They can also customize their positions to maximize their gains from fees and incentives, enjoying all the possibilities provided by AMMs centralized liquidity types.
Merkl is compatible with liquidity position managers like Gamma or Arrakis. This means that one can provide liquidity on a pool via Gamma and receive rewards without performing any further actions (no need to stake Gamma or Arrakis tokens). Therefore, incentivizing a pool with Merkl is exactly the same as incentivizing Arrakis or Gamma tokens via the staking contract, with no other liquidity providers on the pool.
Merkl charges a low maintenance fee for incentives. Aside from the gas consumed when claiming rewards, there is no cost to liquidity providers to use the platform.
How does Merkl run new paradigm incentives?
Merkl is based on an off-chain script that looks at the data of incentivized pools on a given chain and calculates rewards for stakeholders of all these pools. Based on this, the script aggregates all reward distribution data into a Merkle tree, which is then compressed into a Merkle root and pushed on-chain to allow LPs to obtain their rewards. The script runs periodically each time, and each time for a fixed period of time. This means that each time the script is run, it only looks at the on-chain data related to this specific period of time.
Customizable allocation formula
Strictly speaking, for a pool with two tokens (A and B), the script looks at the swaps that occurred in the pool during the run and calculates a reward score based on the fees earned during the holding period (representing the liquidity used by the pool), the shares of TOKEN A and TOKEN B held during the swap in the pool. Incentivizers can assign different weights to each parameter, and can further customize the pool's reward distribution by allowing addresses holding specific tokens (such as veANGLE or veCRV) to receive higher rewards. The exact distribution formula for positions in this pool during a specific time period is as follows:
Era Length & Dispute Period
The time period (also called epoch) that the script runs in depends on the chain and is the actual time between two reward distributions. The epoch length is basically between 2 hours and 3 days. For example, if the epoch length of Ethereum is 1 day, then Uniswap V3 LPs can get up to 100 new rewards per day on Merkl.
Since Merkl is based on scripts that aggregate all pools across all supported AMMs on the same chain, liquidity providers with liquidity for different pools can receive all rewards at once at the end of each epoch. In addition, since the system relies on a single Merkle root to handle distributions for each chain, liquidity providers can take all token rewards (from different pools on potentially many centralized liquidity AMMs) in a single transaction.
In order to allow anyone to participate in the system without approval, and to reduce the risk of the system facing potential hacks or failures, each new Merkle root update is followed by a dispute period, allowing anyone to challenge the results. The new Merkle root of the aggregated chain's reward distribution data is only valid after this dispute period. Disputes can be triggered by sending a predefined amount of dispute tokens (most likely agEUR) to the reward distribution contract.
During a dispute, the Merkle root of the reward distribution contract is frozen to its last valid version. The dispute can be considered valid, in which case the person who filed the dispute will receive a refund and the disputed Merkle root will be revoked, or invalid. In the last case, the person who filed the dispute loses their funds and the dispute period will restart from scratch (which means that the disputed tree is still not considered valid). The disputed token, amount, and length can be obtained by directly querying the contract that handles the constant rewards.
Fee Structure
Merkl is free for liquidity providers to claim rewards, and a 3% maintenance fee will be charged when the incentivizer sends the reward amount. This fee can be waived for pools that contain certain approved tokens. For example, rewards sent to a reward pool that contains agEUR or other Angle protocol stablecoins are not charged any fees.
How do liquidity providers use Merkl to claim incentives?
As a liquidity provider, Merkl allows users to customize their own funding positions by setting allocation formulas based on the incentivizer’s pool to optimize returns on AMMs such as Uniswap V3.
To earn rewards for listing on Merkl, you can provide liquidity directly on an AMM (such as UniswapV3) or on a supported liquidity manager. The main choices you need to make when adding liquidity are: how wide the funding range is, and the split between the two tokens.
Once you have provided liquidity, no additional steps are required to start receiving rewards, you will be able to claim them directly from the Merkl page or any other application that has Merkl integrated. In particular, you do not need to hold your tokens anywhere else.
How do projects use Merkl to distribute incentives?
Any DAO or individual who wishes to incentivize a pool can use Merkl and customize its allocation to get the desired type of liquidity. Once you enter the official website, you only need to fill in the address of the pool you want to incentivize, the address of the reward token, and the amount of rewards to be sent within the selected distribution period.
Reward tokens need to be whitelisted before they can be used, and for whitelisted tokens, a minimum amount needs to be sent in order for the allocation to be considered valid. If the reward token you want to use is not yet whitelisted, you can leave a message in the Merkl channel on the Angle Discord server.
Next, customize any distribution formula parameters that can be customized. Once completed, the application will prompt you to sign a disclaimer message and then publish a transaction that sends tokens to the distribution contract. Addresses holding funds can claim rewards at the end of each epoch based on how they provide liquidity in the pool.
Blockbeats reminds you: Because there may be significant delays in on-chain Merkle root updates, and there may be defects in the scripts or infrastructure used to update on-chain results, please decide whether to use Merkle at your own discretion.
