Skip to content

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.

InputMeaning
token1, token2Pair token addresses
amount1_desired, amount2_desiredAmounts to add
amount1_min, amount2_minSlippage floors
addressYour wallet; must be authenticated

POST /api/pools/add_liquidity_knyx

Token paired with native KNYX.

InputMeaning
tokenThe token address
amount_token_desired, amount_knyx_desiredAmounts to add
amount_token_min, amount_knyx_minSlippage floors
addressYour 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

InputMeaning
token1, token2Pair token addresses
liquidityLP tokens to burn
amount1_min, amount2_minMinimum amounts to accept back
address_toReceives 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] } }.

EndpointAuth
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.

KriptoNyx testnet — chain ID 3009 (kriptonyx_3009-1)