Skip to content
CTRL K
    Liquidity

    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.approve before add if allowance is too low.
    • After a successful write, refresh pool or positions reads. Poll settlement.track until confirmed or failed if the handle is still running.
    • This write can incur gas and the service fee when it runs. The SDK does not return a costs list before add / removeFees and costs.

    Token0 / token1

    For a venue’s pair listing:

    Field on the requestInstrument
    amount0 / amount0MinPairListing.baseInstrumentId
    amount1 / amount1MinPairListing.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

    FieldTypeDescription
    venueVenueId | stringPool to add to (venue id, or a string Nutrimatic can resolve).
    amount0stringHow much token0 (pair base) to deposit (display decimal). Required.
    amount1stringHow much token1 (pair quote) to deposit (display decimal). Required.
    slippageBpsnumberMax price movement while the add settles, in bps (e.g. 50 = 0.50%). Optional — default 50.
    deadlinenumberOptional. Unix time in milliseconds — do not proceed after this.
    ledgersLedgerScope[]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

    FieldTypeDescription
    venueVenueId | stringPool to remove from (venue id, or a string Nutrimatic can resolve).
    liquiditystringHow much LP / shares to burn (display decimal).
    amount0MinstringOptional. Minimum token0 (pair base) you will accept (display decimal).
    amount1MinstringOptional. Minimum token1 (pair quote) you will accept (display decimal).
    slippageBpsnumberMax price movement while the remove settles, in bps (e.g. 50 = 0.50%). Optional — default 50.
    deadlinenumberOptional. Unix time in milliseconds — do not proceed after this.
    ledgersLedgerScope[]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:

    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