W-Type SWP-Pairs
Custom weights constant product 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.
All SWP-Pairs output a single token per swap, but W-Type and P-Type pools have a standout feature: you can swap up to (n−1) [where (n) is the pool’s token count] into the n-th token in one go, solved natively without intermediate steps. This chapter explores the W-Type SWP-Pair, its Constant Product Weighted Invariant, and why this multi-input capability makes it a key part of Ouronet’s DEX.
What is the Constant Product Weighted Invariant?
W-Type SWP-Pairs use a constant product system, like traditional AMMs, but with a key difference: each token—up to 7—gets its own weight. These weights, set by the pool creator and adjustable later, decide how much each token influences pricing—like giving one token 50% weight and splitting the rest across the others. The pool keeps a fixed “total value” steady, and W-Type’s killer feature is letting you swap up to 6 tokens at once into the 7th, all in one shot, thanks to Ouronet solving the balance directly. It’s customizable trading with a multi-input twist.
How it Works
Imagine a W-Type pool as a weighted scale with up to 7 tokens. Each token has its own importance—say, one at 50%, another at 30%, and the rest splitting 20%. The pool’s “value” stays constant, shaped by these weights. You can add one token to get another, or go big and toss in multiple tokens—up to 6 out of 7—to get the last one back. The pool adjusts how much you get based on the weights: a heavily weighted token shifts prices less, while a lighter one moves more. Add several tokens at once, and it balances them all against the one you want, figuring it out in a single move. If the market shifts, tweak the weights later to keep it on track.
The Math, Simplified
Picture a W-Type pool with 3 tokens: one at 50% weight with 100 units, another at 30% with 200, and the third at 20% with 300. The pool’s “value” is steady, say at 60,000, adjusted for weights. Swap 10 of the first and 20 of the second to get the third; the pool might give you 25 or so, keeping that 60,000 intact. With 7 tokens—say 100 each, weighted 40%, 20%, 15%, 10%, 10%, 3%, 2%—the value might be 70,000. Add 10 of six tokens, and you could get 15 of the seventh. Weights make it flexible, and Ouronet handles the multi-swap instantly.
Why It's Useful
W-Type SWP-Pairs bring tailored power to Ouronet’s DEX with their weighted, multi-input design:
Multi-Token Swaps: Swap up to 6 tokens into 1—like 3 Stablecoins and 3 volatiles into ETH—in one go. This native feature, shared with P-Type, cuts steps and costs, making Ouronet a trader’s dream.
Custom Weights: Set weights to match token values—like 50% for a stablecoin, 10% each for 5 others. Unlike P-Type’s equal split or S-Type’s stability, W-Type fits uneven pairs perfectly.
Adaptability: Weights can shift later if a token’s value changes (e.g., a coin pumps 200%). This keeps W-Type pools relevant on Ouronet without a full reset.
Efficient Multi-Asset Trading: With up to 7 tokens, weighted pools handle complex swaps—like 6 niche tokens into a major one—with less slippage than equal-weight P-Type, boosting trader value.
Niche Appeal: W-Type attracts specific use cases, like pooling 6 governance tokens at 10% each and a stablecoin at 40%. This draws projects and traders to Kadena, growing Ouronet’s reach.
Arbitrage and Fees: Multi-token inputs skew prices, inviting arbitrageurs to fix the weighted balance—whether it’s 2 or 6 tokens swapped. This keeps LPs earning and pools liquid.
W-Type SWP-Pairs make Ouronet’s DEX more versatile, filling a gap between S-Type’s stability and P-Type’s simplicity. They’re perfect for volatile or uneven asset pairs, enhancing user options and Kadena’s appeal. Without W-Type pools, Ouronet might struggle to serve traders needing custom ratios, losing them to more flexible competitors.
Last updated