Polymarket relayer explained: how Polymarket's gasless model works
A developer-focused deep dive into Polymarket's gasless architecture. Learn how the Relayer sponsors transactions, wallet deployment, approvals, CTF ops, and order routing.
Polymarket relayer explained: how Polymarket's gasless model works
Polymarket relayer explained: the Relayer is the gas-station layer that sponsors every on-chain user action so traders never pay gas. This guide walks developers and curious users through the Relayer's responsibilities, the developer-facing SDKs, typical transaction flows (wallet deployment, ERC-20 approvals, CTF split/merge/redeem, transfers, and order placement), and operational limits you need to build robust tooling.
Key takeaways
- The Relayer is a gas-station network layer that sponsors Polygon PoS transactions so users transact gaslessly with pUSD.
- Common flows covered by the Relayer: Proxy wallet deployment, ERC‑20 approvals, CTF split/merge/redeem, transfers, and CLOB order placement.
- There are API surfaces and SDKs you should use: the Relayer Client SDK (TypeScript/Python) and the three public REST APIs for market and data reads.
- Builders can route orders through Polymarket with attribution and earn builder fees; tiered limits apply.
- Always design for non-deterministic execution: UMA resolution disputes, slippage, partial fills, and settlement timing remain operational risks.
Why the Relayer exists
Polymarket runs on Polygon PoS (chain ID 137) and uses pUSD (Polymarket's wrapped USDC) as the settlement asset. The Relayer sponsors gas so end users never hold POL or pay gas for on-chain operations. That removes a user-friction layer and lets trading feel native for wallets like MetaMask, Phantom, Rabby, Bitget, OKX, Coinbase and any EIP-6963-compatible wallet.
High-level architecture
The Relayer acts as a Gas Station Network (GSN) — it accepts signed user intents off-chain, wraps them into sponsored transactions, and submits those transactions on Polygon. From a developer point of view, you interact with two classes of interfaces:
- Public read APIs and a WebSocket for market and book data (Gamma, Data, CLOB, and the Market WS). See the exact base URLs below.
- The Relayer Client SDK (TypeScript and Python) that handles wallet deployment, approvals, CTF operations, and order placement with the sponsored flow.
Important public endpoints and surfaces
- Gamma API (markets, events, tags): https://gamma-api.polymarket.com
- Data API (positions, trades, holders, open interest): https://data-api.polymarket.com
- CLOB API (order book and trading): https://clob.polymarket.com — note trading requires API key + HMAC for builders; reads are public
- Market WebSocket (real-time book): wss://ws-subscriptions-clob.polymarket.com/ws/market
Exact API usage and rate limits are documented by Polymarket; use the Gamma /markets endpoint for market listings (limit up to 1000, use after_cursor for pagination).
Common sponsored flows (developer view)
- Wallet deployment
Polymarket supports Gnosis Safe (pre-deployed) and Proxy wallets (auto-deployed on first transaction). The Relayer pays the gas cost for proxy deployment when you perform your first sponsored action. From the SDK this is usually automatic: the SDK detects no wallet and asks the Relayer to submit a deployment tx signed by the user.
- ERC-20 approvals
Users trade exclusively with pUSD. The Relayer-sponsored approval flow submits ERC-20 approvals (and associated allowances) on behalf of the user so they can interact with the CTF and Exchange contracts without holding POL. The SDK usually batches and manages approvals to reduce friction.
- CTF operations: split / merge / redeem
Outcome shares are ERC-1155 tokens minted via the Gnosis Conditional Token Framework (CTF). Typical CTF operations — split (mint a complete set from $1.00 of pUSD), merge (burn a set back to pUSD), and redeem (burn winning tokens for $1.00 after resolution) — are all supported through the Relayer. These on-chain interactions are submitted as sponsored transactions by the Relayer.
- Transfers and withdrawals
Transfers of outcome tokens and pUSD, as well as any explicit withdrawal steps, are executed through Relayer-backed transactions so users can move funds without paying gas. Keep UX signals for pending relayed transactions — they are on-chain but may be observable later via the Data API.
- Order placement on the CLOB
Order placement (limit or market/FAK orders) is routed through the CLOB. Builders that route orders use API keys + HMAC for authenticated trading with attribution headers. The Relayer Client SDK integrates order creation and, when appropriate, handles FAK semantics for market orders. Maker fees are zero; taker fees vary by category.
Builder program and attribution
Third parties can route orders through the CLOB and earn builder fees credited in basis points. Tiers include Unverified (daily relayer limit 100), Verified (daily limit 10,000 and weekly USDC rewards), and Partner (unlimited). Builder credentials are obtained at https://polymarket.com/settings and the Relayer Client SDK implements the authentication and attribution headers required to participate.
Practical developer concerns
- Idempotency and retries: Because the Relayer submits on-chain transactions for you, design idempotent flows and robust retry logic. The SDK helps but your backend should de-dupe signed intents.
- UX for pending state: Show clear pending/cancelled/confirmed states. Relayed transactions are real blockchain transactions; use the Data API and Market WS to reflect finality.
- Rate limits: Gamma's /markets endpoint is rate limited (300 req / 10 s for /markets; combined /markets + /events listing limit 900 req / 10 s). Overall API limit is 4000 req / 10 s. Respect these in polling or indexing jobs.
- Security: The Relayer signs and submits transactions using its infrastructure. Do not assume private-key custody; your app should still require user signatures for intents.
- Geo restrictions: Polymarket geo-blocks orders by IP. Your application must respect these restrictions; do not advise VPN workarounds.
Testing and local development
Polymarket provides client SDKs in TypeScript and Python. Use the SDK to mock sponsored flows during development. For market reads use the Gamma, Data, and CLOB public endpoints and the Market WS for real-time feeds. Remember the WebSocket emits a PING every 10 seconds and supports up to 500 instruments per connection.
Operational limits and edge cases
- Tick size changes: Tick size tightens from $0.01 to $0.001 near extreme prices; the WebSocket emits tick_size_change events. Your matching and price-display logic must handle this.
- UMA disputes and resolution delays: The Relayer cannot eliminate oracle or resolution risk. UMA disputes can pause settlement; plan UX for delayed redemption.
- Fees and economics: Makers are zero-fee; taker fees vary by category (0%–1.8%). The Relayer does not change market fee economics.
How this affects your trading tools and bots
If you build tools that execute on Polymarket, rely on the Relayer Client SDK for user flows and reserves server-side processes for signing, idempotency, and attribution header management for builders. Use the public APIs for market data and the Market WS for low-latency book updates. Account for non-deterministic outcomes (slippage, partial fills, resolution delays) and surface these clearly in your UI.
Closing
The Polymarket relayer explained: it's the operational layer that makes Polymarket feel gasless. For developers it centralises wallet deployment, approvals, CTF ops, transfers, and order submission behind an SDK and sponsored transaction flow. Use the public APIs and the Relayer Client SDK to build predictable, user-friendly trading experiences while respecting rate limits and geo restrictions.
Further reading
- Developer-focused guides: /guides/polymarket-clob-explained, /guides/polymarket-gasless-trading
- Arbitrage reference: /guides/polymarket-arbitrage-complete-guide
Frequently asked questions
What exactly does the Polymarket Relayer sponsor?
The Relayer sponsors on-chain gas for user-facing operations on Polygon PoS, including Proxy wallet deployment, ERC‑20 approvals for pUSD, CTF split/merge/redeem, token transfers, and order placement on the CLOB. The Relayer effectively wraps user-signed intents into sponsored transactions submitted to Polygon.
Do I still need pUSD to trade if gas is sponsored?
Yes. Polymarket uses pUSD (Polymarket's wrapped USDC) as the settlement currency. The Relayer only sponsors gas; you still need sufficient pUSD balance and any necessary approvals to interact with markets.
Can builders route orders through the Relayer and earn fees?
Yes. The Builder Program lets third parties route orders through the CLOB with attribution headers and earn builder fees in basis points. Tiers (Unverified, Verified, Partner) impose daily relayer limits and different rewards. Builder credentials are managed at https://polymarket.com/settings.
Where do I get market data and real-time book updates?
Use the public REST APIs and WebSocket: Gamma (https://gamma-api.polymarket.com) for markets, Data (https://data-api.polymarket.com) for positions and trades, CLOB (https://clob.polymarket.com) for order-book reads, and the Market WS (wss://ws-subscriptions-clob.polymarket.com/ws/market) for real-time book events.
What operational risks remain even with the Relayer?
Sponsored gas removes the need to hold POL, but other risks remain: UMA resolution disputes that delay settlement, slippage and partial fills on the CLOB, fee structure changes by Polymarket, smart-contract risk, and geo-restrictions that block orders by IP.
Istilah dirujuk
Panduan berkaitan
Untuk tujuan pendidikan sahaja. Bukan nasihat kewangan, undang-undang atau cukai. Polymarket mungkin tidak tersedia di bidang kuasa anda.