P-Type SWP-Pairs
Equal 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 P-Type SWP-Pair, its Constant Product Equal-Weighted Invariant, and why this multi-input capability makes it a key part of Ouronet’s DEX.
What is the Constant Product Equal-Weighted Invariant?
P-Type SWP-Pairs use the classic constant product system, familiar from AMMs like Uniswap. Each token in the pool—up to 7—has equal weight, so they all contribute the same share to the pool’s value (e.g., about 14.3% with 7 tokens). The pool keeps a fixed “total value” steady, adjusting prices when tokens are added or removed. Unlike S-Type’s focus on stability or W-Type’s custom weights, P-Type keeps it simple and equal. Its special trick? You can toss in up to 6 tokens at once and get the 7th back, all in one smooth move, thanks to Ouronet solving the balance directly.
How it Works
Think of a P-Type pool as a mixing bowl with up to 7 ingredients—each token equally important. The pool’s “value” is a constant number that ties them all together. Normally, you’d add one token to get another out, but with P-Type, you can dump in multiple tokens—say, 3 out of 4—and get the 4th back in a single swap. The pool figures out how much of that last token to give you by keeping its value steady. Add a bunch of one token, and the others get pricier; add several at once, and it balances them all against the one you want. It’s like trading a handful of coins for a single bill, done instantly without swapping them one-by-one.
The Math, Simplified
Picture a P-Type pool with 4 tokens—100 of each—balanced so their “value” is, say, 400,000. Each token has equal weight, like a quarter of the mix. Now, swap 10 of the first, 20 of the second, and 15 of the third to get the fourth. The pool adjusts, maybe giving you 40 of that last token, keeping the 400,000 intact. With 7 tokens at 100 each, the value might be 700,000. Toss in 10 of six tokens, and you might get 50 of the seventh back. The more you add, the less you get per token, but Ouronet crunches it all at once—equal shares, one output, no fuss.
Why It's Useful
P-Type SWP-Pairs shine on Ouronet’s DEX with their equal-weighted, multi-input design:
Multi-Token Swaps: Swap up to 6 tokens into 1 in a single go—say, ETH, a stablecoin, and 4 others into a governance token. This native feature saves time and gas, setting Ouronet apart from standard AMMs.
Simplicity: Even with up to 7 tokens, P-Type keeps it straightforward—no weights like W-Type or stability tweaks like S-Type. It’s perfect for Ouronet users who want easy, all-in-one trades.
Proven Foundation: The equal-weighted constant product model is DeFi-tested, now supercharged with multi-input swaps. P-Type pools bring reliability to Kadena with a modern twist.
Flexible Liquidity: Equal weights across 7 tokens spread liquidity evenly, supporting traders who want to bundle multiple assets into one output. It’s a magnet for volume and LP fees on Ouronet.
Arbitrage Boost: Adding multiple tokens skews prices, pulling in arbitrageurs to rebalance—whether it’s 3 or 6 inputs. This keeps P-Type pools liquid and profitable for Kadena LPs.
Ecosystem Power: With one-shot swaps ofn−1n-1
n-1
tokens, P-Type pools pair seamlessly with Ouronet’s autostake pairs or token types. It’s a fast lane for complex trades, like consolidating 6 assets into a single staking token.
P-Type SWP-Pairs anchor Ouronet with a classic yet enhanced pool type. Their multi-input swaps complement S-Type’s stability and W-Type’s flexibility, making the DEX a one-stop shop for Kadena traders. Without P-Type’sn−1n-1n-1
feature, Ouronet might lag behind, forcing users to chain swaps elsewhere.
Last updated