OneSwap SDK
OneSwap is an automated market maker (AMM) on Canton Network. The SDK lets you integrate token swaps and liquidity provision into your application with a few lines of TypeScript.What you can do
- Swap tokens (CC/Amulet, USDCx) using AMM pricing
- Provide and manage liquidity in pools
- Create custodial wallets for your end users
- Get real-time quotes with slippage protection
- Track swap and LP intent status via events or polling
- View LP positions, earnings, APR/APY
How it works
OneSwap uses an intent-based execution model:- Your app creates a swap or LP intent via the SDK.
- The intent returns a
depositAddresswhere tokens should be sent. - OneSwap detects the deposit on-chain and executes automatically.
- Your app polls or listens for completion.
Core model
- Formula:
x * y = k(constant product) - Fee: 0.3% per swap (80% to LPs, 20% to platform)
- Intents expire 30 minutes after creation
Read next
- Getting started — install and configure the SDK
- SDK quickstart — your first swap in minutes
- API reference — all endpoints and types