S-Type SWP-Pairs
Stable Swap Liquidity Pools
SWP-Pairs come in three distinct flavours, each tailored to different trading needs:
S-Type: Uses the Stable Swap Curve Invariant for low-slippage trading of stable or pegged assets (e.g., stablecoins or wrapped tokens).
W-Type: Employs a constant product formula with weighted balances, ideal for assets with varying value ratios.
P-Type: Relies on a constant product formula with equal weights, mimicking traditional AMMs like Uniswap for balanced asset pairs.
This chapter dives into the S-Type SWP-Pair, exploring the Stable Swap Curve Invariant—its mechanics, math, and why it’s a valuable addition to Ouronet’s DEX.
What is the Stable Swap Curve Invariant?
The Stable Swap Invariant, used in S-Type SWP-Pairs, blends a constant product formula with a constant sum approach. This creates a curve that’s flat near equilibrium (when asset prices are equal) for low slippage and steepens when imbalanced for dynamic pricing. The core equation is:

Where:
( D ): The pool’s constant value.
( A ): Amplification factor (controls flatness).
( n ): Number of assets (e.g., 2 for two tokens).
x(i): Balance of each asset.
For a two-token S-Type pool, it simplifies to:
D=4A(x+y)+xy
The 4A(x+y) term keeps prices stable near 1:1, while (x*y) adjusts pricing during imbalances.
How it Works
The Stable Swap Invariant in S-Type SWP-Pairs is all about keeping trades smooth and fair. Imagine a pool with two stablecoins, like USDC and DAI. When the amounts of both coins are equal, the system prioritizes keeping their prices close to 1:1. This is controlled by a setting called the amplification factor—think of it as a dial. Turn it up, and the pool fights harder to keep prices stable, meaning you lose less value when swapping. Turn it down, and it starts acting more like a regular trading pool, letting prices shift more freely. When you trade, say by adding some USDC to get DAI, the pool adjusts. It figures out how much DAI to give you by ensuring the pool’s overall “value” stays the same. If the pool stays balanced, you get almost exactly what you expect. If it gets lopsided—say, too much USDC and not enough DAI—the price of DAI rises, encouraging others to add DAI and fix the balance. This self-adjusting trick keeps S-Type pools efficient and useful for stable assets.
Why It’s Useful
S-Type SWP-Pairs, with their Stable Swap Invariant, bring unique value to Ouronet’s DEX:
Low Slippage for Stable Trades: Unlike P-Type or W-Type pairs, S-Type pools minimize slippage for stablecoin or pegged asset swaps, making trades cost-effective and predictable—crucial for Ouronet users handling large volumes.
Better Capital Efficiency: By concentrating liquidity near equal prices, S-Type pools need less capital to support high trade volumes, maximizing returns for Ouronet liquidity providers (LPs).
Targeting Stablecoin Volume: Stablecoins drive DeFi activity. S-Type pairs attract traders and protocols needing efficient swaps, increasing Ouronet’s transaction volume and visibility on Kadena.
Robustness: If a stable asset deviates from its peg, the curve adapts smoothly, keeping the pool viable—unlike pure constant-sum designs that fail in such cases.
Arbitrage and Fees: The curve’s steepness at imbalance draws arbitrageurs to rebalance pools, generating more fees for LPs and keeping Ouronet’s S-Type pairs liquid and competitive.
Adding S-Type SWP-Pairs to Ouronet diversifies its Liquidity Pools beyond volatile W-Type and P-Type pairs. It caters to stablecoin users—a massive market—while boosting efficiency, user trust, and Kadena’s DeFi adoption. Without S-Type pools, Ouronet might miss out on this critical niche, ceding ground to specialized competitors.
Last updated