Understanding Merkl in one article: How to build a new incentive paradigm on Uniswap V3?

Original text: “Working on the incentive layer and understanding how Merkl builds a new incentive paradigm on Uniswap V3”

Author: Jaleel

In order to incentivize liquidity in centralized liquidity AMMs, Angle launched Merkl, a new mechanism platform to incentivize 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 scopes and more. With these new features, could Merkl be the most efficient 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, Fabric VC, Wintermute, Divergence Ventures and others participated in the investment. Angle can be used to issue stablecoins called agTokens, 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.

While Angle launched its first stablecoin, agEUR, with a single minting module (the core module), it also introduced a lending module that allows borrowing of Angle’s 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 among other protocols.

Although the Merkl mechanism is built and maintained by Angle Labs, it is separate from the Angle protocol.

What is Merkl?

In essence, Merkl is a mechanism platform to incentivize Uniswap V3 type liquidity funds. Liquidity providers (LPs) and other types of AMMs with centralized liquidity on Uniswap V3 can incentivize liquidity from one or more pools Sexual people (incentivizors) receive compensation.

Motivators enjoy great flexibility in how to allocate rewards: they can choose to reward more LPs who provide more single-token liquidity, or they can also better reward those who set a tight range and start from their positions. LPs who get more transaction fees. They can also choose whether they want to incentivize out-of-bounds liquidity, or whether they want holders of certain tokens to receive enhanced rewards.

Using Merkl requires no capital risk, nor does it require LPs to perform any specific smart contract interactions: they can retain liquidity while still earning rewards. They can also customize their positions to maximize returns from fees and incentives, enjoying all the possibilities offered by the centralized liquidity types of AMMs.

Merkl is compatible with liquidity position managers such as Gamma or Arrakis. This means that liquidity can be provided on the pool via Gamma and rewarded without any further action (no need to stake Gamma or Arrakis tokens). Therefore, using Merkl to incentivize a pool is exactly the same as incentivizing Arrakis or Gamma tokens through a staking contract when there are no other liquidity providers on the pool.

Merkl charges low maintenance fees for incentives. There is no cost for liquidity providers to use the platform other than the gas consumed when claiming rewards.

How does Merkl work with new paradigm incentives?

Merkl is based on an off-chain script that looks at the data of the incentivized pools on a given chain, computing rewards for all those pool’s stakeholders. Based on this, the script aggregates all reward distribution data into a Merkle tree, which is then compressed into a Merkle root and pushed to the chain to allow LPs to claim their rewards. The script runs periodically 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 that specific time period.

Understanding Merkl in one article: How to build a new incentive paradigm on Uniswap V3?

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 the value based on the fees earned during the holding period (representing the liquidity used by the pool), The reward points are calculated for the shares of TOKEN A and TOKEN B held during the swap period in the pool. Motivators can assign different weights to each parameter, and can further customize the reward distribution of the pool by allowing addresses holding specific tokens (such as veANGLE or veCRV) to receive higher rewards. The exact distribution of slots within the pool during a given time period is as follows:

Understanding Merkl in one article: How to build a new incentive paradigm on Uniswap V3?

Epoch Length & Dispute Period

The period of time the script runs (also called epoch) 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 new rewards on Merkl every day.

Since the Merkl-based script aggregates all pools of all supported AMMs on the same chain, Liquidity providers who have liquidity to different pools can receive full rewards at once at the end of each epoch. Additionally, since the system relies on a single Merkle root to handle distribution per chain, liquidity providers can capture all token rewards (from different pools on potentially many centralized liquidity AMMs) in a single transaction.

To allow anyone to participate in the system without approval, and to reduce the system’s exposure to potential hacks or malfunctions, each new Merkle root update is followed by a dispute period that allows anyone to challenge the results. The new Merkle root of the aggregated chain’s reward distribution data is valid only after this dispute period. A dispute can be triggered by sending a predefined amount of dispute token (most likely agEUR) to the reward distribution contract.

During the dispute, the Merkle root of the reward distribution contract was frozen to its last valid version. A dispute can be considered valid, in which case the person who raised the dispute will receive a refund, the dispute’s Merkle root will be revoked, or it will be invalid. In the last case, the person raising the dispute loses their funds, and the dispute period restarts from scratch (meaning that the disputed tree is still not considered valid). The dispute Token, quantity and length can be obtained by directly querying the contract that handles constant rewards.

fee structure

Merkl is free for liquidity providers to claim rewards, and a 3% maintenance fee will be charged when the motivator sends the incentive amount. This fee may be waived for pools containing certain specific approved tokens. For example, there is no fee for rewards sent to reward pools that contain agEUR or other Angle Protocol stablecoins.

How do liquidity providers use Merkl to receive incentives?

As a liquidity provider, Merkl allows users to define their own capital positions by setting allocation formulas based on the incentive pool to optimize returns on AMMs such as Uniswap V3.

To earn rewards for listing on Merkl, provide liquidity directly on an AMM (such as UniswapV3) or on a supported liquidity manager. The main choices that need to be made when adding liquidity are: the width of the funding range, and the split between the two tokens.

Once liquidity is provided, no additional steps are required to start receiving rewards, they will be claimed directly from the Merkl page or any other Merkl-integrated application. In particular, you do not need to deposit your tokens anywhere else.

Understanding Merkl in one article: How to build a new incentive paradigm on Uniswap V3?

How does the project party use Merkl to distribute incentives?

Any DAO or individual looking to incentivize a pool can use Merkl and customize its allocation to get the type of liquidity they want. After entering the official website, you only need to fill in the address of the mining pool to be incentivized, the address of the reward token, and the reward amount to be sent within the selected distribution period.

Reward tokens need to be whitelisted before they can be spent, and for whitelisted tokens a minimum amount needs to be sent for the distribution to be considered valid. If the reward token you want to use has not been whitelisted, you can leave a message to the official on the Merkl channel of the Angle Discord server.

Then customize any allocation formula parameters that can be customized. Once done, the app will prompt you to sign a disclaimer message, 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.

Understanding Merkl in one article: How to build a new incentive paradigm on Uniswap V3?

Blockbeats Reminder: Use Merkle at your own discretion as on-chain Merkle root updates may have significant delays, and scripts or infrastructure used to update on-chain results may be flawed.

Related Posts