Installation
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- Bun >= 1.3.x
Choose Your Package
Section titled “Choose Your Package”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
Polymarket Client
Section titled “Polymarket Client”The unified client is recommended if you need access to both trading and market data APIs.
npm install @dicedhq/polymarket viemyarn add @dicedhq/polymarket viempnpm add @dicedhq/polymarket viembun add @dicedhq/polymarket viemWhat’s Included
Section titled “What’s Included”- Full access to CLOB API for trading operations
- Full access to Gamma API for market data
- Single initialization and configuration
Individual Packages
Section titled “Individual Packages”Install only the APIs you need for smaller bundle sizes and more granular dependency management.
CLOB Client
Section titled “CLOB Client”For trading operations on Polymarket’s order book:
npm install @dicedhq/clob viemyarn add @dicedhq/clob viempnpm add @dicedhq/clob viembun add @dicedhq/clob viemFeatures:
- Create, list, and cancel orders
- Query order book data
- Manage positions and view trades
- Order attribution
Gamma Client
Section titled “Gamma Client”For read-only access to market data and events:
npm install @dicedhq/gammayarn add @dicedhq/gammapnpm add @dicedhq/gammabun add @dicedhq/gammaFeatures:
- Query current markets and prices
- Access events and sports information
- Browse tags and categories
Next Steps
Section titled “Next Steps”- Getting Started Guide - Initialize clients and make your first API call
- CLOB API Reference - Learn about trading operations
- Gamma API Reference - Explore market data APIs
- Examples - View complete code examples