Skip to main content
POST
Close a maker book

Authorizations

X-API-Key
string
header
required

Body

application/json

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.

market
string
required
Example:

"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4"

signer
string
required

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.

accountOwner
string | null

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.

clearOrders
boolean
default:true

Include ClearBook (cancel all orders) before close.

platform
enum<string> | null
default:self

Platform namespace for accountOwner. Ignored unless accountOwner is set.

Available options:
self,
treadfi
unwrapSol
boolean
default:true

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).

withInstructions
boolean | null
default:false

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.

withdrawAll
boolean
default:true

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).

action
enum<string>
required
Available options:
deposit,
withdraw,
close
addressLookupTables
string[]
required
baseLots
integer<int64>
required

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.

expiresAt
integer<int64>
required
quoteLots
integer<int64>
required

Quote lots the action moves. Same conventions as baseLots.

transaction
string
required

Base64 unsigned VersionedTransaction.

instructions
object | null

Unsigned instructions, present only when the request set withInstructions.