Skip to main content

Overview

Connect to Polymarket Exchange’s Trading API using AWS PrivateLink for secure, private network connectivity. This guide walks you through setting up a VPC Endpoint connection for both pre-production and production environments.
Your AWS account must be whitelisted before you can establish a VPC connection. Contact Polymarket support to whitelist your account.

Prerequisites

  • An AWS account whitelisted by Polymarket
  • Appropriate permissions to create VPC Endpoints in AWS
  • Subnets in the required Availability Zones (see below)

1. Account and Environment Setup

We recommend using separate AWS accounts for pre-production and production environments to maintain clear isolation.
  • By default, your whitelisted AWS account has access to Preprod only
  • When ready for production, provide Polymarket with your production AWS Account ID for whitelisting

2. Create VPC Endpoint

Navigate to the AWS Console and create a new VPC Endpoint using the appropriate VPC Service Name:
EnvironmentVPC Service Name
Preprodcom.amazonaws.vpce.us-east-1.vpce-svc-0ab4dc57271d74d3e
Prodcom.amazonaws.vpce.us-east-1.vpce-svc-0cb1220f882b3879e

Availability Zone Requirements

Ensure at least one of your subnets is located in the following Availability Zone IDs: Production:
  • use1-az1
  • use1-az2
  • use1-az6
Pre-Production:
  • use1-az1
  • use1-az2
  • use1-az4
AWS randomly maps Availability Zones to physical Zone IDs per account. Verify that the Zone IDs match your account’s mapping. Learn more in the AWS Availability Zones documentation.

Connection Approval

After creating the VPC Endpoint, a connection request is sent to Polymarket’s DevOps team. They will review and accept the request, then notify you once approved.
You cannot proceed with DNS configuration or API connection until Polymarket accepts the connection request.
After the connection is accepted, we recommend enabling Private DNS for the endpoint (optional but encouraged). When Private DNS is enabled, the following DNS names resolve to private IP addresses assigned to your VPC Endpoint, routing all traffic over the private AWS network:
EnvironmentPrivate DNS Name
Preprodtraderapi.us-east-1.privatelink.preprod.polymarketexchange.com
Prodtraderapi.us-east-1.privatelink.prod.polymarketexchange.com

4. Making API Calls

We recommend creating CNAME aliases via a Route53 Private Hosted Zone. This eliminates the need for custom headers and simplifies client configuration for both REST and gRPC. Required CNAME records:
EnvironmentCNAME AliasTarget (Your VPC Endpoint)
Preprodrest.preprod.polymarketexchange.comYour VPC Endpoint DNS
Preprodtraderapi.preprod.polymarketexchange.comYour VPC Endpoint DNS
Prodrest.prod.polymarketexchange.comYour VPC Endpoint DNS
Prodtraderapi.prod.polymarketexchange.comYour VPC Endpoint DNS
You need two CNAME records per environment: rest.* for the REST API and traderapi.* for gRPC.
With CNAME configured, API calls work without header overrides: REST Example:
curl -X POST "https://rest.preprod.polymarketexchange.com/api/v1beta1/get_who_am_i" \
  -H "Authorization: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{}"
gRPC Example:
grpcurl traderapi.preprod.polymarketexchange.com:443 list

Alternative: Manual Header Overrides

If you don’t use CNAME aliases, you must set the appropriate header on every request.

REST API: Host Header

EnvironmentPrivateLink URLHost Header
Preprodtraderapi.us-east-1.privatelink.preprod.polymarketexchange.comrest.preprod.polymarketexchange.com
Prodtraderapi.us-east-1.privatelink.prod.polymarketexchange.comrest.prod.polymarketexchange.com
curl -X POST "https://traderapi.us-east-1.privatelink.preprod.polymarketexchange.com/api/v1beta1/get_who_am_i" \
  -H "Host: rest.preprod.polymarketexchange.com" \
  -H "Authorization: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{}"

gRPC API: Authority Header

EnvironmentPrivateLink URLAuthority Header
Preprodtraderapi.us-east-1.privatelink.preprod.polymarketexchange.comtraderapi.preprod.polymarketexchange.com
Prodtraderapi.us-east-1.privatelink.prod.polymarketexchange.comtraderapi.prod.polymarketexchange.com
grpcurl -authority traderapi.preprod.polymarketexchange.com \
  traderapi.us-east-1.privatelink.preprod.polymarketexchange.com:443 list

Troubleshooting

If your connection request hasn’t been accepted after 24 hours, contact Polymarket support with your VPC Endpoint ID.
Verify that Private DNS is enabled for your VPC Endpoint and that your subnets are in the correct Availability Zones.
Ensure your security groups and network ACLs allow outbound HTTPS (443) traffic to the VPC Endpoint.