Skip to main content
Trench is a token launchpad on Solana. The Partner API lets your users connect their Trench account to your application so that you can buy, sell, and vote on token governance from inside your own product. Your application never holds or handles user keys. Trench builds each transaction and signs it with the user’s delegated wallet once they have approved your app. On the Partner tier you can also take a cut of every trade you route, paid to a wallet you register with Trench in the same transaction as the trade. See Partner Fees.

Getting Started

Authentication uses OAuth 2.0 Authorization Code with PKCE, so if you have implemented “Sign in with Google” before, the flow will look familiar.
1

Register your app

Sign in at tren.ch/partner, name your app, set a redirect URI, and pick your scopes. You get a client_id and an API key straight away, with no review step. See Registration for details.
2

Connect a user

Open the consent popup, then exchange the authorization code it returns for a token pair on your backend. See Connect a User.
3

Call the API

Send the access token as a bearer header on every request to /partner/v1/*.

Base URLs

  • Consent screen: https://tren.ch
  • API: https://api.tren.ch
The API host is not yet final. Please confirm it with the Trench team before going live.

Authentication

Every Partner API call takes a single header. You do not need to send your API key, the user’s wallet address, or sign anything yourself.
Access tokens are issued per user rather than per application, so every user who connects gets their own pair, which you store against your own user record.

Credentials

When an access token expires, your backend can refresh it silently. Each refresh mints a new 60-day refresh token, which means an actively used connection will never force the user to reconnect.

Scopes

Request only the scopes your integration needs. Each one is shown to the user on the consent screen, and high-risk scopes are flagged. Governance reads do not require a scope, because proposals and tallies mirror public on-chain state. Three further scopes exist in the registry but are hidden, and cannot be selected when you register. See Scopes.

Rate Limits

Your app has a budget across all Partner API endpoints, and individual routes carry their own per-user limits underneath it.
  • Tier budget: 120 requests per minute on Basic, 1,200 on Partner
  • Reads: 300 requests per minute, per user
  • Writes: 60 requests per minute, per user
  • OAuth: 30 requests per minute, per IP
The tier budget is shared across your whole user base, so it is usually the limit you meet first. See Rate Limits.

Core Principles

Registration

Self-serve registration, tiers, API keys, and redirect URIs.

Scopes

What each scope grants and which endpoints it gates.

Tokens & Refresh

Lifetimes, rotation, and the reuse rules that end a connection.

Amount Conventions

Lamports, base units, and fee minimums.

Error Handling

Stable error codes and which ones are worth retrying.

Rate Limits

Your tier budget, the per-endpoint limits, and how buckets are keyed.

Partner Fees

Charge your own rate per trade and get paid on-chain.

Security Requirements

PKCE, state, and refresh token handling before you ship.

Guides

Quickstart

From registering an app to a confirmed buy.

Connect a User

PKCE, the popup, your callback, and the code exchange.

Trade Tokens

Buy, sell, set slippage, and confirm the fill.

API Reference

Every endpoint, parameter, and response.

Before You Ship

We recommend reading Security Requirements before going to production. It covers the handling of PKCE, state, and refresh tokens, which are the areas where mistakes are most likely to affect user funds.