Skip to main content

Overview

Goldsky provides high-performance data infrastructure for Polymarket, making it easy to extract, transform, and load on-chain data to power both application and analytics use cases via Turbo Pipelines (real-time data replication pipelines). Polymarket is the world’s largest prediction market platform, enabling users to trade on the outcome of real-world events. Built on Polygon, Polymarket processes millions of trades and provides deep liquidity for markets spanning politics, sports, economics, and more.

Public Polymarket subgraphs

Goldsky provides public access to Polymarket subgraphs via GraphQL APIs. These endpoints are available at:
https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/<subgraph_name>/<subgraph_version>/gn
For example:
  • https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/orderbook-subgraph/0.0.1/gn
  • https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/oi-subgraph/0.0.6/gn

Rate limits

These public subgraphs have a rate limit of 100 requests per second per IP (1,000 requests per 10 seconds). If you exceed this limit, you’ll receive the following error:
Sorry, you've surpassed your query allowance.
Please try again - limits reset every 10 seconds.

Higher frequency consumption

If you need higher frequency data consumption, we don’t recommend deploying these subgraphs from source. Polymarket subgraphs tend to become very heavy quickly in terms of entities stored hours, which is a key variable in our billing system. Instead, we recommend deploying Turbo Pipelines using Polymarket datasets, which provide real-time streaming with better cost efficiency. See the sections below for details.

Benefits

Goldsky’s Polymarket integration enables:
  • Real-time market monitoring - Track order fills, matched orders, and position changes as they happen
  • Analytics and insights - Build dashboards showing open interest, trading volume, and market trends
  • User position tracking - Monitor individual user balances and positions with PnL data
  • Trading activity analysis - Analyze granular order flow and market maker activity
  • Custom alerts - Set up webhooks for specific market events or trading patterns

Getting started

To use Goldsky, you’ll need to create an account, install the CLI, and log in.
  1. Install the Goldsky CLI: For macOS/Linux:
    curl https://goldsky.com | sh
    
    For Windows:
    npm install -g @goldskycom/cli
    
    Windows users need to have Node.js and npm installed first. Download from nodejs.org if not already installed.
  2. Go to your Project Settings page and create an API key.
  3. Back in your Goldsky CLI, log into your Project by running the command goldsky login and paste your API key.
  4. Now that you are logged in, run goldsky to get started:
    goldsky
    

Turbo Pipelines

Turbo pipelines allow users to replicate data into their own infrastructure (any of the supported sinks) in real time. For a complete overview of how to deploy Turbo pipelines, including a video walkthrough, check the Quickstart guide.

Working with Polymarket datasets

Goldsky provides real-time streaming of Polymarket datasets, including all historical data. The following datasets are currently available:
DatasetDescription
Order Filled (recommended)Emitted when a single Polymarket order is partially or completely filled. For example: a 50¢ YES buy for 100 YES matched against a 50¢ YES sell for 100 YES will emit 2 Order Filled events, from the perspective of the YES buy and of the YES sell. This is useful for granular tracking of trading activity and history.
Orders MatchedEmitted when a Polymarket taker order is matched against a set of Polymarket maker (limit) orders. For example: a 50¢ YES buy for 200 YES matched against 2 50¢ YES sells for 100 YES each will emit a single Orders Matched event. Orders Matched gives a more high-level view of trading activity as it only tracks taker activity.
User BalancesKeeps track of all user outcome token positions.
User PositionsKeeps track of outcome token positions along with PnL-specific data including average price and realized PnL.
These datasets can be used as sources in your Turbo pipelines to stream Polymarket data to any of the supported sinks.

Deploying Polymarket pipelines

Turbo pipelines are defined using YAML configuration files and deployed via the Goldsky CLI. Here’s the workflow:
  1. Create a pipeline configuration file - Define your sources, transforms, and sinks in a YAML file
  2. Validate your configuration - Run goldsky turbo validate polymarket-pipeline.yaml to check for errors
  3. Deploy the pipeline - Run goldsky turbo apply polymarket-pipeline.yaml to deploy
  4. Monitor your pipeline - Use goldsky turbo logs polymarket-pipeline.yaml to view logs and goldsky turbo inspect polymarket-pipeline.yaml to see live data
For a complete walkthrough, see the Turbo Pipelines Quickstart.
Remember to first create a Secret in order for Turbo Pipelines to be able to write the data into the database of your choice. For webhook sinks, you can include authentication headers directly in the configuration.

Example pipeline configuration

Here’s an example configuration file for streaming Polymarket order fills to a webhook endpoint:
polymarket-orders-webhook.yaml
name: polymarket-orders-webhook
resource_size: s

sources:
  polymarket_orders:
    type: dataset
    dataset_name: polymarket.order_filled
    version: 1.1.0

transforms:
  high_value_orders:
    type: sql
    primary_key: id
    sql: |
      SELECT 
        id,
        market_id,
        user_address,
        side,
        price,
        size,
        timestamp
      FROM polymarket_orders
      WHERE CAST(size AS DECIMAL) > 1000

sinks:
  webhook_alerts:
    type: webhook
    from: high_value_orders
    url: https://api.example.com/polymarket/orders
    one_row_per_request: true
    headers:
      Authorization: Bearer YOUR_API_TOKEN
      Content-Type: application/json
This pipeline:
  1. Streams all Order Filled events from Polymarket
  2. Filters for high-value orders (size > 1000)
  3. Sends each order individually to your webhook endpoint with authentication
Deploy the pipeline by running:
goldsky turbo apply polymarket-orders-webhook.yaml
Note: The datasets output large amounts of data. E.g. user positions may be up to 1.2B entities to backfill, and up to 150M entities monthly to maintain. Unlike standard indexed datasets that have a block column, these datasets are from a subgraph and instead rely on a block_range column that is formatted as[block_start, block_end) , where block_end is empty if the subgraph data is not historical. For example, [824824,) and [824824, 824825) . To filter out historical values you can use a query such as
TRY_CAST(regexp_extract(d.block_range, ',([0-9]+)', 1) AS BIGINT) IS NULL
To filter for all data after a particular block you can use
TRY_CAST(regexp_extract(block_range, '([0-9]+),', 1) AS BIGINT) > 82477558
For insights on costs for datasets, please refer to our pricing calculator.

Getting support

Can’t find what you’re looking for? Reach out to us at support@goldsky.com for help.