Skip to main content
POST
/
position
/
decrease-tx
Zap-Out — Generate transaction to withdraw liquidity
curl --request POST \
  --url https://api.lpagent.io/open-api/v1/position/decrease-tx \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "position_id": "<string>",
  "bps": 5000,
  "owner": "<string>",
  "slippage_bps": 5000,
  "output": "allToken0",
  "provider": "OKX",
  "type": "meteora",
  "fromBinId": 123,
  "toBinId": 123
}
'
{
  "data": {
    "lastValidBlock": 123,
    "closeTxs": [
      "<string>"
    ],
    "swapTxs": [
      "<string>"
    ],
    "closeTxsWithJito": [
      "<string>"
    ],
    "swapTxsWithJito": [
      "<string>"
    ]
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
position_id
string
required

The position ID

bps
integer
required

Basis points for the amount to decrease (0-10000)

Required range: 0 <= x <= 10000
owner
string
required

The owner's wallet address

slippage_bps
integer
required

Slippage tolerance in basis points (0-10000)

Required range: 0 <= x <= 10000
output
enum<string>

The output token for the swap

Available options:
allToken0,
allToken1,
both,
allBaseToken
provider
enum<string>

The swap provider to use

Available options:
OKX,
JUPITER_ULTRA
type
enum<string>
default:meteora

The pool type

Available options:
meteora,
meteora_damm_v2
fromBinId
number

Starting bin ID

toBinId
number

Ending bin ID

Response

Transaction data prepared successfully

data
object