> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lpagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Zap-Out — Generate transaction to withdraw liquidity

> Generates serialized zap-out transactions to withdraw liquidity from a position. Supports both Meteora DLMM and DAMM V2 positions.



## OpenAPI

````yaml /api-reference/openapi.json post /position/decrease-tx
openapi: 3.0.0
info:
  title: LP Agent Open API
  version: 1.0.0
  description: |+
    Public API for LP Agent

    **Authentication**

    All endpoints require an API key passed via the `x-api-key` header.

servers:
  - url: https://api.lpagent.io/open-api/v1
    description: Production
security:
  - apiKeyAuth: []
tags: []
paths:
  /position/decrease-tx:
    post:
      tags:
        - Position
      summary: Zap-Out — Generate transaction to withdraw liquidity
      description: >-
        Generates serialized zap-out transactions to withdraw liquidity from a
        position. Supports both Meteora DLMM and DAMM V2 positions.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - position_id
                - bps
                - owner
                - slippage_bps
              properties:
                position_id:
                  type: string
                  description: The position ID
                bps:
                  type: integer
                  description: Basis points for the amount to decrease (0-10000)
                  minimum: 0
                  maximum: 10000
                owner:
                  type: string
                  description: The owner's wallet address
                slippage_bps:
                  type: integer
                  description: Slippage tolerance in basis points (0-10000)
                  minimum: 0
                  maximum: 10000
                output:
                  type: string
                  enum:
                    - allToken0
                    - allToken1
                    - both
                    - allBaseToken
                  description: The output token for the swap
                provider:
                  type: string
                  enum:
                    - OKX
                    - JUPITER_ULTRA
                  description: The swap provider to use
                type:
                  type: string
                  enum:
                    - meteora
                    - meteora_damm_v2
                  default: meteora
                  description: The pool type
                fromBinId:
                  type: number
                  description: Starting bin ID
                toBinId:
                  type: number
                  description: Ending bin ID
      responses:
        '200':
          description: Transaction data prepared successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      lastValidBlock:
                        type: number
                      closeTxs:
                        type: array
                        items:
                          type: string
                      swapTxs:
                        type: array
                        items:
                          type: string
                      closeTxsWithJito:
                        type: array
                        items:
                          type: string
                      swapTxsWithJito:
                        type: array
                        items:
                          type: string
        '400':
          description: Invalid parameters or position-related errors
        '500':
          description: Internal server error
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````