Liquidity
Use this page to add or remove liquidity on a pool (venue): deposit both sides of a pair, or burn LP shares for tokens back.
Signing uses a Wallet adapter.
Rules
- Add and remove are separate writes. You may need
balances.approvebeforeaddif allowance is too low. - After a successful write, refresh pool or
positionsreads. Pollsettlement.trackuntilconfirmedorfailedif the handle is still running. - This write can incur gas and the service fee when it runs. The SDK does not return a
costslist beforeadd/remove— Fees and costs.
Token0 / token1
For a venue’s pair listing:
| Field on the request | Instrument |
|---|---|
amount0 / amount0Min | PairListing.baseInstrumentId |
amount1 / amount1Min | PairListing.quoteInstrumentId |
Resolve the pair with easy.read.getPair or catalog.getVenue before building amounts. Do not guess order from the label alone.
liquidity.add
Both sides are required (balanced deposit): pass amount0 and amount1 as display decimals for token0 and token1.
const handle = await sdk.liquidity.add({
venue: 'evm:421018:amm:v2:0xabc123',
amount0: '10',
amount1: '25',
slippageBps: 50,
})Parameters — LiquidityAddRequest
| Field | Type | Description |
|---|---|---|
venue | VenueId | string | Pool to add to (venue id, or a string Nutrimatic can resolve). |
amount0 | string | How much token0 (pair base) to deposit (display decimal). Required. |
amount1 | string | How much token1 (pair quote) to deposit (display decimal). Required. |
slippageBps | number | Max price movement while the add settles, in bps (e.g. 50 = 0.50%). Optional — default 50. |
deadline | number | Optional. Unix time in milliseconds — do not proceed after this. |
ledgers | LedgerScope[] | Optional. Limit to these ledgers (id or alias). Omit to use the venue’s ledger. |
Signing uses purpose: 'liquidity_add'.
Returns — ExecutionHandle
Same ExecutionHandle as Swaps — easy.swap. Poll settlement.track until confirmed or failed if still running.
Example response:
{
"id": "exec_01HZZ…",
"status": "confirmed",
"ledger": "evm:421018",
"txRef": "0xdef…"
}liquidity.remove
const handle = await sdk.liquidity.remove({
venue: 'evm:421018:amm:v2:0xabc123',
liquidity: '1000',
amount0Min: '9.5',
amount1Min: '24',
slippageBps: 50,
})Parameters — LiquidityRemoveRequest
| Field | Type | Description |
|---|---|---|
venue | VenueId | string | Pool to remove from (venue id, or a string Nutrimatic can resolve). |
liquidity | string | How much LP / shares to burn (display decimal). |
amount0Min | string | Optional. Minimum token0 (pair base) you will accept (display decimal). |
amount1Min | string | Optional. Minimum token1 (pair quote) you will accept (display decimal). |
slippageBps | number | Max price movement while the remove settles, in bps (e.g. 50 = 0.50%). Optional — default 50. |
deadline | number | Optional. Unix time in milliseconds — do not proceed after this. |
ledgers | LedgerScope[] | Optional. Limit to these ledgers (id or alias). Omit to use the venue’s ledger. |
Signing uses purpose: 'liquidity_remove'.
Returns — ExecutionHandle
Same ExecutionHandle as Swaps — easy.swap. Poll settlement.track until confirmed or failed if still running.
Example response:
{
"id": "exec_01I00…",
"status": "submitted",
"ledger": "evm:421018",
"txRef": "0x789…"
}Confirming on the market side
After a successful handle, refresh:
getPoolView/getAmmView- Venue activity via
getVenueFeedwith kinds'liquidity_add'/'liquidity_remove'— see Activity feeds — Liquidity events
Feeds confirm market events; use ExecutionHandle / settlement.track for your operation status.
Errors
READ_ONLY_MODE, CAPABILITY_NOT_AVAILABLE, WALLET_REQUIRED, USER_REJECTED, SLIPPAGE_EXCEEDED, INSUFFICIENT_ALLOWANCE, VENUE_NOT_FOUND, LEDGER_NOT_SUPPORTED.
→ Fees and costs · Write operations · Positions · Swaps