zerokn0wledge

Bifrost Stable Swap: correlated StableSwap pools for vToken/Token pairs

Thread489 words

Explains Bifrost's StableSwap pool for yield-bearing vTokens and their base tokens, using a correlated rather than pegged curve. Example: 100 vDOT swap gives 90.8539 DOT on Uniswap V2 (9.146% slippage) versus 99.9958 DOT (0.004%) with A=5,000.

Key claims
With A=5,000 a 100 vDOT swap yields 99.9958 DOT at 0.004% slippage
Uniswap V2 yields 90.8539 DOT at 9.146% slippage on same pool
0/ @BifrostFinance has just launched their Stable Swap function on the Bifrost-Kusama network! ๐Ÿš€ This function will increase the efficiency of vToken/Token swaps on Bifrost by lowering slippage and providing better swap rates! ๐ŸŒˆ A ๐Ÿงต on how it works! (0/15) ๐Ÿ‘‡ 1/ ๐Ÿ” Overview @BifrostFinance Stable Pool is created to facilitate exchanges between vTokens & their respective Tokens (e.g., vDOT-DOT, vETH-ETH) that are anticipated to have near-equal values. 2/ Leveraging StableSwap's framework, established by Curve, it can accommodate extensive trades with minimal price alterations, optimizing the efficiency of such exchanges. 3/ vTokens are yield-bearing, meaning their value will gradually increase over time compared to the corresponding Token value. 4/ Therefore, the liquidity supply anchor of vToken and Token in AMM should change with the vToken exchange rate to avoid loss for liquidity providers. 5/ ๐Ÿ‘€ Comparing Stable Swap Mechanisms ๐Ÿ”น Pegged Stable Swap: Tokens that swap at a roughly 1:1 ratio, typically like two identical stablecoins. ๐Ÿ”น Correlated Stable Swap: Tokens swapping near a 1:R rate, with 'R' being a slowly shifting rate (e.g. pairs like vDOT to DOT) 6/ ๐Ÿงฎ Liquidity Efficiency Within Stableswap, the 'A' function determines the extent of stable exchange rates the Stable Curve can support. 7/ The larger the A value, the more liquidity is available to support constant prices. Conversely, the smaller the A value, the less liquidity is available to support constant prices. For more mathematical details about the A value, please refer to the Invariant section. 8/ ๐Ÿ“ˆ Interpreting Stable Curve Coefficient In the Stable Swap context, 'A's value represents an improvement in liquidity efficiency relative to Uniswap V2. 9/ For clarity: 100x liquidity efficiency implies that swapping 100 BNC in a stable pool, given the same liquidity, is analogous to swapping 1 BNC in the Uniswap V2 pool. 10/ ๐Ÿ“Š Practical Example Consider a liquidity pool (vDOT & DOT both at 501.1872 with a 1:1 rate): ๐Ÿ”น Uniswap V2: 100 vDOT swap yields 90.8539 DOT (9.146% slippage). ๐Ÿ”น Bifrost Stable Pool (with A coefficient of 5,000): The same swap results in 99.9958 DOT & 0.004% slippage. 11/ As we can see, @BifrostFinance showcases significant slippage minimization: ๐Ÿ”น From an input of 100 vDOT: ๐Ÿ”น Output transition: 90.8539 DOT (Uniswap) to 99.9958 DOT (Bifrost). ๐Ÿ”น Slippage shifts from 9.146% (Uniswap) to 0.004% (Bifrost). 12/ ๐Ÿง On the Invariant: Determining the invariant, termed 'D', within the Stable Math framework is iterative due to its complexity. 13/ The invariant's behavior: ๐Ÿ”น Approaches a constant sum curve when token prices align closely to a 1:1 equilibrium. 14/ ๐Ÿ”น Resembles a constant product curve as prices veer away from the equilibrium. Strong deviations lead to increased slippage, ensuring liquidity even at highly disparate price points. 15/ For a deeper technical dive, one can refer to Curve's StableSwap Invariant documentation. I hope you've found this thread helpful! ๐Ÿซก Follow me @zerokn0wledge_ & @BifrostFinance for more! ๐ŸŒˆ Like/Repost of the quoted post below highly appreciated! ๐Ÿ‘‡๐Ÿ™

3 images on X

Open on X

What came next ยท since 23 Sep 2023

Show how the covered asset moved

This explainer walks through how things work without making a call on the token, so price moves since publication are shown as market context.

Covered, no call
$BNCBifrostsince publicationโˆ’95%โˆ’98% vs BTC

Daily closes in USD from DefiLlama and Yahoo Finance. Only a bullish or bearish call in a thesis or market take is tracked; explainers, lists, maps and mentions are neutral context. Not financial advice.

zerokn0wledge avatar
Working together

Research, advisory and builds for deep-tech teams.