Skip to content

Installation

Before you begin, ensure you have:

  • Bun >= 1.3.x

Three packages are provided that you can use independently or together:

  • @dicedhq/clob - TypeScript client for the CLOB (order book) API
  • @dicedhq/gamma - TypeScript client for the Gamma (market data) API
  • @dicedhq/polymarket - Polymarket client combining both CLOB and Gamma APIs

The unified client is recommended if you need access to both trading and market data APIs.

Terminal window
npm install @dicedhq/polymarket viem
  • Full access to CLOB API for trading operations
  • Full access to Gamma API for market data
  • Single initialization and configuration

Install only the APIs you need for smaller bundle sizes and more granular dependency management.

For trading operations on Polymarket’s order book:

Terminal window
npm install @dicedhq/clob viem

Features:

  • Create, list, and cancel orders
  • Query order book data
  • Manage positions and view trades
  • Order attribution

For read-only access to market data and events:

Terminal window
npm install @dicedhq/gamma

Features:

  • Query current markets and prices
  • Access events and sports information
  • Browse tags and categories