Skip to main content
POST
Swap collateral

Headers

User-Wallet
string
required

Base58 wallet of the acting user; the transaction is built for this wallet. Missing header returns 401

payer
string | null

Base58 wallet that pays transaction fees; defaults to the User-Wallet wallet when omitted

Transaction-Settings
string | null

Optional JSON-encoded transaction settings (priority-fee percentile, compute limits, simulation mode)

Idempotent-Key
string | null

Optional idempotency key; a retried write with the same key replays the original response

Body

application/json
depositCollateral
object[]
required
loan
string
required
withdrawCollateral
object[]
required
cpiIxs
object[]

Caller-supplied CPI instructions spliced into the built transaction.

cpiLuts
string[]
cpiSigners
string[]
setupIxs
object[]

Setup instructions run before the main instructions. Mirrors the principal.rs / flash_borrow shape so composite unwind paths (repay-with-collateral, full-repay-with-collateral) can route pandora's ATA CreateIdempotent ixs (via splitAtaCreates: true) into a dedicated setup tx that a Jito bundle can atomicize with the main tx.

setupLuts
string[]
setupSigners
string[]
unifySetup
boolean

When true, setup ixs are inlined into the main tx (legacy behavior). When false (default), setup becomes its own tx returned first in transactions[].

Response

Single versioned transaction message and signatures

expectedLoanInfo
object
required

Projected loan state after the transactions land.

transactions
object[]
required

Built, ready-to-sign versioned transactions.