Polaris Finance DEX
  • 📃About Polaris Finance
  • 1️Polaris Finance Phase 1 (Seigniorage)
    • Phase 1 FAQ
    • Token Genesis Pools & Launches + FAQs
      • POLAR Gen. & Launch
      • LUNAR Gen. & Launch
      • TRIPOLAR Gen. & Launch
      • ETHERNAL Gen. & Launch
      • ORBITAL Gen. & Launch
      • USP Gen. & Launch
      • BINARIS Gen. & Launch
    • SUNRISE and Earn
    • SUNRISE Expansions
    • BONDs Mechanism
    • Pegged Assets
    • BOND Assets
    • DAO Fund
    • Contracts & Wallets
  • 2️Polaris Finance Phase 2 (DEX)
    • Phase 2 FAQ
    • Overview
    • How it works
    • xPOLAR
    • veXPOLAR
      • Overview
      • veXPOLAR FAQ
    • Pools
      • Weighted Pools
      • Stable Pools
      • MetaStable Pools
    • Fees
    • Maths
      • Weighted Math
      • Stable Math
  • 🆘GUIDES
    • Moving between Aurora and Telos
    • Moving Assets and Liquidity to the new PolarisDEX
    • Moving from Solana to Aurora
    • Moving from EVM to Aurora
    • How to provide liquidity
  • 💡References
    • Dictionary
    • Polaris Finance Audit
Powered by GitBook
On this page
  • Overview
  • Advantages
  • Low Price Impact
  • Stable Swaps Under the Polaris Hood
  • Maths
  1. Polaris Finance Phase 2 (DEX)
  2. Pools

Stable Pools

PreviousWeighted PoolsNextMetaStable Pools

Last updated 2 years ago

Overview

Stable Pools are designed specifically for assets that are expected to consistently trade at near parity, such as different varieties of stablecoins or synthetics. Stable Pools use (based on StableSwap, popularized by Curve) which allows for significantly larger trades before encountering substantial price impact, vastly increasing capital efficiency for like-kind swaps.

Please note that unlike with weighted math, the assets in the stable pools must have the same weights. For example, if a stable pool contains 5 assets, any asset in the pool must have a 20% share.

Advantages

Low Price Impact

Traders enjoy tighter spreads and lower price impact. These pools allow for larger trades of assets before encountering a significant price impact.

Stable Swaps Under the Polaris Hood

One of the key advantages to having Stable Pools on Polaris specifically is that they are plugged into the same protocol as all other pools. Swapping between stable coins is frequently used for arbitrage when one token is paired with two different stable coins in different pools. By leveraging Batch Swaps on Polaris, these trades can be combined into a single, gas efficient transaction.

Maths

Stable Math is designed to allow for swaps between any assets that have the same price, or are "pegged" to the same asset. The most common examples are stablecoins that track US Dollars (USDT, USDC), and assets that track the price of Bitcoin (wBTC, renBTC, sBTC). Prices are determined by the pool balance, the amplification parameters, and amounts of the tokens that are being swapped.

In an ideal scenario, it would make sense to simply allow 1-to-1 trades for these assets; this would be a constant sum curve. In a worst case scenario where one or more of these assets loses their peg and their value diverges, it would make sense to enforce trade rules for uncorrelated assets; this would be a constant product curve, such as the one outlined in weighted math.

Since most real-life cases do not fall in either the ideal or disaster category, the stable math curve combines the constant sum and constant product curves and is designed to facilitate approximately 1-to-1 trades that incur large price changes only when token balances differ greatly. The amplification parameter, A, defines the degree to which the stable math curve approximates the constant product curve (when A=0), or the constant sum curve (when A→∞)

Constant sum or linear invariant: ∑xi=const

Constant product invariant: ∏xi=const

where xi represents the balance of the token in the pool.

Stableswap invariant is a combination of the above two and offers a much lower price slippage than Uniswap for stablecoin pools. It is given by:

A is the amplification coefficient and D is the invariant. Please note that unlike with weighted math, the assets in the stable pools must have the same weights. For example, if a stable pool contains 5 assets, any asset in the pool must have a 20% share.

The lower the amplification coefficient is, the closer to the constant product model the curve will be, as in Uniswap. Normally, trades will have relatively more significant slippages.

The higher the amplification coefficient is, the closer to the straight line the curve is, which is the case in the linear invariant. Normally, trades will have lower slippage. But when one token’s market price deviates from the peg, it will lead to a massive change in the pool’s composition.

The figure above is a simplified version of the stable pool, containing two assets. The stableswap invariant is a combination of the constant sum and constant product invariant. to see the impact of different parameters on the stableswap invariant curve.

2️
Stable Math
Check here