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