Skip to main content

Overview

These open-source demo applications show how to integrate Polymarket’s CLOB Client and Builder Relayer Client for gasless trading with builder order attribution. Each demo covers:
  • User authentication via various wallet providers
  • Safe or Proxy wallet deployment
  • User API credential derivation
  • Token approvals (USDC.e + outcome tokens)
  • Order placement with builder attribution
  • Position and order management

Safe Wallet Examples

These demos deploy Gnosis Safe wallets for users:
ProviderWallet TypeRepository
wagmi (MetaMask, Phanton, Rabby, etc.)Safewagmi-safe-builder-example
PrivySafeprivy-safe-builder-example
Magic LinkSafemagic-safe-builder-example
TurnkeySafeturnkey-safe-builder-example

Proxy Wallet Example

For users who already have Magic Link accounts on Polymarket.com:
ProviderWallet TypeRepository
Magic LinkProxy (Non-Safe)magic-proxy-builder-example
The Magic Proxy example is for integrating with existing Polymarket.com Magic Link users who bring their private keys. This should not be used for new users.

Key Concepts Demonstrated

CLOB Client Initialization

  • L2 authentication (User API credentials)
  • Builder config with remote signing
  • Signature types for Safe vs Proxy wallets

Relayer Client Usage

  • Safe wallet deployment
  • Batch token approvals
  • CTF operations (redeem, split, merge)
  • Send transactions

Market Discovery

  • Gamma API for fetching markets
  • Data API for positions and activity

See Also