Close a maker book
Closes the owner’s maker book and reclaims rent. By default batches ClearBook + MakerWithdrawFunds(all) + CloseMakerBook into one tx for a clean one-signature exit. The book must end fully empty (enforced on-chain); if a phase is opted out and the book is non-empty on that dimension, returns 400.
curl --request POST \
--url https://api.archer.exchange/v1/maker/close \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"clearOrders": true,
"platform": "self",
"unwrapSol": true,
"withInstructions": false,
"withdrawAll": true
}
'import requests
url = "https://api.archer.exchange/v1/maker/close"
payload = {
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"clearOrders": True,
"platform": "self",
"unwrapSol": True,
"withInstructions": False,
"withdrawAll": True
}
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>',
clearOrders: true,
platform: 'self',
unwrapSol: true,
withInstructions: false,
withdrawAll: true
})
};
fetch('https://api.archer.exchange/v1/maker/close', 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/close",
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>',
'clearOrders' => true,
'platform' => 'self',
'unwrapSol' => true,
'withInstructions' => false,
'withdrawAll' => true
]),
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/close"
payload := strings.NewReader("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"clearOrders\": true,\n \"platform\": \"self\",\n \"unwrapSol\": true,\n \"withInstructions\": false,\n \"withdrawAll\": true\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/close")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"clearOrders\": true,\n \"platform\": \"self\",\n \"unwrapSol\": true,\n \"withInstructions\": false,\n \"withdrawAll\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/maker/close")
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 \"clearOrders\": true,\n \"platform\": \"self\",\n \"unwrapSol\": true,\n \"withInstructions\": false,\n \"withdrawAll\": true\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
Close a maker book and reclaim rent. By default batches ClearBook + MakerWithdrawFunds(all) + CloseMakerBook in one tx. The book must end fully empty; opting a phase out while the book is non-empty on that dimension is rejected.
"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.
Include ClearBook (cancel all orders) before close.
Platform namespace for accountOwner. Ignored unless accountOwner is set.
self, treadfi Close the WSOL ATA after withdraw to unwrap to native SOL. 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.
Include MakerWithdrawFunds (drain all free+freed balance) before close.
Response
Unsigned close transaction.
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/close \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"clearOrders": true,
"platform": "self",
"unwrapSol": true,
"withInstructions": false,
"withdrawAll": true
}
'import requests
url = "https://api.archer.exchange/v1/maker/close"
payload = {
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"signer": "<string>",
"accountOwner": "<string>",
"clearOrders": True,
"platform": "self",
"unwrapSol": True,
"withInstructions": False,
"withdrawAll": True
}
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>',
clearOrders: true,
platform: 'self',
unwrapSol: true,
withInstructions: false,
withdrawAll: true
})
};
fetch('https://api.archer.exchange/v1/maker/close', 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/close",
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>',
'clearOrders' => true,
'platform' => 'self',
'unwrapSol' => true,
'withInstructions' => false,
'withdrawAll' => true
]),
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/close"
payload := strings.NewReader("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"clearOrders\": true,\n \"platform\": \"self\",\n \"unwrapSol\": true,\n \"withInstructions\": false,\n \"withdrawAll\": true\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/close")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"signer\": \"<string>\",\n \"accountOwner\": \"<string>\",\n \"clearOrders\": true,\n \"platform\": \"self\",\n \"unwrapSol\": true,\n \"withInstructions\": false,\n \"withdrawAll\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/maker/close")
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 \"clearOrders\": true,\n \"platform\": \"self\",\n \"unwrapSol\": true,\n \"withInstructions\": false,\n \"withdrawAll\": true\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>"
}