curl --request POST \
--url http://localhost:8000/gateway/amm/remove-liquidity \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"connector": "<string>",
"network": "<string>",
"pool_address": "<string>",
"percentage_to_remove": 123,
"slippage_pct": 123,
"wallet_address": "<string>",
"position_address": "<string>"
}
'import requests
url = "http://localhost:8000/gateway/amm/remove-liquidity"
payload = {
"connector": "<string>",
"network": "<string>",
"pool_address": "<string>",
"percentage_to_remove": 123,
"slippage_pct": 123,
"wallet_address": "<string>",
"position_address": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connector: '<string>',
network: '<string>',
pool_address: '<string>',
percentage_to_remove: 123,
slippage_pct: 123,
wallet_address: '<string>',
position_address: '<string>'
})
};
fetch('http://localhost:8000/gateway/amm/remove-liquidity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/gateway/amm/remove-liquidity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connector' => '<string>',
'network' => '<string>',
'pool_address' => '<string>',
'percentage_to_remove' => 123,
'slippage_pct' => 123,
'wallet_address' => '<string>',
'position_address' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/gateway/amm/remove-liquidity"
payload := strings.NewReader("{\n \"connector\": \"<string>\",\n \"network\": \"<string>\",\n \"pool_address\": \"<string>\",\n \"percentage_to_remove\": 123,\n \"slippage_pct\": 123,\n \"wallet_address\": \"<string>\",\n \"position_address\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/gateway/amm/remove-liquidity")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"connector\": \"<string>\",\n \"network\": \"<string>\",\n \"pool_address\": \"<string>\",\n \"percentage_to_remove\": 123,\n \"slippage_pct\": 123,\n \"wallet_address\": \"<string>\",\n \"position_address\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/gateway/amm/remove-liquidity")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connector\": \"<string>\",\n \"network\": \"<string>\",\n \"pool_address\": \"<string>\",\n \"percentage_to_remove\": 123,\n \"slippage_pct\": 123,\n \"wallet_address\": \"<string>\",\n \"position_address\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"signature": "<string>",
"status": "<string>",
"data": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Remove Amm Liquidity
Remove liquidity from an AMM pool.
Meteora DAMM v2 requires position_address (positions are NFTs); Gateway rejects a missing one with a 400, surfaced here unchanged, so “remove 100%” is a true exit of the named position.
curl --request POST \
--url http://localhost:8000/gateway/amm/remove-liquidity \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"connector": "<string>",
"network": "<string>",
"pool_address": "<string>",
"percentage_to_remove": 123,
"slippage_pct": 123,
"wallet_address": "<string>",
"position_address": "<string>"
}
'import requests
url = "http://localhost:8000/gateway/amm/remove-liquidity"
payload = {
"connector": "<string>",
"network": "<string>",
"pool_address": "<string>",
"percentage_to_remove": 123,
"slippage_pct": 123,
"wallet_address": "<string>",
"position_address": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connector: '<string>',
network: '<string>',
pool_address: '<string>',
percentage_to_remove: 123,
slippage_pct: 123,
wallet_address: '<string>',
position_address: '<string>'
})
};
fetch('http://localhost:8000/gateway/amm/remove-liquidity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/gateway/amm/remove-liquidity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connector' => '<string>',
'network' => '<string>',
'pool_address' => '<string>',
'percentage_to_remove' => 123,
'slippage_pct' => 123,
'wallet_address' => '<string>',
'position_address' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/gateway/amm/remove-liquidity"
payload := strings.NewReader("{\n \"connector\": \"<string>\",\n \"network\": \"<string>\",\n \"pool_address\": \"<string>\",\n \"percentage_to_remove\": 123,\n \"slippage_pct\": 123,\n \"wallet_address\": \"<string>\",\n \"position_address\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/gateway/amm/remove-liquidity")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"connector\": \"<string>\",\n \"network\": \"<string>\",\n \"pool_address\": \"<string>\",\n \"percentage_to_remove\": 123,\n \"slippage_pct\": 123,\n \"wallet_address\": \"<string>\",\n \"position_address\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/gateway/amm/remove-liquidity")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connector\": \"<string>\",\n \"network\": \"<string>\",\n \"pool_address\": \"<string>\",\n \"percentage_to_remove\": 123,\n \"slippage_pct\": 123,\n \"wallet_address\": \"<string>\",\n \"position_address\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"signature": "<string>",
"status": "<string>",
"data": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
Request to remove liquidity from an AMM pool.
AMM connector (e.g., 'meteora', 'raydium', 'uniswap')
Network ID in 'chain-network' format (e.g., 'solana-mainnet-beta')
Pool contract address
Percentage of liquidity to remove (0-100)
Maximum slippage percentage
Wallet address (optional, uses default)
Meteora position to remove from (required for meteora)
Response
Successful Response
Chain-neutral write response. signature holds the tx signature (Solana) or tx hash (EVM).
Transaction signature (Solana) or transaction hash (EVM)
Transaction status: SUBMITTED, CONFIRMED or FAILED. Mapped from Gateway's TransactionStatus enum by the same helper the swap and CLMM surfaces use, so one vocabulary spans all three.
Connector-specific confirmed-tx details
Was this page helpful?

