Liquidity Gauges and RBN Emissions

Ribbon incentivizes vault depositors with RBN, the protocol governance token. Allocation, distribution and emission of RBN are managed via several related DAO contracts:

  • LiquidityGauge: Measures vault tokens (i.e. rETH-THETA) provided by users over time, in order to distribute RBN and other rewards

  • GaugeController: Central controller that maintains a list of gauges, weights and type weights, and coordinates the rate of RBN production for each gauge

  • Minter: RBN emission contract, sends non-circulating RBN into circulation via liquidity gauges

Implementation Details

RBN Emissions

RBN follows a constant inflation schedule of 250,000 RBN per week rewarded to vault depositors over the course of 6 months. This is ~6.5 M RBN overall, or 0.65% of total supply. This is subject to changes before the 6 months have elapsed. We will officially revisit this inflation schedule after the 6 months.

Liquidity Gauges

Emissions are directed to users who deposit into the protocol option selling vaults. This usage is measured via β€œLiquidity Gauge” contracts. Each pool has an individual liquidity gauge. The Gauge Controller maintains a list of gauges and their types, with the weights of each gauge and type.

To measure liquidity over time, the user deposits their vault tokens into the liquidity gauge. Coin rates which the gauge is getting depends on current emission rate, gauge weight, and gauge type weights. Each user receives a share of newly emitted RBN proportional to the amount of vault tokens locked. Additionally, rewards may be boosted by up to factor of 2.5 if the user vote-locks tokens for Ribbon governance in the Voting Escrow contract.

Suppose we have the constant emission rate π‘Ÿπ‘Ÿ, gauge weight 𝑀g𝑀g and gauge type weight 𝑀𝑑𝑀𝑑. Then, all the gauge handles the stream of inflation with the rate π‘Ÿβ€²=π‘€π‘”βˆ—π‘€π‘‘βˆ—π‘Ÿπ‘Ÿβ€²=𝑀𝑔*𝑀𝑑*π‘Ÿ which it can update every time 𝑀𝑔,𝑀𝑑𝑀𝑔,𝑀𝑑, or mining epoch changes.

To calculate a user’s share of π‘Ÿβ€²π‘Ÿβ€², we must calculate the integral: where 𝑏𝑒(𝑑)𝑏𝑒(𝑑) is the balance supplied by the user (measured in vault tokens) and 𝑆(𝑑)𝑆(𝑑) is total deposits supplied by users, depending on the time 𝑑𝑑; the value 𝐼𝑒𝐼𝑒 gives the amount of tokens which the user has to have emitted to them. The user’s balance 𝑏𝑒𝑏𝑒 changes every time the user makes a deposit or withdrawal, and 𝑆𝑆 changes every time _any_ user makes a deposit or withdrawal (so can change many times in between two events for the user 𝑒"𝑒". In the liquidity gauge contract, the value of 𝐼𝑒𝐼𝑒 is recorded per-user in the public integrate_fraction mapping.

To avoid requiring that all users to checkpoint periodically, we keep recording values of the following integral (integrated over 0 -> t) (named integrate_inv_supply in the contract):

The value of 𝐼𝑖𝑠𝐼𝑖𝑠 is recorded at any point any user deposits or withdraws, as well as every time the rate π‘Ÿβ€²π‘Ÿβ€² changes (either due to weight change or change of mining epoch).

Boosting

In order to incentivize users to participate in governance, and additionally create stickiness for liquidity, we implement the following mechanism. A user’s balance, counted in the liquidity gauge, gets boosted by users locking RBN tokens in Voting Escrow contract, depending on their vote weight 𝑀𝑖wi𝑀𝑖wi: π‘π‘’βˆ—=min(0.4𝑏𝑒+0.6π‘†βˆ—π‘€π‘–/π‘Š,𝑏𝑒)𝑏𝑒*=min(0.4𝑏𝑒+0.6𝑆*𝑀𝑖/π‘Š,𝑏𝑒) The value of 𝑀𝑖𝑀𝑖 is taken at the time the user performs any action (deposit, withdrawal, withdrawal of emitted RBN tokens) and is applied until the next action this user performs.

If no users vote-lock any RBN (or simply don’t have any), the inflation will simply be distributed proportionally to the liquidity 𝑏𝑒𝑏𝑒 each one of them provided. However, if a user stakes enough RBN, they are able to boost their stream of RBN by up to factor of 2.5 (reducing it slightly for all users who are not doing that).

Implementation details are such that a user gets the boost at the time of the last action or checkpoint. Since the voting power decreases with time, it is favorable for users to apply a boost and do no further actions until they vote-lock more tokens. However, once the vote-lock expires, everyone can β€œkick” the user by creating a checkpoint for that user and, essentially, resetting the user to no boost if they have no voting power at that point already.

RBN lockers can delegate their boost to other addresses and in return earn yield through bribes.

Gauge Weight Voting

Users can allocate their veRBN towards one or more liquidity gauges. Gauges receive a fraction of newly minted RBN tokens proportional to how much veRBN the gauge is allocated. Each user with a veRBN balance can change their preference at any time.

When a user applies a new weight vote, it gets applied at the start of the next epoch week. The weight vote for any one gauge cannot be changed more often than once in 10 days.

RBN lockers can vote for particular gauges and in return earn yield through bribes.

The Gauge Controller

The β€œGauge Controller” maintains a list of gauges and their types, with the weights of each gauge and type. In order to implement weight voting, GaugeController has to include parameters handling linear character of voting power each user has.

GaugeController records points (bias + slope) per gauge in vote_points, and _scheduled_ changes in biases and slopes for those points in vote_bias_changes and vote_slope_changes. New changes are applied at the start of each epoch week.

Per-user, per-gauge slopes are stored in vote_user_slopes, along with the power the user has used and the time their vote-lock ends.

The totals for slopes and biases for vote weight per gauge, and sums of those per type, are scheduled / recorded for the next week, as well as the points when voting power gets to 0 at lock expiration for some of users.

When a user changes their gauge weight vote, the change is scheduled for the next epoch week, not immediately. This reduces the number of reads from storage which must to be performed by each user: it is proportional to the number of weeks since the last change rather than the number of interactions from other users.

Gauge Types

Each liquidity gauge is assigned a type within the gauge controller. Grouping gauges by type allows the DAO to adjust the emissions according to type, making it possible to e.g. end all emissions for a single type.

Currently active gauge types are as follows:

  • Vault (all Ethereum vaults): 0

LiquidityGauge

Each pool has a unique liquidity gauge. Deployment addresses can be found in the addresses reference section of the documentation.

There are several versions of liquidity gauge contracts in use. Source code for these contracts is available on Github.

For more details, please visit curve docs.

Last updated