Skip to main content
The Partner API consists of seventeen endpoints that accept and return JSON, authenticated with a single bearer header. Any operation that changes on-chain state is carried out through a Solana transaction that Trench builds, signs with the user’s delegated wallet, and submits.

Hosts

The API host is not yet final. Please confirm it with the Trench team before going live.

Authentication

OAuth endpoints authenticate with your client_id and an API key over HTTP Basic, while everything under /partner/v1/ takes a user access token. Never send an API key on a Partner API call, since the access token already identifies your app.
The header is checked against the trench_at_ prefix before any lookup happens. See Tokens & Refresh for lifetimes and rotation. Every Partner API call also draws on your app’s tier budget, which is 120 requests per minute on Basic and 1,200 on Partner. The per-route limits below sit underneath it. See Rate Limits.

OAuth

These endpoints are keyed by IP at 30 requests per minute.

Reads

Read endpoints allow 300 requests per minute, keyed by access token. Governance reads require no scope, because proposals and tallies mirror public on-chain state.

Trades

Trade endpoints allow 60 requests per minute, and all three require trade:execute. Each one accepts two body shapes. Sending slippageBps has Trench quote the trade and derive the bound for you, while omitting it means supplying minTokensOut or minSolOut yourself. All three resolve the token’s venue per request, so the same call works on the bonding curve and on the Raydium pool it later migrates to. See Trade endpoints for field constraints.

Governance Votes

These endpoints allow 60 requests per minute, and all four require governance:vote. See Voting endpoints.

Governance Proposals

These endpoints allow 60 requests per minute, and all five require governance:propose. See Proposal endpoints.

Shared Conventions

Amounts

Every amount is an integer string in base units, using lamports for SOL and 1e6 units for tokens. See Amount Conventions.

Network Fees

Every write takes priorityFeeLamports with a minimum of 1,000 and tipLamports with a minimum of 1,000,000. Both are spent whether or not the operation succeeds.

Partner Fees

The three trade endpoints also accept an optional partnerFeeBps, which pays you a cut of the trade in the same transaction. See Partner Fees.

Write Responses

Every write returns a signature and a status.
The status vocabulary differs between the two families, with trades returning "submitted" and governance writes returning "processed". Neither indicates that the transaction is rooted, so we recommend confirming the signature against Solana through your own RPC rather than branching on the literal string.

Idempotency

No Partner API write accepts an idempotency key, which means a blind retry after a timeout can execute the same operation twice. Reconcile against the chain instead.

Errors

Every error is JSON with a stable error code, which is what you should match on rather than message. See Error Handling.

Request Size

The only endpoint that accepts a file is proposals/update-content, which takes at most one image.