Skip to main content
POST
Withdraw from a maker book

Authorizations

X-API-Key
string
header
required

Body

application/json

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

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.

baseAmount
string | null
Example:

"all"

platform
enum<string> | null
default:self

Platform namespace for accountOwner. Ignored unless accountOwner is set.

Available options:
self,
treadfi
quoteAmount
string | null
Example:

"50"

unwrapSol
boolean
default:false

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

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.

Response

Unsigned transaction built.

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.