Overview
The Relayer Client routes onchain transactions through Polymarket’s infrastructure, providing gasless transactions for your users. Builder authentication is required to access the relayer.Gasless Transactions
Polymarket pays all gas fees
Wallet Deployment
Deploy Safe or Proxy wallets
CTF Operations
Split, merge, and redeem positions
Builder API Credentials
Each builder receives API credentials from their Builder Profile:| Credential | Description |
|---|---|
key | Your builder API key identifier |
secret | Secret key for signing requests |
passphrase | Additional authentication passphrase |
Installation
Relayer Endpoint
All relayer requests are sent to Polymarket’s relayer service on Polygon:Signing Methods
- Remote Signing (Recommended)
- Local Signing
Remote signing keeps your credentials secure on a server you control.How it works:
- Client sends request details to your signing server
- Your server generates the HMAC signature
- Client attaches headers and sends to relayer
Server Implementation
Your signing server receives request details and returns the authentication headers:Client Configuration
Point your client to your signing server:Authentication Headers
The SDK automatically generates and attaches these headers to each request:| Header | Description |
|---|---|
POLY_BUILDER_API_KEY | Your builder API key |
POLY_BUILDER_TIMESTAMP | Unix timestamp of signature creation |
POLY_BUILDER_PASSPHRASE | Your builder passphrase |
POLY_BUILDER_SIGNATURE | HMAC signature of the request |
With local signing, the SDK constructs and attaches these headers automatically. With remote signing, your server must return these headers (see Server Implementation above), and the SDK attaches them to the request.
Wallet Types
Choose your wallet type before using the relayer:- Safe Wallets
- Proxy Wallets
Gnosis Safe-based proxy wallets that require explicit deployment before use.
- Best for: Most builder integrations
- Deployment: Call
client.deploy()before first transaction - Gas fees: Paid by Polymarket
Wallet Comparison Table
Wallet Comparison Table
| Feature | Safe Wallets | Proxy Wallets |
|---|---|---|
| Deployment | Explicit deploy() | Auto-deploy on first tx |
| Gas Fees | Polymarket pays | Polymarket pays |
| ERC20 Approvals | ✅ | ✅ |
| CTF Operations | ✅ | ✅ |
| Send Transactions | ✅ | ✅ |
Usage
Deploy a Wallet
For Safe wallets, deploy before executing transactions:Execute Transactions
Theexecute method sends transactions through the relayer. Pass an array of transactions to batch multiple operations in a single call.
Transaction Examples
- Transfer
- Approve
- Redeem Positions
- Split Positions
- Merge Positions
- Batch Transactions
Transfer tokens to any address (e.g., withdrawals):
Reference
Contracts & Approvals
| Contract | Address | USDCe | Outcome Tokens |
|---|---|---|---|
| USDCe | 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 | — | — |
| CTF | 0x4d97dcd97ec945f40cf65f87097ace5ea0476045 | ✅ | — |
| CTF Exchange | 0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E | ✅ | ✅ |
| Neg Risk CTF Exchange | 0xC5d563A36AE78145C45a50134d48A1215220f80a | ✅ | ✅ |
| Neg Risk Adapter | 0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296 | — | ✅ |
Transaction States
| State | Description |
|---|---|
STATE_NEW | Transaction received by relayer |
STATE_EXECUTED | Transaction executed onchain |
STATE_MINED | Transaction included in a block |
STATE_CONFIRMED | Transaction confirmed (final ✅) |
STATE_FAILED | Transaction failed (terminal ❌) |
STATE_INVALID | Transaction rejected as invalid (terminal ❌) |
TypeScript Types
View Type Definitions
View Type Definitions