Developers
Search…
Managed Pools

Overview

For advantages and use cases of Managed Pools, please refer to the standard documentation.
For more interfaces, such as updating pool weights, see the Managed Pools API.

Interfacing

Some elements to consider when interfacing with Managed Pools:
  • Using Weighted Math
  • Pool weights can be dynamic
  • Pool swaps may be disabled by the pool owner. Typically this is to prevent swaps before the weight shifting occurs, but this can technically happen at any time.
  • Pool weights range from 1% to 99%
  • Pools can have up to 50 tokens

Getting Pool Data

In addition to the common pool data, you will likely want the following data when interfacing with Liquidity Bootstrapping Pools:

Weights

Instantaneous Query

Weights are stored at the pool level. For example, calling
1
pool.getNormalizedWeights()
Copied!
returns something resembling
1
[800000000000000000, 200000000000000000]
Copied!
which are the weights represented with 18 decimals. A pool with 80%/20% weights corresponds to [0.8, 0.2] after scaling for decimals. It is important to note that this method will only query instantaneous weights. If you are querying a pool that is actively changing weights, the pool weights can differ between off-chain query and weights at time of execution.

Calculate Weights at a Specific Time

By combining the above instantaneous weight query with the weight-shifting parameters, we can calculate weights at a point in the future. Calling
1
pool.getGradualWeightUpdateParams()
Copied!
returns something resembling
1
startTime : 1631523600
2
endTime : 1638781200
3
endWeights : [180010681315327688, 820004577706569009]
Copied!
With these datapoints, you can calculate the weights at a given point in time by interpolating between the current weights and the final weights.

Are Swaps Enabled?

Pool owners may choose to enable/disable swaps based on what they're doing with their pool. Oftentimes, pool owners will have swaps paused before a weight-shifting event and enable them as the weight-shifting begins. Technically, however, pool owners can pause swaps whenever they like; therefore, it's important to check it swaps are enabled when dealing with these pools. Simply calling
1
pool.getSwapEnabled()
Copied!
returns True or False.