
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@dschz/polymarket-clob-client
Advanced tools
Fork of Polymarket CLOB Client with optimized bundle size and enhanced Web3 integration
Typescript client for the Polymarket Central Limit Order Book (CLOB) API.
This fork provides several key improvements over the original:
createSignerForProvider that provide seamless integration with native EIP-1193 providers (MetaMask, WalletConnect, etc.) without requiring additional adapter libraries.npm install @dschz/polymarket-clob-client
pnpm install @dschz/polymarket-clob-client
yarn install @dschz/polymarket-clob-client
bun install @dschz/polymarket-clob-client
Node v18.0+ is required as this library uses native fetch APIs under the hood.
As of this writing (Nov. 2025), I would recommend using the latest Node v24.11.0+ LTS which will receive maintenance and updates until April 2028.
When bundling with Vite, you'll need to add Node.js polyfills for cryptographic operations and event handling. The library's underlying dependencies (ethers, crypto libraries) require buffer and events polyfills to function properly in browser environments. Install the required polyfills:
npm install buffer events
pnpm install buffer events
yarn install buffer events
bun install buffer events
Then update your vite.config.ts to help the dev server reference the buffer polyfill:
import { defineConfig } from "vite";
export default defineConfig({
// When running your Vite dev server, you may see browser warnings regarding Buffer.
// The optimizeDeps and resolve aliases for buffer should take care of them
optimizeDeps: {
include: ["buffer"],
},
resolve: {
conditions: ["development", "browser"],
alias: {
buffer: "buffer/",
"node:buffer": "buffer/",
},
},
});
💡 When creating a ClobClient instance, the following defaults are used for unspecified parameters:
"https://clob.polymarket.com" (Polymarket production API)137 (Polygon mainnet)0 (EOA - Externally Owned Account)signer address when not providedThis means you can create a minimal, read-only client with just new ClobClient() which will hit Polygon mainnet. If you want to place trades on mainnet, then you need to configure both signer and creds via new ClobClient({ signer, creds }) which you can see the examples configure below.
The CLOB client supports various wallet providers in web browsers. Use the createSignerForProvider utility to create a signer from any EIP-1193 compatible provider:
import {
ClobClient,
createSignerForProvider,
OrderType,
Side,
} from "@dschz/polymarket-clob-client";
// Example 1: MetaMask
if (window.ethereum) {
// Pass any object conforming to the EIP-1193 provider spec
const signer = createSignerForProvider(window.ethereum);
// Get API key derived from signer for Polygon mainnet
const creds = await new ClobClient({ signer }).createOrDeriveApiKey();
// Defaults to Polygon mainnet, signer funderAddress, signature type 0 for EOA
const clobClient = new ClobClient({ signer, creds });
// Place an order
const order = await clobClient.createAndPostOrder(
{
tokenID: "your-token-id",
price: 0.6,
side: Side.BUY,
size: 10,
},
{ tickSize: "0.01", negRisk: false },
OrderType.GTC,
);
}
Works seamlessly with Privy embedded wallets:
import { usePrivy } from "@privy-io/react-auth";
import { ClobClient, createSignerForProvider } from "@dschz/polymarket-clob-client";
function TradingComponent() {
const { authenticated, getEthereumProvider } = usePrivy();
if (authenticated) {
const provider = await getEthereumProvider();
const signer = createSignerForProvider(provider);
const creds = await new ClobClient({ signer }).createOrDeriveApiKey();
const clobClient = new ClobClient({ signer, creds });
// Use clobClient for trading...
}
}
For server-side or Node.js applications with private keys:
import { ClobClient, OrderType, Side } from "@dschz/polymarket-clob-client";
import { Wallet } from "@ethersproject/wallet";
const funder = "0x..."; // Your Polymarket Profile Address
const signer = new Wallet("your-private-key"); // Your private key
const creds = await new ClobClient({ signer }).createOrDeriveApiKey();
const clobClient = new ClobClient({
signer,
creds,
signatureType: 1,
funderAddress: funder,
});
const order = await clobClient.createAndPostOrder(
{
tokenID: "your-token-id",
price: 0.01,
side: Side.BUY,
size: 5,
},
{ tickSize: "0.001", negRisk: false },
OrderType.GTC,
);
0: Browser Wallet (MetaMask, Coinbase Wallet, WalletConnect, etc.)1: Magic/Email Login or Server-side private key signingSee examples for more information
FAQs
Fork of Polymarket CLOB Client with optimized bundle size and enhanced Web3 integration
The npm package @dschz/polymarket-clob-client receives a total of 16 weekly downloads. As such, @dschz/polymarket-clob-client popularity was classified as not popular.
We found that @dschz/polymarket-clob-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.