Skip to main content
A partner authority lets an approved partner build and send Trench trades without using the Partner API. The same partner authority can sign trades for many user wallets. It is not tied to one user.

Set up

  1. Create a new Solana keypair on your backend.
  2. Send only the public key to Trench.
  3. Trench adds the public key to the onchain Config whitelist.
  4. Wait for Trench to confirm that the public key is ready.
Use the active Trench program ID that Trench gives you.

Build a trade

Use the Trench IDL to build the existing trade instructions. Set authority to your approved partner public key. Use one address from Config.fee_addresses for protocol_fee_recipient. Both the user signer and the authority signer must sign the same transaction.

Referral accounts

Every trade must include the writable trader_referral account meta from the IDL. Derive it with the user signer. Use buyer for buys and seller for sells.
Do not initialize this PDA. Include its address as trader_referral and do not add any remaining referral accounts.

Claim cashback

Build claim_trader_cashback from the IDL. Only the trader is a signer. This instruction does not use authority.