Skip to content

Relayer API

Production Relayer API: https://relayer-v2.polymarket.com.

The relayer submits gas-sponsored transactions for Polymarket smart wallets. In polygolem it is used for deposit-wallet deploys and wallet batches such as trading approvals, adapter approvals, and V2 redeem calls.

Auth Modes

ModeHeadersPolygolem entry pointUse
Relayer API Key V2RELAYER_API_KEY, RELAYER_API_KEY_ADDRESSpkg/relayer.NewV2Preferred relayer auth for headless onboarding
Legacy builder HMACPOLY_BUILDER_API_KEY, POLY_BUILDER_TIMESTAMP, POLY_BUILDER_PASSPHRASE, POLY_BUILDER_SIGNATUREpkg/relayer.NewCompatibility path
SIWE cookiesBrowser/session cookiesinternal/relayer.MintV2APIKeyOnly for minting a V2 relayer API key

Relayer credentials are not CLOB L2 credentials. They cannot place orders, cancel orders, or read authenticated CLOB account data.

REST Mapping

Polygolem methodREST pathAuthNotes
MintV2APIKeyPOST /relayer/api/authSIWE session cookiesMints { apiKey, address, createdAt } for relayer header auth
SubmitWalletCreatePOST /submitRelayer API key or builder HMACBody type WALLET-CREATE; deploys a deposit wallet through DepositWalletFactory
SubmitWalletBatchPOST /submitRelayer API key or builder HMACBody type WALLET; submits a signed deposit-wallet batch
GetNonceGET /nonce?address=owner_address&type=WALLETRelayer API key or builder HMACCurrent WALLET nonce for the owner
GetTransactionGET /transaction?id=tx_idRelayer API key or builder HMACPolls a single relayer transaction; polygolem accepts object or array responses
PollTransactionGET /transaction?id=tx_id loopRelayer API key or builder HMACStops on terminal relayer states
IsDeployedGET /deployed?address=owner_addressRelayer API key or builder HMACRelayer/indexer deployment view, not chain truth
Not wrappedGET /transactionsRelayer API key or builder HMACUpstream recent-transaction list
Not wrapped`GET /relay-payload?address=owner_address&type=SAFEPROXY`Public
Not wrappedGET /relayer/api/keysGamma auth or relayer API keyLists relayer API keys when account auth allows it

Deposit-Wallet Transaction Flow

  1. Derive the deterministic deposit wallet address locally from the owner EOA.
  2. Check GET /deployed?address=owner_address for the relayer/indexer view.
  3. Check Polygon eth_getCode(deposit_wallet); bytecode wins for CLOB POLY_1271 readiness.
  4. Submit WALLET-CREATE through POST /submit if no code exists.
  5. Fetch GET /nonce?address=owner_address&type=WALLET.
  6. Sign an EIP-712 deposit-wallet batch with the owner EOA.
  7. Submit the signed WALLET batch through POST /submit.
  8. Poll GET /transaction?id=tx_id until STATE_CONFIRMED or another terminal state.

Transaction Types

TypePolygolem statusPurpose
WALLET-CREATESupportedDeploy a deposit wallet
WALLETSupportedExecute deposit-wallet calls through the factory
SAFENot a deposit-wallet flowLegacy smart wallet transaction type
PROXYNot a deposit-wallet flowLegacy proxy wallet transaction type

Safety Boundaries

  • A relayer transaction is gas-sponsored, but still executes against Polygon contracts. Treat submitted calldata as live money movement.
  • DepositWalletFactory.deploy and DepositWalletFactory.proxy are operator-gated. Direct EOA calls are not a safe fallback.
  • If /deployed is false but Polygon bytecode exists at the derived deposit wallet, the wallet is deployed for CLOB POLY_1271 order validation.
  • If the relayer rejects a WALLET batch as not allowlisted, verify the target contracts against the current Polymarket contract registry before retrying.