Swapping
You can swap between XYZ and any graduated token on the AMM. Swaps execute instantly against the pool’s reserves using the constant-product formula.Swap XYZ for Tokens
To buy tokens with XYZ:- Navigate to the token’s trading page
- Enter the amount of XYZ you want to spend
- Review the estimated tokens you’ll receive and price impact
- Click Swap and confirm in your wallet
Contract Message
[{ "denom": "uxyz", "amount": "<xyz_to_swap>" }]
The min_output parameter protects against slippage — the transaction reverts if you’d receive fewer tokens than specified.
Swap Tokens for XYZ
To sell tokens for XYZ, the AMM uses the CW20 Send pattern. Instead of calling the AMM directly, you send tokens to the AMM contract with an encoded swap message:Simulating Swaps
Preview any swap before executing:offer_xyz: true for XYZ to Token, false for Token to XYZ.
Response:
Understanding Price Impact
Price impact is the difference between the current market price and the effective price of your trade. It depends on trade size relative to pool depth:| Trade Size vs Pool | Typical Price Impact |
|---|---|
| < 0.1% of pool | < 0.1% |
| 1% of pool | ~1% |
| 5% of pool | ~5% |
| 10% of pool | ~10% |
Fees
| Fee | Rate | Where It Goes |
|---|---|---|
| Base swap fee | 1% | Stays in pool (auto-compounds for LPs) |
| Augmented fee | 0-5% | Stays in pool; auto-disables at target value |
Next Steps
Liquidity
How LP tokens and pool mechanics work
AMM Overview
Constant-product formula and pool basics