SWSS DEX
SWSS DEX is the SwssChain-native decentralised exchange (DEX) for on-chain asset trading. It implements an automated market maker (AMM) model with concentrated liquidity, enabling efficient price discovery and low-slippage trading for SWSS Coin and other assets issued on SwssChain. All trading operations (liquidity provision, swaps, and fee collection) execute on-chain with full transparency.
Trading Model
SWSS DEX uses a concentrated liquidity AMM where liquidity providers specify a price range within which their capital is deployed. This increases capital efficiency compared to traditional constant-product AMMs by concentrating liquidity around the current market price.
The core invariant for a given liquidity position within its active range is:
(x + L / sqrt(P_upper)) × (y + L × sqrt(P_lower)) = L²
Where x and y are the reserve amounts of the two assets, L is the liquidity depth, and P_upper / P_lower are the upper and lower price bounds of the position.
Supported Trading Pairs
| Pair |
Status |
Fee Tier |
| SWSS / USDC | Q4 2027 | 0.05%, 0.3%, 1% |
| SWSS / USDT | Q4 2027 | 0.05%, 0.3% |
| SWSS / WETH | Q3 2026 | 0.3%, 1% |
DEX Smart Contracts
SWSS DEX is implemented as a set of immutable smart contracts on SwssChain. The core contracts are:
- DEX Factory: Deploys and tracks all trading pair pool contracts.
- DEX Router: The user-facing contract for submitting swaps and managing multi-hop routes.
- DEX Pool: Individual concentrated liquidity pool contracts, one per trading pair and fee tier.
- DEX Position Manager: Manages liquidity provider positions as on-chain records using the Deed Transaction Standard's position tracking extension.
SDK Integration
import { SwssChain, networks } from '@swsschain/sdk';
import { DexRouter } from '@swsschain/dex-sdk';
const client = new SwssChain({
network: networks.mainnet,
privateKey: process.env.PRIVATE_KEY as `0x${string}`,
});
const dex = new DexRouter(client);
const quote = await dex.getQuote({
tokenIn: 'SWSS',
tokenOut: 'USDC',
amountIn: client.parseSWSSCoin('100'),
slippageTolerance: 0.005,
});
console.log('Expected output:', quote.amountOut, 'USDC');
const txHash = await dex.swap({
...quote,
deadline: Math.floor(Date.now() / 1000) + 300,
});
Liquidity Provision
Liquidity providers earn trading fees proportional to their share of the active liquidity in a pool. Fees accumulate in the pool contract and are redeemable at any time. Providing liquidity to SWSS DEX is subject to the standard risks associated with AMM liquidity provision, including impermanent loss resulting from price divergence between the deposited assets.
Settlement Combustion Model
DEX swap transactions are standard SwssChain transactions subject to the Transactional Settlement Levy at the network level. The DEX protocol fee (the fee tier selected at pool creation) is separate from and in addition to the TSL. Protocol fees are distributed to liquidity providers in proportion to their active position depth at the time of each swap.