All amounts are integer strings in base units.
Shared Fields
Every trade takes the following fields.Request Modes
Each endpoint accepts two body shapes, chosen by whetherslippageBps is present.
The two are mutually exclusive. Sending
slippageBps puts the request in slippage mode, and the explicit bound fields are then not read.
Venue Routing
Tokens trade on the Trench bonding curve until they migrate to a Raydium pool. All three endpoints resolve the venue per request, so the same call works before and after migration.POST /partner/v1/trades/buy
Spends up to a fixed amount of SOL.slippageBps with a bound you calculated.
POST /partner/v1/trades/buy-exact-out
Buys an exact token amount while capping what you spend.
In slippage mode the quote produces a ceiling, so
maxSolIn is optional. Sending it anyway applies whichever of the two values is lower, which lets you keep a hard spending limit regardless of what the quote returns.
POST /partner/v1/trades/sell
Response
All three endpoints respond identically.Partner Fees
Sending a non-zeropartnerFeeBps adds a SOL transfer to your registered fee wallet in the same transaction as the trade, which means the fee and the trade settle together. This requires the Partner tier.
The basis differs by endpoint, and rounding is always down.
In slippage mode the fee is deducted before the quote is taken, so the derived bound already accounts for it. In explicit mode you have to quote
minTokensOut against maxSolIn minus the fee yourself.Retries and Duplicate Trades
The Partner API does not support idempotency keys on any write endpoint. If a trade times out at the network level you cannot ask Trench whether it landed, and resending the request may execute the trade a second time, since nothing deduplicates two identical buys. A429, a 409 migration_pending, and a 409 pool_not_open are all safe to retry, because each is rejected before anything reaches the transaction builder.
Errors
The full catalog is on the Error Handling page.