> ## 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 - Estimate what a withdrawal pays out

> For each output option of `decrease-tx`, returns what the wallet ends up with after the swap and fees, priced on the route the transaction is built on: net amounts, their value in SOL and USD, and the same withdrawal's value at the pool price before any swap. Call it before `decrease-tx` to show the user the real payout.

Meteora DLMM positions only. **Solana only** - this endpoint has no Robinhood Chain (EVM) equivalent.

Replaces `POST /position/decrease-quotes`, which has been removed.




## OpenAPI

````yaml /api-reference/openapi.json post /position/zap-out-estimates
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/zap-out-estimates:
    post:
      tags:
        - Position
      summary: Zap-Out - Estimate what a withdrawal pays out
      description: >
        For each output option of `decrease-tx`, returns what the wallet ends up
        with after the swap and fees, priced on the route the transaction is
        built on: net amounts, their value in SOL and USD, and the same
        withdrawal's value at the pool price before any swap. Call it before
        `decrease-tx` to show the user the real payout.


        Meteora DLMM positions only. **Solana only** - this endpoint has no
        Robinhood Chain (EVM) equivalent.


        Replaces `POST /position/decrease-quotes`, which has been removed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - bps
              properties:
                position_id:
                  type: string
                  description: >-
                    The position address, as passed to `decrease-tx`. This is
                    the `id` (same value as `tokenId`) that
                    `/lp-positions/opening` returns. Either this or `id` is
                    required.
                  example: Ep22EwKegXis3bTC6P8JLgsHaT5J2beM2TncKe2Hmv24
                id:
                  type: string
                  description: >-
                    An encrypted position ID, still accepted in place of
                    `position_id`. The `id` that `/lp-positions/opening` returns
                    on this API is already the plain position address: send that
                    one as `position_id`.
                bps:
                  type: integer
                  description: >-
                    Basis points of the position to withdraw (1-10000). 10000
                    closes it and claims its fees.
                  minimum: 1
                  maximum: 10000
                  example: 10000
                outputs:
                  type: array
                  description: Price only these output options (default all four)
                  items:
                    type: string
                    enum:
                      - allToken0
                      - allToken1
                      - both
                      - allBaseToken
                  example:
                    - allBaseToken
                    - both
      responses:
        '200':
          description: >-
            One estimate per requested output. An estimate with ok=false carries
            the reason (e.g. no swap route).
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      lane:
                        type: string
                        enum:
                          - wallet
                        description: 'Always `wallet`: `decrease-tx` is signed by the owner'
                      bps:
                        type: integer
                        description: The `bps` that was priced
                      isClose:
                        type: boolean
                        description: >-
                          True when `bps` is 10000: the position is closed and
                          its fees are claimed
                      nativePriceUsd:
                        type: number
                        description: SOL price in USD used for the estimate
                      target:
                        type: object
                        description: Token that `allBaseToken` pays out in (SOL)
                        properties:
                          address:
                            type: string
                          symbol:
                            type: string
                            nullable: true
                          decimals:
                            type: integer
                      estimates:
                        type: array
                        items:
                          type: object
                          properties:
                            output:
                              type: string
                              enum:
                                - allToken0
                                - allToken1
                                - both
                                - allBaseToken
                              description: >-
                                The `decrease-tx` output option this estimate is
                                for
                            ok:
                              type: boolean
                              description: >-
                                False when this option could not be priced, for
                                example when there is no swap route
                            error:
                              type: string
                              description: >-
                                Why the option could not be priced. Present when
                                `ok` is false
                            receive:
                              type: array
                              description: >-
                                What the wallet ends up holding, swap and fees
                                already taken
                              items:
                                type: object
                                properties:
                                  address:
                                    type: string
                                  decimals:
                                    type: integer
                                  amount:
                                    type: string
                                    description: Raw base units
                                  uiAmount:
                                    type: number
                            valueNative:
                              type: number
                              description: '`receive` priced in SOL'
                            valueUsd:
                              type: number
                              description: '`receive` priced in USD'
                            marketValueNative:
                              type: number
                              description: >-
                                The same withdrawal priced at the pool, before
                                any swap or fee, in SOL
                            marketValueUsd:
                              type: number
                              description: >-
                                The same withdrawal priced at the pool, before
                                any swap or fee, in USD
                            priceImpactPct:
                              type: number
                              nullable: true
                              description: >-
                                Price impact of the worst swap leg, in percent.
                                Negative when the swap moves the price against
                                you. Null when the payout needs no swap or the
                                route reports no impact.
        '400':
          description: Invalid parameters or the position could not be read
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.