Rate Providers
Rate providers are contracts that provide an exchange rate between two assets. For example, the rate of stETH to wstETH. If a pool is created with tokens that use unreviewed rate providers, it will not show on balancer.fi
Tips
When is a rate provider needed?
The primary use-case of a rate provider is the deployment of liquidity in a composable stable pool consisting of correlated or non-correlated assets containing a yield-bearing asset. If 50% or more of the tokens are yield-bearing, the pool is eligible to be flagged as a core pool to receive a share of fees as voting incentives
What are the requirements for a rate provider contract?
- Must implement the
IRateProvider
interface, which simply requires agetRate()
function that returns an 18 decimal fixed point number that is the exchange rate of the token to some other underlying token. - If the rate provider or any underlying portion of the rate can be upgraded, changed, manipulated in any way it will not be owned by or executed by an EOA. It must be a multisig with a minimum set up of 3/5 signers.
- Timelock is encouraged but not required.
- Should not be susceptible to donation attacks.
- Should be monotonic (up only) in nature.
What are the steps needed to set up a rate provider with Balancer?
- Build a rate provider based on the above mentioned requirements and consult the Balancer RP registry
- Make an issue against the RP Registry to start the code review process
- Wait for the review to finish (takes approx. 1-2 weeks depending on the backlog)
- Implement any needed changes that are required to pass the review
- Upon merge the rate provider is vetted and a composable stable pool can be set up with the newly implemented rate provider set.