Appearance
Platform REST API — Pools
Add and remove liquidity on the AMM without building the transactions yourself.
All liquidity routes require wallet-level auth, because they spend funds. See Platform REST API.
For the underlying mechanics, see Liquidity and LP tokens.
Add liquidity
POST /api/pools/add_liquidity
Token pair.
| Input | Meaning |
|---|---|
token1, token2 | Pair token addresses |
amount1_desired, amount2_desired | Amounts to add |
amount1_min, amount2_min | Slippage floors |
address | Your wallet; must be authenticated |
POST /api/pools/add_liquidity_knyx
Token paired with native KNYX.
| Input | Meaning |
|---|---|
token | The token address |
amount_token_desired, amount_knyx_desired | Amounts to add |
amount_token_min, amount_knyx_min | Slippage floors |
address | Your wallet |
Why both "desired" and "min"
A pool must be entered at its current ratio. If the price moves between your request and execution, the router adds what the ratio allows and returns the rest. The _min values are the floor below which it reverts instead.
Remove liquidity
POST /api/pools/remove_liquidity
| Input | Meaning |
|---|---|
token1, token2 | Pair token addresses |
liquidity | LP tokens to burn |
amount1_min, amount2_min | Minimum amounts to accept back |
address_to | Receives the returned tokens; must be authenticated |
POST /api/pools/remove_liquidity_knyx
The same, for a native-paired pool.
Read
All return { success, data: { result: [pair, token1, token2] } }.
| Endpoint | Auth |
|---|---|
GET /api/pools/list?address= | Wallet-level |
GET /api/pools/list_by_user?user_id= | User-level |
GET /api/pools/list_by_user_and_address?user_id=&user_addr= | Wallet-level |
GET /api/pools/info_by_address?user_id=&address= | User-level |
GET /api/pools/info_by_tokens?user_id=&token1=&token2= | User-level |
For aggregate pool data — volume, swap counts, liquidity — use GET /api/defi/pools on the explorer services API instead. It derives figures from Swap events across every pair.