Withdraw from a maker book
Builds an unsigned tx that calls MakerWithdrawFunds, optionally followed by a WSOL CloseAccount to unwrap to native SOL.
curl --request POST \
--url https://api.archer.exchange/v1/maker/withdraw \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"baseAmount": "all",
"platform": "self",
"quoteAmount": "50",
"unwrapSol": false,
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/maker/withdraw"
payload = {
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"baseAmount": "all",
"platform": "self",
"quoteAmount": "50",
"unwrapSol": False,
"withInstructions": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
market: 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
signer: '<string>',
accountOwner: '<string>',
baseAmount: 'all',
platform: 'self',
quoteAmount: '50',
unwrapSol: false,
withInstructions: false
})
};
fetch('https://api.archer.exchange/v1/maker/withdraw', 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://api.archer.exchange/v1/maker/withdraw",
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([
'market' => 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
'signer' => '<string>',
'accountOwner' => '<string>',
'baseAmount' => 'all',
'platform' => 'self',
'quoteAmount' => '50',
'unwrapSol' => false,
'withInstructions' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.archer.exchange/v1/maker/withdraw"
payload := strings.NewReader("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"baseAmount\": \"all\",\n \"platform\": \"self\",\n \"quoteAmount\": \"50\",\n \"unwrapSol\": false,\n \"withInstructions\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.archer.exchange/v1/maker/withdraw")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"baseAmount\": \"all\",\n \"platform\": \"self\",\n \"quoteAmount\": \"50\",\n \"unwrapSol\": false,\n \"withInstructions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/maker/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"baseAmount\": \"all\",\n \"platform\": \"self\",\n \"quoteAmount\": \"50\",\n \"unwrapSol\": false,\n \"withInstructions\": false\n}"
response = http.request(request)
puts response.read_body{
"action": "deposit",
"addressLookupTables": [
"<string>"
],
"baseLots": 123,
"expiresAt": 123,
"quoteLots": 123,
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
}
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}Authorizations
Body
Withdraw free balance from a maker book. Decimal string for a specific amount, the literal "all" to drain that side's full free balance, or omit to skip. At least one side must be > 0 (or "all").
"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4"
The wallet that signs: the book's maker, or with accountOwner the account's owner or delegate. Existing clients may keep sending it as owner; send one name only.
The wallet that owns the ArcherAccount this request acts through. With platform it derives the account PDA server-side — you never handle a PDA. Omit for a plain wallet-owned book. Replaces the earlier archerAccount field, which is no longer read.
"all"
Platform namespace for accountOwner. Ignored unless accountOwner is set.
self, treadfi "50"
Close the WSOL ATA after withdraw so the lamports unwrap to native SOL. Only meaningful when either market side is native. Ignored for an ArcherAccount-owned book: closing the PDA's wSOL account needs the PDA's signature, so the wSOL stays in the account (withdraw it with the ArcherAccount withdraw).
Also return the unsigned instructions under instructions, for composing your own transaction instead of signing ours. Omitted or false leaves the response exactly as it was.
Response
Unsigned transaction built.
Unsigned tx for deposit / withdraw / close plus the amounts moved (in on-chain lots).
deposit, withdraw, close Base lots the action moves (the explicit amount withdrawn/deposited). For a withdraw, "all" is resolved server-side to the book's free balance and reported here as that concrete amount. 0 for close.
Quote lots the action moves. Same conventions as baseLots.
Base64 unsigned VersionedTransaction.
Unsigned instructions, present only when the request set withInstructions.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.archer.exchange/v1/maker/withdraw \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"baseAmount": "all",
"platform": "self",
"quoteAmount": "50",
"unwrapSol": false,
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/maker/withdraw"
payload = {
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"baseAmount": "all",
"platform": "self",
"quoteAmount": "50",
"unwrapSol": False,
"withInstructions": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
market: 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
signer: '<string>',
accountOwner: '<string>',
baseAmount: 'all',
platform: 'self',
quoteAmount: '50',
unwrapSol: false,
withInstructions: false
})
};
fetch('https://api.archer.exchange/v1/maker/withdraw', 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://api.archer.exchange/v1/maker/withdraw",
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([
'market' => 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
'signer' => '<string>',
'accountOwner' => '<string>',
'baseAmount' => 'all',
'platform' => 'self',
'quoteAmount' => '50',
'unwrapSol' => false,
'withInstructions' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.archer.exchange/v1/maker/withdraw"
payload := strings.NewReader("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"baseAmount\": \"all\",\n \"platform\": \"self\",\n \"quoteAmount\": \"50\",\n \"unwrapSol\": false,\n \"withInstructions\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.archer.exchange/v1/maker/withdraw")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"baseAmount\": \"all\",\n \"platform\": \"self\",\n \"quoteAmount\": \"50\",\n \"unwrapSol\": false,\n \"withInstructions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/maker/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"baseAmount\": \"all\",\n \"platform\": \"self\",\n \"quoteAmount\": \"50\",\n \"unwrapSol\": false,\n \"withInstructions\": false\n}"
response = http.request(request)
puts response.read_body{
"action": "deposit",
"addressLookupTables": [
"<string>"
],
"baseLots": 123,
"expiresAt": 123,
"quoteLots": 123,
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
}
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}