Weighted Pools

Overview

Weighted Pools are highly versatile and configurable pools. Weighted Pools use Weighted Math, which makes them great for general cases, including tokens that don't necessarily have any price correlation (ex. WAVAX/USDC). Unlike pools in other DeFi protocols that only provide 50/50 weightings, Hexagon Weighted Pools enable users to build pools with different token counts and weightings, such as pools with 80/20 or 60/20/20 weightings.

Please note that the weightings here are in the term of value, not the amount of the tokens. An 80/20 WAVAX/USDC pool means that WAVAX accounts for 80% of the pool value and the other 20% is made of USDC.

Invariant

The weighted Math equation is a generalization of the x∗y=k constant product formula. It accounts for cases with no less than 2 tokens in a pool, as well as weightings that are not an even split.

Please note that the weights are those of the equivalent value of the tokens in the weighted pools, not the number of tokens.

The weighted pool’s AMM is defined by a function of the pool’s balances and weights, constraining V to a constant (‘Invariant V’).‌

Where

If you take a closer look at Uniswap’s model, it is actually a special case of the equation above, when t=2 and W1=W2=50%; which can be translated to

Based on this value function, Hexagon Finance allows users to create pools with up to eight assets, user-defined weights, and customizable swap fees.

Several examples:

An Example of how weights may affect the pool contributions

Assuming AVAX price is 100 USDC, we may create two pools, containing 20,000 USD (1USDC=1USD) liquidity respectively, but with different weights.

Token Price

Though a weighted pool may have multiple tokens in its composition, swaps in these pools occur between only two token assets, which means one is trading one cryptoasset for another in the pool, like a trading pair.

Unlike the pricing mechanism in Uniswap, the weighted pool considers the token weights when defining the spot price of a swap.

  • b1 is the balance of token 1, the token being sold by the trader which is going into the pool;

  • b2 is the balance of token 2, the token being bought by the trader which is going out of the pool; ​

  • W1 is the weight of token 1 and W2 is the weight of token 2.

No matter what exchanges are carried out, the share of the value of each token in the pool remains constant.

How trades affect the pool and the price

Due to the weight differences, pools have different slippage when users make the same transactions in pools with varied weights. Let’s follow the example above with the three AVAX/USDC pools. (Supposing there are no transaction costs.)

Note:

  • The pool invariant stays unchanged before and after the trade.

  • ‘No. of AVAX’ is reduced by 1 AVAX due to the purchase of the user.

  • ‘Price of AVAX for the trade’ is the USDC the user pays for this 1 AVAX purchase, translated into the increase of USDC in the pool.

  • ‘Price of AVAX for the trade’ is the price of AVAX determined by the pool compositions after the trade.

From the table above, we may notice that though the three weighted pools have the same initial liquidity, the slippage tend to vary. The 50/50 pool has the smallest slippage. Pools with highly biased weights may lead to higher price slippage.

Advantages

Exposure Control

Weighted Pools allow users to choose their levels of exposure to certain assets while still maintaining the ability to provide liquidity. The higher a token's weight in a pool, the less impermanent loss it will experience in the event of a price surge.

For example, if a user wants to provide liquidity for WAVAX and WETH, they can choose the weight that most aligns with their strategy. A pool more heavily favouring WAVAX implies they expect bigger gains for WAVAX, while a pool more heavily favouring WETH implies bigger gains for WETH. An evenly balanced pool is a good choice for assets that are expected to remain proportional in value in the long run.

For example, an 80/20 WAVAX/USDC pool means that WAVAX accounts for 80% of the pool value. If you are bullish on WAVAX while expecting to earn some extra transaction fees from contributing liquidity while limiting your USDC exposure, contributing liquidity in this pool is a better choice than a 50/50 pool like in the Uniswap model.

Impermanent Loss

Impermanent Loss is the difference in value between holding a set of assets and providing liquidity for those same assets.

For pools that heavily weigh one token over another, there is far less impermanent loss, but with higher slippage when making trades due to the fact that one side has much less liquidity.

Trading Pairs

Since each token in a pool can be traded with any other token in a pool, the number of trading pairs grows significantly with each additional token. By providing more trading pairs, pools are able to facilitate more swaps, giving them more opportunities to collect fees.

Last updated