Remove liquidity from an exchange pair
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw \
--header 'Content-Type: application/json' \
--data '
{
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": 250000000000,
"visible": true
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw"
payload = {
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": 250000000000,
"visible": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
owner_address: 'TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH',
exchange_id: 1,
token_id: '1000001',
quant: 250000000000,
visible: true
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw",
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([
'owner_address' => 'TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH',
'exchange_id' => 1,
'token_id' => '1000001',
'quant' => 250000000000,
'visible' => true
]),
CURLOPT_HTTPHEADER => [
"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 := "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw"
payload := strings.NewReader("{\n \"owner_address\": \"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH\",\n \"exchange_id\": 1,\n \"token_id\": \"1000001\",\n \"quant\": 250000000000,\n \"visible\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw")
.header("Content-Type", "application/json")
.body("{\n \"owner_address\": \"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH\",\n \"exchange_id\": 1,\n \"token_id\": \"1000001\",\n \"quant\": 250000000000,\n \"visible\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"owner_address\": \"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH\",\n \"exchange_id\": 1,\n \"token_id\": \"1000001\",\n \"quant\": 250000000000,\n \"visible\": true\n}"
response = http.request(request)
puts response.read_body{
"txID": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3",
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": "250000000000"
},
"type_url": "type.googleapis.com/protocol.ExchangeWithdrawContract"
},
"type": "ExchangeWithdrawContract"
}
],
"ref_block_bytes": "ab92",
"ref_block_hash": "f5d4c3b2a3",
"expiration": 1672531380000,
"timestamp": 1672531320000
},
"raw_data_hex": "0a02ab921220f5d4c3b2a340e0ebe2f6e30f5a68081112620a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e45786368616e67655769746864726177436f6e747261637412280a154c7971797a56474c5631737266b7dd4afc8eagg615352220832353030303030303030"
}{
"Error": "Exchange not found or insufficient liquidity to withdraw"
}TRON node API
wallet/exchangewithdraw | TRON
TRON API method that removes liquidity from an existing exchange trading pair on the TRON decentralized exchange. Returns a transaction object containing:.
POST
/
95e61622bf6a8af293978377718e3b77
/
wallet
/
exchangewithdraw
Remove liquidity from an exchange pair
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw \
--header 'Content-Type: application/json' \
--data '
{
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": 250000000000,
"visible": true
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw"
payload = {
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": 250000000000,
"visible": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
owner_address: 'TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH',
exchange_id: 1,
token_id: '1000001',
quant: 250000000000,
visible: true
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw",
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([
'owner_address' => 'TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH',
'exchange_id' => 1,
'token_id' => '1000001',
'quant' => 250000000000,
'visible' => true
]),
CURLOPT_HTTPHEADER => [
"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 := "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw"
payload := strings.NewReader("{\n \"owner_address\": \"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH\",\n \"exchange_id\": 1,\n \"token_id\": \"1000001\",\n \"quant\": 250000000000,\n \"visible\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw")
.header("Content-Type", "application/json")
.body("{\n \"owner_address\": \"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH\",\n \"exchange_id\": 1,\n \"token_id\": \"1000001\",\n \"quant\": 250000000000,\n \"visible\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"owner_address\": \"TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH\",\n \"exchange_id\": 1,\n \"token_id\": \"1000001\",\n \"quant\": 250000000000,\n \"visible\": true\n}"
response = http.request(request)
puts response.read_body{
"txID": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3",
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": "250000000000"
},
"type_url": "type.googleapis.com/protocol.ExchangeWithdrawContract"
},
"type": "ExchangeWithdrawContract"
}
],
"ref_block_bytes": "ab92",
"ref_block_hash": "f5d4c3b2a3",
"expiration": 1672531380000,
"timestamp": 1672531320000
},
"raw_data_hex": "0a02ab921220f5d4c3b2a340e0ebe2f6e30f5a68081112620a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e45786368616e67655769746864726177436f6e747261637412280a154c7971797a56474c5631737266b7dd4afc8eagg615352220832353030303030303030"
}{
"Error": "Exchange not found or insufficient liquidity to withdraw"
}TRON API method that removes liquidity from an existing exchange trading pair on the TRON decentralized exchange.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
owner_address— the address withdrawing liquidity (base58 withvisible: true, or hex withvisible: false).exchange_id— unique identifier of the exchange pair to remove liquidity from.token_id— TRC10 token ID being withdrawn; use_to denote TRX.quant— integer amount to withdraw (token base units; if TRX, specify in sun).permission_id— optional permission ID for multi‑signature accounts.
Response
Returns a transaction object containing:txID— unique transaction identifierraw_data— raw transaction data including contract detailsraw_data_hex— hexadecimal representation of raw transaction data
Use case
Thewallet/exchangewithdraw method is used for:
- Removing liquidity from trading pairs to claim earned fees
- Withdrawing capital from underperforming or deprecated markets
- Rebalancing liquidity provider positions across different pairs
- Exiting liquidity positions before market volatility or impermanent loss
curl example
Shell
curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/exchangewithdraw' \
--header 'Content-Type: application/json' \
--data '{
"owner_address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
"exchange_id": 1,
"token_id": "1000001",
"quant": 250000000000,
"visible": true
}'
- balances must be integers (do not quote numbers). When withdrawing TRX (using
token_id: "_"), providequantin sun (1 TRX = 1,000,000 sun). - the call returns an unsigned transaction; sign and broadcast it. On mainnet, the exchange must exist, token must match the pair, and you must have sufficient LP position to withdraw.
Body
application/json
The address withdrawing liquidity from the exchange pair
Unique identifier of the exchange pair to remove liquidity from
Token ID being withdrawn from the liquidity pool. Use '_' to denote TRX.
Amount to withdraw as an integer (token base units; if TRX, specify in sun)
Optional permission ID for multi-signature accounts
Whether to return human-readable addresses
Last modified on June 22, 2026
Was this page helpful?