Retrieves metadata for various sports including images, resolution sources, ordering preferences, tags, and series information. This endpoint provides comprehensive sport configuration data used throughout the platform.
Welcome to the Polymarket Changelog. Here you will find any important changes to Polymarket, including but not limited to CLOB, API, UI and Mobile Applications.
<Update label="Sept 24, 2025" description="Polymarket Real-Time Data Socket (RTDS) official release">
* **Crypto Price Feeds**: Access real-time cryptocurrency prices from two sources (Binance & Chainlink)
* **Comment Streaming**: Real-time updates for comment events including new comments, replies, and reactions
* **Dynamic Subscriptions**: Add, remove, and modify subscriptions without reconnecting
* **TypeScript Client**: Official TypeScript client available at [real-time-data-client](https://github.com/Polymarket/real-time-data-client)
* There has been a significant change to the structure of the price change message. This update will be applied at 11PM UTC September 15, 2025. We apologize for the short notice
* The batch orders limit has been increased from from 5 -> 15. Read more about the batch orders functionality [here](https://docs.polymarket.com/developers/CLOB/orders/create-order-batch).
* We’re excited to roll out a highly requested feature: **order batching**. With this new endpoint, users can now submit up to five trades in a single request. To help you get started, we’ve included sample code demonstrating how to use it. Please see [Place Multiple Orders (Batching)](https://docs.polymarket.com/developers/CLOB/orders/create-order-batch) for more details.
* We're adding a new `side` field to the `MakerOrder` portion of the trade object. This field will indicate whether the maker order is a `buy` or `sell`, helping to clarify trade events where the maker side was previously ambiguous. For more details, refer to the MakerOrder object on the [Get Trades](https://docs.polymarket.com/developers/CLOB/trades/trades) page.
* The 100 token subscription limit has been removed for the Markets channel. You can now subscribe to as many token IDs as needed for your use case.
* New Subscribe Field `initial_dump`
* Optional field to indicate whether you want to receive the initial order book state when subscribing to a token or list of tokens.
*`default: true`
</Update>
<Update label="May 28, 2025" description="New FAK Order Type">
We’re excited to introduce a new order type soon to be available to all users: Fill and Kill (FAK). FAK orders behave similarly to the well-known Fill or Kil(FOK) orders, but with a key difference:
* FAK will fill as many shares as possible immediately at your specified price, and any remaining unfilled portion will be canceled.
* Unlike FOK, which requires the entire order to fill instantly or be canceled, FAK is more flexible and aims to capture partial fills if possible.
</Update>
<Update label="May 15, 2025" description="Increased API Rate Limits">
All API users will enjoy increased rate limits for the CLOB endpoints.
* CLOB - /books (website) (300req - 10s / Throttle requests over the maximum configured rate)
* CLOB - /books (50 req - 10s / Throttle requests over the maximum configured rate)
* CLOB - /price (100req - 10s / Throttle requests over the maximum configured rate)
* CLOB markets/0x (50req / 10s - Throttle requests over the maximum configured rate)
* CLOB POST /order - 500 every 10s (50/s) - (BURST) - Throttle requests over the maximum configured rateed
* CLOB POST /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate
* CLOB DELETE /order - 500 every 10s (50/s) - (BURST) - Throttle requests over the maximum configured rate
* DELETE /order - 3000 every 10 minutes (5/s) - Throttle requests over the maximum configured rate
There are two levels of authentication to be considered when using Polymarket’s CLOB.\
All signing can be handled directly by the client libraries.
<Tip>This is information for advanced users who are NOT using our [Python](https://github.com/Polymarket/py-clob-client) or [Typescript](https://github.com/Polymarket/clob-client) Clients. Our provided clients handle signing and authentication for you.</Tip>
## L1: Private Key Authentication
The highest level of authentication is via an account’s Polygon private key.\
The private key remains in control of a user’s funds and all trading is non-custodial.\
The operator **never** has control over users’ funds.
"message": "This message attests that I control the given wallet",
}
sig = await signer._signTypedData(domain, types, value)
```
```typescript Typescript theme={null}
const domain = {
name: "ClobAuthDomain",
version: "1",
chainId: chainId, // Polygon Chain ID 137
};
const types = {
ClobAuth: [
{ name: "address", type: "address" },
{ name: "timestamp", type: "string" },
{ name: "nonce", type: "uint256" },
{ name: "message", type: "string" },
],
};
const value = {
address: signingAddress, // The Signing address
timestamp: ts, // The CLOB API server timestamp
nonce: nonce, // The nonce used
message: "This message attests that I control the given wallet", // Static message
};
const sig = await signer._signTypedData(domain, types, value);
```
</CodeGroup>
***
## L2: API Key Authentication
The next level of authentication consists of the API key, secret, and passphrase.\
These are used solely to authenticate API requests made to Polymarket’s CLOB, such as posting/canceling orders or retrieving an account’s orders and fills.
When a user on-boards via:
```bash theme={null}
POST /auth/api-key
```
the server uses the signature as a seed to deterministically generate credentials.\
An API credential includes:
* `key`: UUID identifying the credentials
* `secret`: Secret string used to generate HMACs (not sent with requests)
* `passphrase`: Secret string sent with each request, used to encrypt/decrypt the secret (never stored)
All private endpoints require an API key signature (`L2 Header`).
//Client initialization example and dumping API Keys
import { ApiKeyCreds, ClobClient} from "@polymarket/clob-client";
import { Wallet } from "@ethersproject/wallet";
const host = 'https://clob.polymarket.com';
const funder = '';//This is your Polymarket Profile Address, where you send UDSC to.
const signer = new Wallet(""); //This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
//In general don't create a new API key, always derive or createOrDerive
const creds = new ClobClient(host, 137, signer).createOrDeriveApiKey();
Welcome to the Polymarket Order Book API! This documentation provides overviews, explanations, examples, and annotations to simplify interaction with the order book. The following sections detail the Polymarket Order Book and the API usage.
## System
Polymarket's Order Book, or CLOB (Central Limit Order Book), is hybrid-decentralized. It includes an operator for off-chain matching/ordering, with settlement executed on-chain, non-custodially, via signed order messages.
The exchange uses a custom Exchange contract facilitating atomic swaps between binary Outcome Tokens (CTF ERC1155 assets and ERC20 PToken assets) and collateral assets (ERC20), following signed limit orders. Designed for binary markets, the contract enables complementary tokens to match across a unified order book.
Orders are EIP712-signed structured data. Matched orders have one maker and one or more takers, with price improvements benefiting the taker. The operator handles off-chain order management and submits matched trades to the blockchain for on-chain execution.
## API
The Polymarket Order Book API enables market makers and traders to programmatically manage market orders. Orders of any amount can be created, listed, fetched, or read from the market order books. Data includes all available markets, market prices, and order history via REST and WebSocket endpoints.
## Security
Polymarket's Exchange contract has been audited by Chainsecurity ([View Audit](https://github.com/Polymarket/ctf-exchange/blob/main/audit/ChainSecurity_Polymarket_Exchange_audit.pdf)).
The operator's privileges are limited to order matching, non-censorship, and ensuring correct ordering. Operators can't set prices or execute unauthorized trades. Users can cancel orders on-chain independently if trust issues arise.
## Fees
### Schedule
> Subject to change
| Volume Level | Maker Fee Base Rate (bps) | Taker Fee Base Rate (bps) |
Fees apply symmetrically in output assets (proceeds). This symmetry ensures fairness and market integrity. Fees are calculated differently depending on whether you are buying or selling:
* **Selling outcome tokens (base) for collateral (quote):**
Detailed instructions for creating, placing, and managing orders using Polymarket's CLOB API.
# Create and Place an Order
<Tip> This endpoint requires a L2 Header </Tip>
Create and place an order using the Polymarket CLOB API clients. All orders are represented as "limit" orders, but "market" orders are also supported. To place a market order, simply ensure your price is marketable against current resting limit orders, which are executed on input at the best price.
* **FOK**: A Fill-Or-Kill order is an market order to buy (in dollars) or sell (in shares) shares that must be executed immediately in its entirety; otherwise, the entire order will be cancelled.
* **FAK**: A Fill-And-Kill order is a market order to buy (in dollars) or sell (in shares) that will be executed immediately for as many shares as are available; any portion not filled at once is cancelled.
* **GTC**: A Good-Til-Cancelled order is a limit order that is active until it is fulfilled or cancelled.
* **GTD**: A Good-Til-Date order is a type of order that is active until its specified date (UTC seconds timestamp), unless it has already been fulfilled or cancelled. There is a security threshold of one minute. If the order needs to expire in 90 seconds the correct expiration value is: now + 1 minute + 30 seconds
| errorMsg | string | error message in case of unsuccessful placement (in case `success = false`, e.g. `client-side error`, the reason is in `errorMsg`) |
| orderId | string | id of order |
| orderHashes | string\[] | hash of settlement transaction order was marketable and triggered a match |
### Insert Error Messages
If the `errorMsg` field of the response object from placement is not an empty string, the order was not able to be immediately placed. This might be because of a delay or because of a failure. If the `success` is not `true`, then there was an issue placing the order. The following `errorMessages` are possible:
| INVALID\_ORDER\_MIN\_TICK\_SIZE | yes | order is invalid. Price breaks minimum tick size rules | order price isn't accurate to correct tick sizing |
| INVALID\_ORDER\_MIN\_SIZE | yes | order is invalid. Size lower than the minimum | order size must meet min size threshold requirement |
| INVALID\_ORDER\_DUPLICATED | yes | order is invalid. Duplicated. Same order has already been placed, can't be placed again | |
| INVALID\_ORDER\_NOT\_ENOUGH\_BALANCE | yes | not enough balance / allowance | funder address doesn't have sufficient balance or allowance for order |
| INVALID\_ORDER\_EXPIRATION | yes | invalid expiration | expiration field expresses a time before now |
| INVALID\_ORDER\_ERROR | yes | could not insert order | system error while inserting order |
| EXECUTION\_ERROR | yes | could not run the execution | system error while attempting to execute trade |
| ORDER\_DELAYED | no | order match delayed due to market conditions | order placement delayed |
| DELAYING\_ORDER\_ERROR | yes | error delaying the order | system error while delaying order |
| FOK\_ORDER\_NOT\_FILLED\_ERROR | yes | order couldn't be fully filled, FOK orders are fully filled/killed | FOK order not fully filled so can't be placed |
| MARKET\_NOT\_READY | no | the market is not yet ready to process new orders | system not accepting orders for market yet |
### Insert Statuses
When placing an order, a status field is included. The status field provides additional information regarding the order's state as a result of the placement. Possible values include:
Polymarket’s CLOB supports batch orders, allowing you to place up to `15` orders in a single request. Before using this feature, make sure you're comfortable placing a single order first. You can find the documentation for that [here.](https://docs.polymarket.com/developers/CLOB/orders/create-order)
* **FOK**: A Fill-Or-Kill order is an market order to buy (in dollars) or sell (in shares) shares that must be executed immediately in its entirety; otherwise, the entire order will be cancelled.
* **FAK**: A Fill-And-Kill order is a market order to buy (in dollars) or sell (in shares) that will be executed immediately for as many shares as are available; any portion not filled at once is cancelled.
* **GTC**: A Good-Til-Cancelled order is a limit order that is active until it is fulfilled or cancelled.
* **GTD**: A Good-Til-Date order is a type of order that is active until its specified date (UTC seconds timestamp), unless it has already been fulfilled or cancelled. There is a security threshold of one minute. If the order needs to expire in 90 seconds the correct expiration value is: now + 1 minute + 30 seconds
| errorMsg | string | error message in case of unsuccessful placement (in case `success = false`, e.g. `client-side error`, the reason is in `errorMsg`) |
| orderId | string | id of order |
| orderHashes | string\[] | hash of settlement transaction order was marketable and triggered a match |
### Insert Error Messages
If the `errorMsg` field of the response object from placement is not an empty string, the order was not able to be immediately placed. This might be because of a delay or because of a failure. If the `success` is not `true`, then there was an issue placing the order. The following `errorMessages` are possible:
| INVALID\_ORDER\_MIN\_TICK\_SIZE | yes | order is invalid. Price breaks minimum tick size rules | order price isn't accurate to correct tick sizing |
| INVALID\_ORDER\_MIN\_SIZE | yes | order is invalid. Size lower than the minimum | order size must meet min size threshold requirement |
| INVALID\_ORDER\_DUPLICATED | yes | order is invalid. Duplicated. Same order has already been placed, can't be placed again | |
| INVALID\_ORDER\_NOT\_ENOUGH\_BALANCE | yes | not enough balance / allowance | funder address doesn't have sufficient balance or allowance for order |
| INVALID\_ORDER\_EXPIRATION | yes | invalid expiration | expiration field expresses a time before now |
| INVALID\_ORDER\_ERROR | yes | could not insert order | system error while inserting order |
| EXECUTION\_ERROR | yes | could not run the execution | system error while attempting to execute trade |
| ORDER\_DELAYED | no | order match delayed due to market conditions | order placement delayed |
| DELAYING\_ORDER\_ERROR | yes | error delaying the order | system error while delaying order |
| FOK\_ORDER\_NOT\_FILLED\_ERROR | yes | order couldn't be fully filled, FOK orders are fully filled/killed | FOK order not fully filled so can't be placed |
| MARKET\_NOT\_READY | no | the market is not yet ready to process new orders | system not accepting orders for market yet |
### Insert Statuses
When placing an order, a status field is included. The status field provides additional information regarding the order's state as a result of the placement. Possible values include:
## How do I interpret the OrderFilled onchain event?
Given an OrderFilled event:
* `orderHash`: a unique hash for the Order being filled
* `maker`: the user generating the order and the source of funds for the order
* `taker`: the user filling the order OR the Exchange contract if the order fills multiple limit orders
* `makerAssetId`: id of the asset that is given out. If 0, indicates that the Order is a BUY, giving USDC in exchange for Outcome tokens. Else, indicates that the Order is a SELL, giving Outcome tokens in exchange for USDC.
* `takerAssetId`: id of the asset that is received. If 0, indicates that the Order is a SELL, receiving USDC in exchange for Outcome tokens. Else, indicates that the Order is a BUY, receiving Outcome tokens in exchange for USDC.
* `makerAmountFilled`: the amount of the asset that is given out.
* `takerAmountFilled`: the amount of the asset that is received.
Detailed instructions for creating, placing, and managing orders using Polymarket's CLOB API.
All orders are expressed as limit orders (can be marketable). The underlying order primitive must be in the form expected and executable by the on-chain binary limit order protocol contract. Preparing such an order is quite involved (structuring, hashing, signing), thus Polymarket suggests using the open source typescript, python and golang libraries.
## Allowances
To place an order, allowances must be set by the funder address for the specified `maker` asset for the Exchange contract. When buying, this means the funder must have set a USDC allowance greater than or equal to the spending amount. When selling, the funder must have set an allowance for the conditional token that is greater than or equal to the selling amount. This allows the Exchange contract to execute settlement according to the signed order instructions created by a user and matched by the operator.
## Signature Types
Polymarket’s CLOB supports 3 signature types. Orders must identify what signature type they use. The available typescript and python clients abstract the complexity of signing and preparing orders with the following signature types by allowing a funder address and signer type to be specified on initialization. The supported signature types are:
| POLY\_PROXY | 1 | EIP712 signatures signed by a signer associated with funding Polymarket proxy wallet |
| POLY\_GNOSIS\_SAFE | 2 | EIP712 signatures signed by a signer associated with funding Polymarket gnosis safe wallet |
## Validity Checks
Orders are continually monitored to make sure they remain valid. Specifically, this includes continually tracking underlying balances, allowances and on-chain order cancellations. Any maker that is caught intentionally abusing these checks (which are essentially real time) will be blacklisted.
Additionally, there are rails on order placement in a market. Specifically, you can only place orders that sum to less than or equal to your available balance for each market. For example if you have 500 USDC in your funding wallet, you can place one order to buy 1000 YES in marketA @ \$.50, then any additional buy orders to that market will be rejected since your entire balance is reserved for the first (and only) buy order. More explicitly the max size you can place for an order is:
All historical trades can be fetched via the Polymarket CLOB REST API. A trade is initiated by a "taker" who creates a marketable limit order. This limit order can be matched against one or more resting limit orders on the associated book. A trade can be in various states as described below. Note: in some cases (due to gas limitations) the execution of a "trade" must be broken into multiple transactions which case separate trade entities will be returned. To associate trade entities, there is a bucket\_index field and a match\_time field. Trades that have been broken into multiple trade objects can be reconciled by combining trade objects with the same market\_order\_id, match\_time and incrementing bucket\_index's into a top level "trade" client side.
| MATCHED | no | trade has been matched and sent to the executor service by the operator, the executor service submits the trade as a transaction to the Exchange contract |
| MINED | no | trade is observed to be mined into the chain, no finality threshold established |
| CONFIRMED | yes | trade has achieved strong probabilistic finality and was successful |
| RETRYING | no | trade transaction has failed (revert or reorg) and is being retried/resubmitted by the operator |
| FAILED | yes | trade has failed and is not being retried |
<strong>⚠️ Breaking Change Notice:</strong> The price\_change message schema will be updated on September 15, 2025 at 11 PM UTC. Please see the [migration guide](https://docs.polymarket.com/developers/CLOB/websocket/market-channel-migration-guide) for details.
Overview and general information about the Polymarket Websocket
## Overview
The Polymarket CLOB API provides websocket (wss) channels through which clients can get pushed updates. These endpoints allow clients to maintain almost real-time views of their orders, their trades and markets in general. There are two available channels `user` and `market`.
## Subscription
To subscribe send a message including the following authentication and intent information upon opening the connection.
In addition to splitting collateral for a full set, the inverse can also happen; a full set can be "merged" for collateral. This operation can again happen at any time after a condition has been prepared on the CTF contract. One unit of each position in a full set is burned in return for 1 collateral unit. This operation happens via the `mergePositions()` function on the CTF contract with the following parameters:
* `collateralToken`: IERC20 - The address of the positions' backing collateral token.
* `parentCollectionId`: bytes32 - The ID of the outcome collections common to the position being merged and the merge target positions. Null in Polymarket case.
* `conditionId`: bytes32 - The ID of the condition to merge on.
* `partition`: uint\[] - An array of disjoint index sets representing a nontrivial partition of the outcome slots of the given condition. E.G. A|B and C but not A|B and B|C (is not disjoint). Each element's a number which, together with the condition, represents the outcome collection. E.G. 0b110 is A|B, 0b010 is B, etc. In the Polymarket case 1|2.
* `amount` - The number of full sets to merge. Also the amount of collateral to receive.
All outcomes on Polymarket are tokenized on the Polygon network. Specifically, Polymarket outcomes shares are binary outcomes (ie "YES" and "NO") using Gnosis' Conditional Token Framework (CTF). They are distinct ERC1155 tokens related to a parent condition and backed by the same collateral. More technically, the binary outcome tokens are referred to as "positionIds" in Gnosis's documentation. "PositionIds" are derived from a collateral token and distinct "collectionIds". "CollectionIds" are derived from a "parentCollectionId", (always bytes32(0) in our case) a "conditionId", and a unique "indexSet".
The "indexSet" is a 256 bit array denoting which outcome slots are in an outcome collection; it MUST be a nonempty proper subset of a condition's outcome slots. In the binary case, which we are interested in, there are two "indexSets", one for the first outcome and one for the second. The first outcome's "indexSet" is 0b01 = 1 and the second's is 0b10 = 2. The parent "conditionId" (shared by both "collectionIds" and therefore "positionIds") is derived from a "questionId" (a hash of the UMA ancillary data), an "oracle" (the UMA adapter V2), and an "outcomeSlotCount" (always 2 in the binary case). The steps for calculating the ERC1155 token ids (positionIds) is as follows:
2. `conditionId`: bytes32 - the conditionId derived from (1)
3. `indexSet`: uint - 1 (0b01) for the first and 2 (0b10) for the second.
3. Get the two positionIds
1. Function:
1. `getPositionId(collateralToken, collectionId)`
2. Inputs:
1. `collateralToken`: IERC20 - address of ERC20 token collateral (USDC)
2. `collectionId`: bytes32 - the two collectionIds derived from (3)
Leveraging the relations above, specifically "conditionIds" -> "positionIds" the Gnosis CTF contract allows for "splitting" and "merging" full outcome sets. We explore these actions and provide code examples below.
Once a condition has had it's payouts reported (ie by the UMACTFAdapter calling `reportPayouts` on the CTF contract), users with shares in the winning outcome can redeem them for the underlying collateral. Specifically, users can call the `redeemPositions` function on the CTF contract which will burn all valuable conditional tokens in return for collateral according to the reported payout vector. This function has the following parameters:
* `collateralToken`: IERC20 - The address of the positions' backing collateral token.
* `parentCollectionId`: bytes32 - The ID of the outcome collections common to the position being redeemed. Null in Polymarket case.
* `indexSets`: uint\[] - The ID of the condition to redeem.
* `indexSets`: uint\[] - An array of disjoint index sets representing a nontrivial partition of the outcome slots of the given condition. E.G. A|B and C but not A|B and B|C (is not disjoint). Each element's a number which, together with the condition, represents the outcome collection. E.G. 0b110 is A|B, 0b010 is B, etc. In the Polymarket case 1|2.
At any time, after a condition has been prepared on the CTF contract (via `prepareCondition`), it is possible to "split" collateral into a full (position) set. In other words, one unit USDC can be split into 1 YES unit and 1 NO unit. If splitting from the collateral, the CTF contract will attempt to transfer `amount` collateral from the message sender to itself. If successful, `amount` stake will be minted in the split target positions. If any of the transfers, mints, or burns fail, the transaction will revert. The transaction will also revert if the given partition is trivial, invalid, or refers to more slots than the condition is prepared with. This operation happens via the `splitPosition()` function on the CTF contract with the following parameters:
* `collateralToken`: IERC20 - The address of the positions' backing collateral token.
* `parentCollectionId`: bytes32 - The ID of the outcome collections common to the position being split and the split target positions. Null in Polymarket case.
* `conditionId`: bytes32 - The ID of the condition to split on.
* `partition`: uint\[] - An array of disjoint index sets representing a nontrivial partition of the outcome slots of the given condition. E.G. A|B and C but not A|B and B|C (is not disjoint). Each element's a number which, together with the condition, represents the outcome collection. E.G. 0b110 is A|B, 0b010 is B, etc. In the Polymarket case 1|2.
* `amount` - The amount of collateral or stake to split. Also the number of full sets to receive.
<Note>Polymarket provides a Typescript client for interacting with this streaming service. [Download and view it's documentation here](https://github.com/Polymarket/real-time-data-client)</Note>
## Overview
The comments subscription provides real-time updates for comment-related events on the Polymarket platform. This includes new comments being created, as well as other comment interactions like reactions and replies.
## Subscription Details
* **Topic**: `comments`
* **Type**: `comment_created` (and potentially other comment event types like `reaction_created`)
* **Authentication**: May require Gamma authentication for user-specific data
* **Filters**: Optional (can filter by specific comment IDs, users, or events)
## Subscription Message
```json theme={null}
{
"action": "subscribe",
"subscriptions": [
{
"topic": "comments",
"type": "comment_created"
}
]
}
```
## Message Format
When subscribed to comments, you'll receive messages with the following structure:
```json theme={null}
{
"topic": "comments",
"type": "comment_created",
"timestamp": 1753454975808,
"payload": {
"body": "do you know what the term encircle means? it means to surround from all sides, Russia has present on only 1 side, that's the opposite of an encirclement",
| `displayUsernamePublic` | boolean | Whether the username should be displayed publicly |
| `name` | string | User's display name |
| `proxyWallet` | string | Proxy wallet address used for transactions |
| `pseudonym` | string | Generated pseudonym for the user |
## Parent Entity Types
The following parent entity types are supported:
* `Event` - Comments on prediction events
* `Market` - Comments on specific markets
* Additional entity types may be available
## Example Messages
### New Comment Created
```json theme={null}
{
"topic": "comments",
"type": "comment_created",
"timestamp": 1753454975808,
"payload": {
"body": "do you know what the term encircle means? it means to surround from all sides, Russia has present on only 1 side, that's the opposite of an encirclement",
<Note>Polymarket provides a Typescript client for interacting with this streaming service. [Download and view it's documentation here](https://github.com/Polymarket/real-time-data-client)</Note>
## Overview
The crypto prices subscription provides real-time updates for cryptocurrency price data from two different sources:
* **Binance Source** (`crypto_prices`): Real-time price data from Binance exchange
* **Chainlink Source** (`crypto_prices_chainlink`): Price data from Chainlink oracle networks
Both streams deliver current market prices for various cryptocurrency trading pairs, but use different symbol formats and subscription structures.
## Binance Source (`crypto_prices`)
### Subscription Details
* **Topic**: `crypto_prices`
* **Type**: `update`
* **Authentication**: Not required
* **Filters**: Optional (specific symbols can be filtered)
The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for various Polymarket data streams. The service allows clients to subscribe to multiple data feeds simultaneously and receive live updates as events occur on the platform.
<Note>Polymarket provides a Typescript client for interacting with this streaming service. [Download and view it's documentation here](https://github.com/Polymarket/real-time-data-client)</Note>
The RTDS supports two types of authentication depending on the subscription type:
1. **CLOB Authentication**: Required for certain trading-related subscriptions
* `key`: API key
* `secret`: API secret
* `passphrase`: API passphrase
2. **Gamma Authentication**: Required for user-specific data
* `address`: User wallet address
### Connection Management
The WebSocket connection supports:
* **Dynamic Subscriptions**: Without disconnecting from the socket users can add, remove and modify topics and filters they are subscribed to.
* **Ping/Pong**: You should send PING messages (every 5 seconds ideally) to maintain connection
## Available Subscription Types
<Note>Although this connection technically supports additional activity and subscription types, they are not fully supported at this time. Users are free to use them but there may be some unexpected behavior.</Note>
The RTDS currently supports the following subscription types:
Gamma provides some organizational models. These include events, and markets. The most fundamental element is always markets and the other models simply provide additional organization.
# Detail
1. **Market**
1. Contains data related to a market that is traded on. Maps onto a pair of clob token ids, a market address, a question id and a condition id
2. **Event**
1. Contains a set of markets
2. Variants:
1. Event with 1 market (i.e., resulting in an SMP)
2. Event with 2 or more markets (i.e., resulting in an GMP)
# Example
* **\[Event]** Where will Barron Trump attend College?
* **\[Market]** Will Barron attend Georgetown?
* **\[Market]** Will Barron attend NYU?
* **\[Market]** Will Barron attend UPenn?
* **\[Market]** Will Barron attend Harvard?
* **\[Market]** Will Barron attend another college?
All market data necessary for market resolution is available on-chain (ie ancillaryData in UMA 00 request), but Polymarket also provides a hosted service, Gamma, that indexes this data and provides additional market metadata (ie categorization, indexed volume, etc). This service is made available through a REST API. For public users, this resource read only and can be used to fetch useful information about markets for things like non-profit research projects, alternative trading interfaces, automated trading systems etc.
Certain events which meet the criteria of being "winner-take-all" may be deployed as **"negative risk"** events/markets. The Gamma API includes a boolean field on events, `negRisk`, which indicates whether the event is negative risk.
Negative risk allows for increased capital efficiency by relating all markets within events via a convert action. More explicitly, a NO share in any market can be converted into 1 YES share in all other markets. Converts can be exercised via the [Negative Adapter](https://polygonscan.com/address/0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296). You can read more about negative risk [here](https://github.com/Polymarket/neg-risk-ctf-adapter).
***
## Augmented Negative Risk
There is a known issue with the negative risk architecture which is that the outcome universe must be complete before conversions are made or otherwise conversion will “cost” something. In most cases, the outcome universe can be made complete by deploying all the named outcomes and then an “other” option. But in some cases this is undesirable as new outcomes can come out of nowhere and you'd rather them be directly named versus grouped together in an “other”.
To fix this, some markets use a system of **"augmented negative risk"**, where named outcomes, a collection of unnamed outcomes, and an *other* is deployed. When a new outcome needs to be added, an unnamed outcome can be clarified to be the new outcome via the bulletin board. This means the “other” in the case of augmented negative risk can effectively change definitions (outcomes can be taken out of it).
As such, trading should only happen on the named outcomes, and the other outcomes should be ignored until they are named or until resolution occurs. The Polymarket UI will not show unnamed outcomes.
If a market becomes resolvable and the correct outcome is not named (originally or via placeholder clarification), it should resolve to the *“other”* outcome. An event can be considered “augmented negative risk” when `enableNegRisk` is true **AND** `negRiskAugmented` is true.
The naming conventions are as follows:
### Original Outcomes
* Outcome A
* Outcome B
* ...
### Placeholder Outcomes
* Person A -> can be clarified to a named outcome
* Person B -> can be clarified to a named outcome
* ...
### Explicit Other
* Other -> not meant to be traded as the definition of this changes as placeholder outcomes are clarified to named outcomes
When a user first uses Polymarket.com to trade they are prompted to create a wallet. When they do this, a 1 of 1 multisig is deployed to Polygon which is controlled/owned by the accessing EOA (either MetaMask wallet or MagicLink wallet). This proxy wallet is where all the user's positions (ERC1155) and USDC (ERC20) are held.
Using proxy wallets allows Polymarket to provide an improved UX where multi-step transactions can be executed atomically and transactions can be relayed by relayers on the gas station network. If you are a developer looking to programmatically access positions you accumulated via the Polymarket.com interface, you can either continue using the smart contract wallet by executing transactions through it from the owner account, or you can transfer these assets to a new address using the owner account.
***
## Deployments
Each user has their own proxy wallet (and thus proxy wallet address) but the factories are available at the following deployed addresses on the **Polygon network**:
| [0xaacfeea03eb1561c4e67d661e40682bd20e3541b](https://polygonscan.com/address/0xaacfeea03eb1561c4e67d661e40682bd20e3541b) | **Gnosis safe factory** – Gnosis safes are used for all MetaMask users |
| [0xaB45c54AB0c941a2F231C04C3f49182e1A254052](https://polygonscan.com/address/0xaB45c54AB0c941a2F231C04C3f49182e1A254052) | **Polymarket proxy factory** – Polymarket custom proxy contracts are used for all MagicLink users |
Polymarket leverages UMA's Optimistic Oracle (OO) to resolve arbitrary questions, permissionlessly. From [UMA's docs](https://docs.uma.xyz/protocol-overview/how-does-umas-oracle-work):
"UMA's Optimistic Oracle allows contracts to quickly request and receive data information ... The Optimistic Oracle acts as a generalized escalation game between contracts that initiate a price request and UMA's dispute resolution system known as the Data Verification Mechanism (DVM). Prices proposed by the Optimistic Oracle will not be sent to the DVM unless it is disputed. If a dispute is raised, a request is sent to the DVM. All contracts built on UMA use the DVM as a backstop to resolve disputes. Disputes sent to the DVM will be resolved within a few days -- after UMA tokenholders vote on what the correct outcome should have been."
To allow CTF markets to be resolved via the OO, Polymarket developed a custom adapter contract called `UmaCtfAdapter` that provides a way for the two contract systems to interface.
## Clarifications
Recent versions (v2+) of the `UmaCtfAdapter` also include a bulletin board feature that allows market creators to issue "clarifications". Questions that allow updates will include the sentence in their ancillary data:
"Updates made by the question creator via the bulletin board on 0x6A5D0222186C0FceA7547534cC13c3CFd9b7b6A4F74 should be considered. In summary, clarifications that do not impact the question's intent should be considered."
Where the [transaction](https://polygonscan.com/tx/0xa14f01b115c4913624fc3f508f960f4dea252758e73c28f5f07f8e19d7bca066) reference outlining what outlining should be considered.
## Resolution Process
### Actions
* **Initiate** - Binary CTF markets are initialized via the `UmaCtfAdapter`'s `initialize()` function. This stores the question parameters on the contract, prepares the CTF and requests a price for a question from the OO. It returns a `questionID` that is also used to reference on the `UmaCtfAdapter`. The caller provides:
1. `ancillaryData` - data used to resolve a question (i.e the question + clarifications)
2. `rewardToken` - ERC20 token address used for payment of rewards and fees
3. `reward` - Reward amount offered to a successful proposer. The caller must have set allowance so that the contract can pull this reward in.
4. `proposalBond` - Bond required to be posted by OO proposers/disputers. If 0, the default OO bond is used.
5. `liveness` - UMA liveness period in seconds. If 0, the default liveness period is used.
* **Propose Price** - Anyone can then propose a price to the question on the OO. To do this they must post the `proposalBond`. The liveness period begins after a price is proposed.
* **Dispute** - Anyone that disagrees with the proposed price has the opportunity to dispute the price by posting a counter bond via the OO, this proposed will now be escalated to the DVM for a voter-wide vote.
### Possible Flows
When the first proposed price is disputed for a `questionID` on the adapter, a callback is made and posted as the reward for this new proposal. This means a second `questionID`, making a new `questionID` to the OO (the reward is returned before the callback is made and posted as the reward for this new proposal). This allows for a second round of resolution, and correspondingly a second dispute is required for it to go to the DVM. The thinking behind this is to doubles the cost of a potential griefing vector (two disputes are required just one) and also allows far-fetched (incorrect) first price proposals to not delay the resolution. As such there are two possible flows:
Polymarket provides incentives aimed at catalyzing the supply and demand side of the marketplace. Specifically there is a public liquidity rewards program as well as one-off public pnl/volume competitions.
## Overview
By posting resting limit orders, liquidity providers (makers) are automatically eligible for Polymarket's incentive program. The overall goal of this program is to catalyze a healthy, liquid marketplace. We can further define this as creating incentives that:
* Catalyze liquidity across all markets
* Encourage liquidity throughout a market's entire lifecycle
* Motivate passive, balanced quoting tight to a market's mid-point
* Encourages trading activity
* Discourages blatantly exploitative behaviors
This program is heavily inspired by dYdX's liquidity provider rewards which you can read more about [here](https://www.dydx.foundation/blog/liquidity-provider-rewards). In fact, the incentive methodology is essentially a copy of dYdX's successful methodology but with some adjustments including specific adaptations for binary contract markets with distinct books, no staking mechanic a slightly modified order utility-relative depth function and reward amounts isolated per market. Rewards are distributed directly to the maker's addresses daily at midnight UTC.
## Methodology
Polymarket liquidity providers will be rewarded based on a formula that rewards participation in markets (complementary consideration!), boosts two-sided depth (single-sided orders still score), and spread (vs. mid-market, adjusted for the size cutoff!). Each market still configure a max spread and min size cutoff within which orders are considered the average of rewards earned is determined by the relative share of each participant's Q<sub>n</sub> in market m.
$Q_{no}$ is calculated every minute using random sampling
4. Boosts 2-sided liquidity by taking the minimum of $Q_{ne}$ and $Q_{no}$, and rewards 1-side liquidity at a reduced rate (divided by c)
Calculated every minute
5. $Q_{normal}$ is the $Q_{min}$ of a market maker divided by the sum of all the $Q_{min}$ of other market makers in a given sample
6. $Q_{epoch}$ is the sum of all $Q_{normal}$ for a trader in a given epoch
7. $Q_{final}$ normalizes $Q_{epoch}$ by dividing it by the sum of all other market maker's $Q_{epoch}$ in a given epoch this value is multiplied by the rewards available for the market to get a trader's reward
<Tip>Both min\_incentive\_size and max\_incentive\_spread can be fetched alongside full market objects via both the CLOB API and Markets API. Reward allocations for an epoch can be fetched via the Markets API. </Tip>
Polymarket has written and open sourced a subgraph that provides, via a GraphQL query interface, useful aggregate calculations and event indexing for things like volume, user position, market and liquidity data. The subgraph updates in real time to be able to be mixed, and match core data from the primary Polymarket interface, providing positional data, activity history and more. The subgraph can be hosted by anyone but is also hosted and made publicly available by a 3rd party provider, Goldsky.
## Source
The Polymarket subgraph is entirely open source and can be found on the Polymarket Github.
* Open Interest subgraph: [https://api.goldsky.com/api/public/project\_cl6mb8i9h0003e201j6li0diw/subgraphs/oi-subgraph/0.0.6/gn](https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/oi-subgraph/0.0.6/gn)
Yes! Developers can find all the information they need for interacting with Polymarket. This includes [documentation on market discovery, resolution, trading etc.](https://docs.polymarket.com/quickstart/introduction/main)
Whether you are an academic researcher a market maker or an indepedent developer, this documentation should provide you what you need to get started. All the code you find linked here and on our [GitHub](https://github.com/polymarket) is open source and free to use.
<Tip>
If you have any questions please join our [Discord](https://discord.com/invite/polymarket) and direct your questions to the #devs channel.
Polymarket allows you to embed a live-updating widget displaying the latest odds for markets in many places around the web.
### Web
Navigate to the individual market you want to embed and click the embed (\< >) link.
Select light or dark mode, and copy the auto-generated code
Paste the code into your code editor or CMS and publish as normal
### Twitter / X
Navigate to any Polymarket market
Copy the URL from your browser
Paste the URL into the compose window
### Substack
<Note>The embeds feature currently supports single markets only (eg “USA to Win Most Gold Medals”, not “Most Gold Medals at Paris Olympics’) </Note>
To embed a market, navigate on Polymarket.com to the single market you want to embed and click “copy link.”
Navigate to your Substack editor and paste the link directly into the body of your newsletter. The editor will recognize the market and convert it to a widget that automatically refreshes with the latest odds.
Yes. Polymarket is non-custodial, so you're in control of your funds.
#### Non-custodial, you’re in control
Polymarket recognizes the importance of a trustworthy environment for managing your funds. To ensure this, Polymarket uses non-custodial wallets, meaning we never take possession of your USDC. This approach gives you full control over your assets, providing protection against potential security threats like hacks, misuse, and unauthorized transactions.
A private key acts like a highly secure password, essential for managing and moving your assets without restrictions. You can export your private key at any time, ensuring sole access to your funds. Learn how to export your private key [here](https://docs.polymarket.com/polymarket-learn/FAQ/how-to-export-private-key/).
**Do not share your private key with others**. While Polymarket provides the infrastructure, the security of your assets depends on how securely you handle your private key and passwords. Losing your private key or passwords can result in losing access to your funds. It's crucial to store this information in a safe and secure environment.
### Our Commitment
Polymarket aims to give you peace of mind, knowing that your assets are safe and fully under your control at all times. We encourage you to take necessary precautions to secure your digital assets effectively. The ability to manage your private key means you are not reliant on Polymarket to secure your assets; you have the control to ensure your financial security.
No, Polymarket is not the house. All trades happen peer-to-peer (p2p).
## Polymarket is different in three ways:
### 1. Traders interact directly with each other, not with Polymarket.
Polymarket is a marketplace comprised of traders on both sides of any given market. This means you're always trading with other users, not against a centralized entity or "house." Prices on Polymarket are determined by supply and demand. As traders buy and sell shares in outcomes, prices fluctuate to reflect the collective sentiment and knowledge of market participants.
### 2. Polymarket does not charge trading fees.
Unlike bookmakers or wagering operations, Polymarket does not charge deposit/withdrawal fees, or any type of trading fees. This means that Polymarket does not stand to benefit from the outcome of any market or usage of any trader.
### 3. Transact at any time.
Polymarket enables you to sell your position at any time before the market resolves, provided there is a willing buyer of your shares. This offers flexibility and allows you to manage your risk and lock in profits or cut losses as you see fit.
In essence, Polymarket empowers you to trade based on your own knowledge and research, without going up against a "house" with potentially unfair advantages.
How is Polymarket better than traditional / legacy polling?
While legacy polls capture a snapshot of opinion at a specific moment, they are often outdated by the time they're published—sometimes lagging by several days. In contrast, Polymarket reflects real-time sentiment as events unfold, offering continuous updates and a more dynamic understanding of public opinion.
Studies show that prediction markets like Polymarket tend to outperform traditional pollsters because participants are financially incentivized to be correct. This creates more thoughtful, data-driven predictions. Research by James Surowiecki, author of The Wisdom of Crowds, has highlighted how markets like these can be more accurate than polls due to the "collective intelligence" of diverse participants. Additionally, the Iowa Electronic Markets, an academic research project at the University of Iowa, has consistently demonstrated the superior accuracy of prediction markets like Polymarket over traditional polling in predicting political outcomes.
Polymarket provides a constantly updating picture of public sentiment, offering a degree of accuracy and timeliness that traditional pollsters, who typically report data that is days old, simply cannot match.
If you deposited the wrong cryptocurrency on Ethereum or Polygon, use these tools to recover those funds.
### Recover on Ethereum
<Note>Use this tool if you deposited the wrong token on Ethereum.</Note>
1. Go to [https://recovery.polymarket.com/](https://recovery.polymarket.com/) and sign in with your Polymarket account or connect the wallet you use on Polymarket.
2. Select the asset you incorrectly deposited.
3. You’ll then see the asset balance displayed, and will have the ability to recover those funds to your specified wallet.
### Recover on Polygon
<Note>Use this tool if you deposited the wrong token on Polygon.</Note>
1. Go to [https://matic-recovery.polymarket.com/](https://matic-recovery.polymarket.com/) and sign in with your Polymarket account or connect the wallet you use on Polymarket.
2. Select the asset you incorrectly deposited.
3. You’ll then see the asset balance displayed, and will have the ability to recover those funds to your specified wallet.
**Yes, you can sell or close your position early.**
You may sell shares at any point before the market is resolved by either placing a market order to sell shares at the prevailing bid price in the orderbook, or by placing a limit order for how many shares you wish to sell and at what price.
The limit order will only be executed if/when there is a willing buyer for your shares at the price you set.
Polymarket offers technical support through our website chat feature, and through Discord.
To contact support through our website:
* Navigate to [Polymarket](https://polymarket.com).
* Click the blue chat icon in the bottom right and start your chat session.
For technical support on Discord:
* Join the [Polymarket Discord server](https://discord.gg/polymarket)
* Navigate to the Support sidebar and click #open-a-ticket. This will open a private conversation with a Polymarket team member.
<Warning>
Be aware of numerous scams and malicious links. Polymarket team members will never DM you first or ask for private keys or personal information. Polymarket team members are identified in blue font on Discord.
A prediction market is a platform where people can bet on the outcome of future events. By buying and selling shares in the outcomes, participants collectively forecast the likelihood of events such as sports results, political elections, or entertainment awards.
### How it works
Market Prices = Probabilities: The price of shares in a prediction market represents the current probability of an event happening. For example, if shares of an event are trading at 20 cents, it indicates a 20% chance of that event occurring.
### Making predictions
If you believe the actual probability of an event is higher than the market price suggests, you can buy shares. For instance, if you think a team has a better than 20% chance of winning, you would buy shares at 20 cents. If the event occurs, each share becomes worth \$1, yielding a profit.
### Free-market trading
You can buy or sell shares at any time before the event concludes, based on new information or changing circumstances. This flexibility allows the market prices to continuously reflect the most current and accurate probabilities.
### Trust the markets
Prediction markets provide unbiased and accurate probabilities in real time, cutting through the noise of human and media biases. Traditional sources often have their own incentives and slants, but prediction markets operate on the principle of "put your money where your mouth is." Here, participants are financially motivated to provide truthful insights, as their profits depend on the accuracy of their predictions.
In a prediction market, prices reflect the aggregated sentiment of all participants, weighing news, data, expert opinions, and culture to determine the true odds. Unlike media narratives, which can be swayed by various biases, prediction markets offer a transparent view of where people genuinely believe we're heading.
#### Why use prediction markets?
Prediction markets are often more accurate than traditional polls and expert predictions. The collective wisdom of diverse participants, each motivated by the potential for profit, leads to highly reliable forecasts. This makes prediction markets an excellent tool for gauging real-time probabilities of future events.
Polymarket, the world's largest prediction market, offers a user-friendly platform to bet on a wide range of topics, from sports to politics. By participating, you can profit from your knowledge while contributing to the accuracy of market predictions.
Why Polymarket uses crypto and blockchain technology to create the world’s largest Prediction market.
Polymarket operates on Polygon, a proof-of-stake layer two blockchain built on [Ethereum](https://ethereum.org). All transactions are denominated in USDC, a US-dollar pegged stablecoin.
This architecture offers several advantages over traditional prediction markets:
## Why USDC?
### Stable Value
Polymarket denominates trades in USDC, which is pegged 1:1 to the US Dollar. This shields you from the volatility associated with other cryptocurrencies and offers a stable medium for trading.
### Regulated Reserves
USDC operates in adherence to regulatory standards and is backed by reserved assets.
### Transparency
Blockchain technology facilitates transparency, as all transactions are recorded publicly.
### Global Reach
Research has shown that wide availability of prediction markets increases their accuracy. Using decentralized blockchain technology removes the need for a central authority in trading, which fosters fairness and open participation around the globe.
How to buy and deposit USDC to your Polymarket account using Coinbase.
## Buying USDC
**How to buy and deposit USDC to your Polymarket account using Coinbase.**
Depositing directly to Polymarket from Coinbase is simple and easy. If you need help creating a Coinbase account, see their [guide on Coinbase.com](https://help.coinbase.com/en/coinbase/getting-started)
Copy your Polymarket USDC (Polygon) wallet address, as shown in your <ExternalLink href="https://polymarket.com/wallet">Polymarket wallet</ExternalLink>.
*Ensure you have copied your address for the Polygon network, as depicted below*
Login to <ExternalLink href="https://coinbase.com">Coinbase</ExternalLink>, and select "Transfer" > "Send Crypto"
</Steps.Step>
<Steps.Step>
Select USDC as the sending asset (note: you may have to search for it), and enter the amount you wish to send (deposit) to Polymarket.
</Steps.Step>
<Steps.Step>
Under **To**, enter your Polymarket deposit address you copied from your <ExternalLink href="https://polymarket.com/wallet">Polymarket wallet</ExternalLink>.
</Steps.Step>
<Steps.Step>
Under **Network**, select Polygon.
</Steps.Step>
<Steps.Step>
Click **Send Now**. Your deposit will be available to trade on Polymarket in a few minutes!
</Steps.Step>
<Steps.Step>
Back on the Polymarket <ExternalLink href="https://polymarket.com/wallet">deposit page</ExternalLink>, click **"Confirm pending deposit"**.
Note: When withdrawing USDC.e (bridged USDC) is swapped through the [Uniswap v3 pool](https://polygonscan.com/address/0xd36ec33c8bed5a9f7b6630855f1533455b98a418)
for USDC (native) (the UI enforces less than 10bp difference in output
amount). At times, this pool may be exhausted and for extremely large deposits
there might not be enough liquidity. If you are having withdraw issues, try
breaking your withdraw into smaller amounts or waiting for the pool to be
rebalanced. Additionally, you can select to withdraw USDC.e directly which
does not require any Uniswap liquidity; just be aware that some exchanges no
For large deposits (>\$50,000) originating from a chain other than Polygon, we recommend using one of the aforementioned bridges. Ensure you bridge to your Polymarket USDC (Polygon) [deposit address](https://polymarket.com/wallet) (screenshot below). Please be mindful of potential slippage during the transaction.
<Warning>
Polymarket is not affiliated with, responsible for, or makes any guarantees regarding any third-party bridge. Users are advised to review the Terms of Use or other relevant documentation for third-party bridges.
</Warning>
## Important Notes
You can deposit USDC or USDC.e to your Polymarket Polygon wallet.
If you deposit USDC (native), you will be prompted to "activate funds," which will swap this to USDC.e via the lowest fee Uniswap pool, ensuring slippage of less than 10 basis points (bps).
If you encounter any issues with the deposit process, please reach out to us on Discord for assistance.
Please contact us using the live chat button on the bottom right on [**Polymarket.com**](http://Polymarket.com)\*\* or email us on [support@polymarket.com](mailto:support@polymarket.com)\*\*
Send your USDC to the address you just copied on the Ethereum network. This feature is typically called “send” or “withdraw” on most exchanges and wallets.
<Note>
Ensure you are sending USDC to your Polymarket Ethereum deposit address on
Ethereum network to avoid any issues.
</Note>
</Steps.Step>
<Steps.Step>
Once your deposit is detected, a countdown timer will begin.
</Steps.Step>
<Steps.Step>
You will see "Deposit Complete" when your funds are ready to trade.
<Tip>
If your countdown timer resets more than once, or if you encounter any issues,
This guide will walk you through the deposit process for Polymarket, covering popular methods and step-by-step instructions for buying and depositing USDC.
<Note>
Need Help? For assistance, reach out to us on [Discord](https://discord.gg/polymarket).
</Note>
## About USDC and Polygon
Polymarket uses [USDC (USD Coin)](https://circle.com/en/usdc), a federally regulated "stable coin" backed by the US dollar.
Polymarket utilizes USDC on the Polygon network for transactions. By using USDC on Polygon, Polymarket ensures fast and reliable transactions, enhancing the overall user experience.
USDC is available on most major exchanges, including Coinbase.
If your exchange supports sending or withdrawing to Polygon, we recommend this option for faster and fee-free transactions. Alternatively, you can deposit USDC via the Ethereum network.
### Deposit with crypto exchanges
For detailed instructions, check out our guides for purchasing and depositing USDC using popular exchanges:
If you decide to use an exchange to purchase and send (deposit) USDC to your Polygon deposit address, please ensure you're sending on Polygon Network. If you're unsure, please reach out to support on [Discord](https://discord.com/invite/polymarket).
MoonPay enables you to buy USDC (on Polygon) using your Visa, Mastercard, and select bank cards. Please be aware that payment options and transaction limits may vary depending on your region. [How to use MoonPay](https://docs.polymarket.com/polymarket-learn/deposits/moonpay/).
You can send USDC with your wallet on Ethereum or USDC.e on Polygon to your respective deposit addresses found on the Deposit page. [Learn more](https://docs.polymarket.com/polymarket-learn/deposits/usdc-on-eth/).
We're available to guide you through the sign-up process on [Discord](https://discord.gg/polymarket)
</Tip>
### Email or Google Sign-Up
Signing up for Polymarket with your email address or Google account is quick, simple, and secure.
<Steps>
<Steps.Step>
Click **Sign Up** on the top right of the Polymarket homepage.
</Steps.Step>
<Steps.Step>
Enter your email address and click **continue**.
*You can also use your Google account to sign in and follow the same procedure.*
</Steps.Step>
<Steps.Step>
**Copy the security code** provided by Magic.
</Steps.Step>
<Steps.Step>
You’ll receive an email with the subject “Log in to Polymarket”. Open the email, and click the **Log in to Polymarket** button.
In the new window, enter or **paste the security code** from the previous step.
<Note>Note: This page will be hosted on auth.magic.link.</Note>
You'll see a Login Complete message. Return to your original Polymarket window.
</Steps.Step>
<Steps.Step>
Back on Polymarket, you'll be signed in. Choose your display name, agree to the terms of service, opt into email updates, and get started trading.
</Steps.Step>
</Steps>
### Crypto Wallet Sign-Up
Polymarket supports most crypto wallets, including MetaMask, Coinbase Wallet, and others via WalletConnect.
<Steps>
<Steps.Step>
Click Sign Up on the Polymarket homepage.
</Steps.Step>
<Steps.Step>
Choose your preferred wallet and follow the prompts to connect it to Polymarket. Ensure you are connected to the Polygon Network, your wallet may prompt you to switch networks.
</Steps.Step>
<Steps.Step>
Sign the transaction prompt(s) on your wallet app or extension.
</Steps.Step>
<Steps.Step>
You're signed in! Choose your display name, agree to the terms of service, opt into email updates, and start trading.
</Steps.Step>
</Steps>
<Note>
If you have MetaMask or Coinbase Wallet browser extensions installed but wish to connect using their mobile apps, you'll need to disable the extensions in your browser settings and reload Polymarket.
Once you've [signed up](https://docs.polymarket.com/polymarket-learn/get-started/how-to-signup) and [deposited funds](https://docs.polymarket.com/polymarket-learn/get-started/how-to-deposit), you're ready to start trading on Polymarket. Here's a step-by-step guide to get you started.
Before trading, you'll have to visit the [markets page](https://polymarket.com/markets) to see all available markets. Use the search, sort, and filter tools to narrow down your options and find a market that interests you.
screen shot.
<Steps>
<Steps.Step>
### Choose a Market
Locate the 'buy' modal, on the right side of the screen. Click the outcome you want to buy (usually Yes or No), then enter the dollar amount you wish to invest.
</Steps.Step>
<Steps.Step>
### Buy Shares
Click **Buy** and confirm the transaction in your wallet. Once your trade goes through, you'll receive a notification confirming its success.
<Tip>Congrats, you're officially a Polymarket trader!</Tip>
</Steps.Step>
<Steps.Step>
### Share your trade
You'll also see a bet slip to share on social media. We love sending \$\$\$ to traders who post their trades on Twitter and tag us!
Simple, right? If you think you've got the hang of it, it's time to learn about more advanced trading and order types. [Limit Orders](https://docs.polymarket.com/polymarket-learn/trading/limit-orders/).
Polymarket is the world’s largest prediction market, allowing you to stay informed and profit from your knowledge by betting on future events across various topics.
Studies show prediction markets are often more accurate than pundits because they combine news, polls, and expert opinions into a single value that represents the market's view of an event's odds. Our markets reflect *accurate, unbiased, and real-time probabilities* for the events that matter most to you. Markets seek truth.
* On Polymarket, you can [buy and sell shares](https://docs.polymarket.com/polymarket-learn/get-started/making-your-first-trade) representing future event outcomes (i.e. "Will TikTok be banned in the U.S. this year?")
* Shares in event outcomes are [always priced](https://docs.polymarket.com/polymarket-learn/get-started/what-is-polymarket/#understanding-prices) between 0.00 and 1.00 [USDC](https://docs.polymarket.com/polymarket-learn/FAQ/why-do-i-need-crypto/#why-usdc), and every pair of event outcomes (i.e. each pair of "YES" + "NO" shares) is fully collateralized by \$1.00 USDC.
* Shares are created when [opposing sides come to an agreement on odds](https://docs.polymarket.com/polymarket-learn/trading/limit-orders), such that the sum of what each side is willing to pay is equal to \$1.00.
* The shares representing the *correct, final outcome* are paid out \$1.00 USDC each upon [market resolution](https://docs.polymarket.com/polymarket-learn/markets/how-are-markets-resolved).
*Prices (odds) on Polymarket represent the current probability of an event occurring.* For example, in a market predicting whether the Miami Heat will win the 2025 NBA Finals, if YES shares are trading at 18 cents, it indicates a 18% chance of Miami winning.
These odds are determined by what price other Polymarket users are currently willing to buy & sell those shares at. Just how stock exchanges don't "set" the prices of stocks, Polymarket does not set prices / odds - they're a function of supply & demand.
In the example above, if you believe Miami's chances of winning are higher than 18%, you would buy “Yes” shares at 18 cents each. If Miami wins, each “Yes” share would be worth \$1, resulting in an 82-cent profit per share. Conversely, any trader who owned “No” shares would see their investment become worthless once the game is over.
Since it's a market, you're not locked into your trade. You can sell your shares at any time at the current market price. As the news changes, the supply and demand for shares fluctuates, causing the share price to reflect the new odds for the event.
### How accurate are Polymarket odds?
Research shows prediction markets are often more accurate than experts, polls, and pundits. Traders aggregate news, polls, and expert opinions, making informed trades. Their economic incentives ensure market prices adjust to reflect true odds as more knowledgeable participants join.
This makes prediction markets the best source of real-time event probabilities. People use Polymarket for the most accurate odds, gaining the ability to make informed decisions about the future.
If you're an expert on a certain topic, Polymarket is your opportunity to profit from trading based on your knowledge, while improving the market's accuracy.
**Anyone can dispute a proposed market resolution if they feel it was proposed in error.**
Once a market is proposed for resolution it goes into a challenge period of 2 hours.
If no one challenges the proposal the resolution is deemed valid and the proposer receives their bond back plus the reward.
During the 2-hour challenge period, anyone may dispute the proposal on the [UMA dapp](https://oracle.uma.xyz/) by posting a challenge bond of the same amount as the proposer bond (usually \$750).
This begins the debate period of 24-48 hours (votes happen every other day and there will always be at least 24 hours for discussion). Anyone wishing to contribute evidence to the discussion can do so in the Uma Discord server in the #evidence-rationale and #voting-discussion channels.
After the debate period, Uma token holders vote (this process takes approximately 48 hours) and one of four outcomes happens:
## Outcomes
### Proposer wins
Proposer receives their bond back plus half the disputer’s bond as a bounty. Disputer loses their bond.
### Disputer wins
Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.
### Too Early
This outcome is for proposals for which the underlying event has not yet happened. Eg the result of a sports match that is still ongoing. Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.
### Unknown/50-50
This (rarely used) outcome is for events where none of the other options are appropriate. In this case the market price resolves to 50 yes and 50 no. Disputer receives their bond back plus half the proposer’s bond as a bounty. Proposer loses their bond.
In rare cases, circumstances occur that were not foreseen at a market’s creation and it becomes necessary to clarify rules after trading has begun. In these cases Polymarket may issue an “Additional context” update to the rules.
<Tip>If you believe a clarification is necessary for a market, the best place to request a clarification is in the [Polymarket Discord](https://discord.com/invite/polymarket) **#market-review** channel.</Tip>
<Frame caption="An example clarification in the market on what Trump would say during Hannity Town Hall. ">
Markets are created by the markets team with input from users and the community.
## Can I create my own market?
While users cannot directly create their own markets, they are encouraged to suggest ideas for new markets. In choosing which markets to list, Polymarket considers the following factors:
<Steps>
<Steps.Step>
Is there enough demand for trading in the market to produce an accurate probability? Polymarket targets \$X in trading volume as a minimum.
</Steps.Step>
<Steps.Step>
Is there social good or news value in understanding the probability generated by the market?
</Steps.Step>
<Steps.Step>
Can the market be resolved clearly?
</Steps.Step>
<Steps.Step>
Is there a credible information source for market resolution?
*For example, a country’s elections commission can be specified as the official resolution source for an election.*
</Steps.Step>
<Steps.Step>
Can the market be resolved in a definitive time frame?
</Steps.Step>
</Steps>
### Submit your market proposal
To give your proposal the best chance of being listed, include as much information as possible, such as:
Markets are resolved by the UMA Optimistic Oracle, a smart-contract based optimistic oracle.
## Overview
* When the result of a market becomes clear, the market can be “resolved,” or permanently finalized.
* Markets are resolved according to the market's pre-defined rules, which can be found under market's the order book.
* When a market is resolved, holders of winning shares receive \$1 per share, losing shares become worthless, and trading of shares is no longer possible.
* To resolve a market, an outcome must first be “proposed,” which involves putting up a bond in USDC.e which will be forfeited if the proposal is unsuccessful.
* If the proposal is validated as accurate, the proposer will receive a reward for your proposal.
<Warning>
If you propose a market too early, or are unsuccessful in your proposal, you will lose all of your \$750 bond. Do not propose a resolution unless you understand the process and are confident in your view.
</Warning>
### To propose a market resolution
<Steps>
<Steps.Step>
Navigate to the market you want to propose and click Resolution > Propose Resolution.
<Note>You will be taken to the corresponding UMA oracle page for the market, which shows the bond required and reward for successful proposal.</Note>
</Steps.Step>
<Steps.Step>
Ensure that you have enough USDC.e in your wallet on Polygon to supply the bond (usually \$750)
</Steps.Step>
<Steps.Step>
Select the outcome you would like to propose from the drop-down menu.
</Steps.Step>
<Steps.Step>
Connect your wallet and submit the transaction. It will now enter the UMA Oracle’s verification queue.
</Steps.Step>
</Steps>
Once in the verification process, UMA will review the transaction to ensure it was proposed correctly. If approved, you will receive your bond amount back in your wallet plus the reward. If not approved, it will enter Uma’s dispute resolution process, which is described in detail here.
### To dispute a proposed resolution
Once a market is proposed for resolution it goes into a challenge period of 2 hours.
To keep long-term pricing accurate, we're paying 4.00% annualized Holding Reward based on your total position value in certain polymarkets. We anticipate rolling out a new reward and oracle-resolution system later this year — at which point there will be a simple 1-click migration.
## Reward Rate and Conditions
The current rate is set at 4.00% and applies to all eligible positions. This rate is variable and subject to change at Polymarket's discretion. We also reserve the right to introduce limits to the total amount of rewards paid out at any time. This iteration of rewards is funded through the Polymarket Treasury.
Your total position value is randomly sampled once each hour, and the reward is distributed daily. Your rewards are calculated based on the total position value of your eligible positions at the time of evaluation.
### **Total Position Value Computation**
For each eligible polymarket, we calculate the eligible position in the following way:
**Position Valuation**:
* Based on your current "Yes" and "No" shares and the most recent mid-price for each outcome.
### **Example**
If you hold at time of sample:
* 30,000 “Yes” shares at a price of **\$0.53**
* 10,000 “No” shares at a price of **\$0.45**
**Total Position Value** =
→ `(30000 × 0.53) + (10000 × 0.45)`
→ `$15,900 + $4,500 = $20,400`
**Hourly Holding Reward Calculation** (based on 4.00% Annual Reward):
* Market makers (a fancy term for traders placing limit orders) interested in buying YES or NO shares can place [Limit Orders](https://docs.polymarket.com/polymarket-learn/trading/limit-orders) at the price they're willing to pay
* When offers for the YES and NO side equal \$1.00, the order is "matched" and that \$1.00 is converted into 1 YES and 1 NO share, each going to their respective buyers.
For example, if you place a limit order at \$0.60 for YES, that order is matched when someone places a NO order at \$0.40. *This becomes the initial market price.*
<Important>Polymarket is not a "bookie" and does not set prices / odds. Prices are set by what Polymarket users are currently willling to buy/sell shares at. All trades are peer-to-peer.</Important>
## Future Price
The prices displayed on Polymarket are the midpoint of the bid-ask spread in the orderbook — unless that spread is over \$0.10, in which case the last traded price is used.
Like the stock market, prices on Polymarket are a function of realtime supply & demand.
In the market below, the probability of 37% is the midpoint between the 34¢ bid and 40¢ ask. If the bid-ask spread is wider than 10¢, the probability is shown as the last traded price.
<Note>You may not be able to buy shares at the displayed probability / price because there is a bid-ask spread. In the above example, a trader wanting to buy shares would pay 40¢ for up to 4,200 shares, after which the price would rise to 43¢.</Note>
Limit orders are open orders (pending trades) that only execute when the market trades at your desired price.
For example, if the highest you’re willing to pay for a share of Trump “Yes” in the 2024 Republican Nomination is 72c, but the current market price is 73c, you could create a limit order at 72c and wait until someone is willing to sell Yes shares at your desired price.
<Note>
It’s not necessary for the entire order to execute at once. Limit orders can ‘partially fill’ as individual traders fill parts of your order.
</Note>
<Steps>
<Steps.Step>
In the buy modal, select **limit** in the order type dropdown.
</Steps.Step>
<Steps.Step>
Enter the price you are willing to buy (or sell, if you’ve selected to sell) shares at.
</Steps.Step>
<Steps.Step>
Enter the number of shares you want to buy or sell at that price.
*Optional: Set an expiration date for your limit order. This means that if the order does not execute at your desired price within this timeframe, it will be canceled.*
</Steps.Step>
<Steps.Step>
Click **Buy** and confirm the transaction in your wallet.
<Note>
Your limited orders that have yet to be filled are called "Open Orders".
</Note>
</Steps.Step>
<Steps.Step>
You'll see a **“Your deposit is pending”** screen. You'll receive a confirmation email from Coinbase when your USDC purchase is successful.
</Steps.Step>
</Steps>
## Managing limit orders
When you have an open order, you'll find it displayed just below the Order Book on the market's page.
If you have open orders across multiple markets, you can easily manage and monitor them all from the [Portfolio page](https://polymarket.com/portfolio?tab=Open+orders).
<Tip>
Specifically for sports markets, any outstanding limit orders are automatically cancelled once the game begins, clearing the entire order book at the official start time. Be aware, game start times can shift so it’s important to always monitor your orders closely in case they are not cleared due to game changes or other circumstances.
</Tip>
<Tip>
Additionally, sports markets include a 3-second delay on the placement of marketable orders.
</Tip>
## Canceling limit orders
When you have an open order, you'll find it displayed just below the Order Book on the market's page.
To cancel the order, you can simply click the red **x** button alongside the order.
If you have open orders across multiple markets, you can easily manage and monitor them all from the [Portfolio page](https://polymarket.com/portfolio?tab=Open+orders).
Nice! You can officially call yourself an advanced trader.
<Tip>
If some of this still isn’t making sense, feel free to reach out to us on [Discord](https://discord.com/invite/polymarket). We’re happy to help get you up to speed.
Learn how to earn rewards merely by placing trades on Polymarket
With Polymarket's Liquidity Rewards Program, you can earn money by placing limit orders that help keep the market active and balanced.
## Overview
* The closer your orders are to the market's average price, the more you earn.
* The reward amount depends on how helpful your orders are in terms of size and pricing compared to others.
* The more competitive your limit orders, the more you can make.
* You get paid daily based on how much your orders add to the market, and can use our [Rewards page](https://polymarket.com/rewards) to check your current earnings for the day, which markets have rewards in place, as well as how much.
* The minimum reward payout is \$1; amounts below this will not be paid.
Simply put, the more you help the market by placing good orders, the more rewards you earn!
## Seeing Rewards in the Order Book
### Viewing Rewards
The total rewards, max spread, and minimum shares required to earn rewards vary by market. You can view the rewards for a given market in its Order Book.
* On the Polymarket order book, you can hover over the Rewards text to see the amount of rewards available in total on each market.
* The blue highlighted lines correspond to the max spread — meaning the farthest distance your limit order can be from the midpoint of the market to earn rewards.
* In the example below, because the max spread is 3c, every order within 3c of the midpoint is eligible for rewards. If the midpoint is \< \$0.10, you need to have orders on both sides to qualify.
To read more about the specific calculations and formulas that determine rewards, visit our [Rewards Documentation](https://docs.polymarket.com/developers/rewards/overview).
Once you've [signed up](https://docs.polymarket.com/polymarket-learn/get-started/how-to-signup) and [deposited funds](https://docs.polymarket.com/polymarket-learn/get-started/how-to-deposit), you're ready to start trading on Polymarket. Here's a step-by-step guide to get you started.
\_Before trading, you'll want to visit the [markets page](https://polymarket.com/markets) to find a market that interests you.
<Steps>
<Steps.Step>
### [Choose a market](https://polymarket.com/markets)
Locate the 'buy' modal, on the right side of the screen. Click the outcome you want to buy (usually Yes or No), then enter the dollar amount you wish to invest.
</Steps.Step>
<Steps.Step>
### Buy shares
Click **Buy** and confirm the transaction in your wallet. Once your trade goes through, you'll receive a notification confirming its success.
<Tip>Congrats, you're officially a Polymarket trader!</Tip>
</Steps.Step>
<Steps.Step>
### Share your bet slip
You'll also see a bet slip to share on social media. We love sending \$\$\$ to traders who post their trades on Twitter and tag us!
Simple, right? If you think you've got the hang of it, it's time to learn about more advanced trading and order types. [Limit Orders](https://docs.polymarket.com/polymarket-learn/trading/limit-orders/).
By design, the Polymarket orderbook **does not** have trading size limits. It matches willing buyers and sellers of any amount.
However, there is no guarantee that it will be possible to transact a desired amount of shares without impacting the price significantly, or at all if there are no willing counterparties. Before trading in any market, especially in large size, it is valuable to look at the orderbook to understand depth of liquidity, ie how many buyers or sellers are in the market and their desired trade size and price.
In the Getting Started tutorial on [Making your First Trade](https://docs.polymarket.com/polymarket-learn/get-started/making-your-first-trade/), we learned about market orders.
But what if you think the market price is too high and want to set a specific price that you would be willing to accept? These are called [Limit Orders](https://docs.polymarket.com/polymarket-learn/trading/limit-orders/).
In this market, **“Presidential Election Winner 2024”**, we are viewing the order book for Trump <span style={{ backgroundColor: '#E5F8E6', color: '#27AE60', padding: '2px 4px', borderRadius: '4px' }}>Yes</span> shares.
The green side represents the <span style={{ backgroundColor: '#E5F8E6', color: '#27AE60', padding: '2px 4px', borderRadius: '4px' }}>Bids</span>: the highest price traders are willing to pay to buy Trump <span style={{ backgroundColor: '#E5F8E6', color: '#27AE60', padding: '2px 4px', borderRadius: '4px' }}>Yes</span>
shares.
The red side represents the <span style={{ backgroundColor: '#FEEEE5', color: '#F55A00', padding: '2px 4px', borderRadius: '4px' }}>Asks</span>: the lowest price traders are willing to accept to sell Trump <span style={{ backgroundColor: '#E5F8E6', color: '#27AE60', padding: '2px 4px', borderRadius: '4px' }}>Yes</span> shares.
<Tip>
Notice that there is a 0.3c gap between the highest bid and the lowest ask price. This is referred to as the spread.
</Tip>
## Managing open orders
When you have an open order, you'll find it displayed just below the Order Book on the market's page.
If you have open orders across multiple markets, you can easily manage and monitor them all from the [Portfolio page](https://polymarket.com/portfolio?tab=Open+orders).
## Canceling open orders
When you have an open order, you'll find it displayed just below the Order Book on the market's page.
To cancel the order, you can simply click the red **x** button alongside the order.
If you have open orders across multiple markets, you can easily manage and monitor them all from the [Portfolio page](https://polymarket.com/portfolio?tab=Open+orders).
Nice! You can officially call yourself an advanced trader.
<Tip>
If some of this still isn’t making sense, feel free to reach out to us on [Discord](https://discord.com/invite/polymarket). We’re happy to help get you up to speed.
| **Token** | A token represents a stake in a specific Yes/No outcome in a Market. The price of a token can fluctuate between $0 - $1 based on the market belief in the outcome. When a market resolves, the token associated with the correct prediction can be redeemed for \$1 USDC. This is also sometimes called an *Asset Id* |
| **Market** | A single event outcome. Corresponds to a pair of CLOB token IDs(Yes/No), a market address, a question ID and a condition ID. |
| **Event** | A collection of related markets grouped under a common topic or theme. |
| **SLUG** | A human readable identification for a market or event. Can be found in the URL of any Polymarket Market or Event. You can use this slug to find more detailed information about a market or event by using it as a parameter in the [Get Events](https://docs.polymarket.com/developers/gamma-markets-api/get-events) or [Get Markets](https://docs.polymarket.com/developers/gamma-markets-api/get-markets) endpoints. |
| **Negative Risk (negrisk)** | A group of Markets(Event) in which only one Market can resolve as yes. For more detail see [Negrisk Details](https://docs.polymarket.com/developers/neg-risk/overview) |
| **Central Limit Order Book** | The off-chain order matching system. This is where you place resting orders and market orders are matched with existing orders before being sent on-chain. |
| **Polygon Network** | A scalable, multi-chain blockchain platform used by Polymarket to facilitate on-chain activities(contract creation, token transfers, etc) |
This section of the documentation will provide all the essential resources to help you perform basic trading actions on the Polymarket platform. If you're just getting started, you're in the right place.
Everything you need to start building with the Polymarket API is right here. Let’s get started.
[Not sure what to build next? Get inspired by checking out real examples from other developers using the API.](https://docs.polymarket.com/quickstart/introduction/showcase)
All rate limits are enforced using Cloudflare's throttling system. When you exceed the maximum configured rate for any endpoint, requests are throttled rather than immediately rejected. This means:
* **Throttling**: Requests over the limit are delayed/queued rather than dropped
* **Burst Allowances**: Some endpoints allow short bursts above the sustained rate
* **Time Windows**: Limits reset based on sliding time windows (e.g., per 10 seconds, per minute)
Placing your first order using one of our two Clients is relatively straightforward.
For Python: `pip install py-clob-client`.
For Typescript: `npm install polymarket/clob-client` & `npm install ethers`.
After installing one of those you will be able to run the below code. Take the time to fill in the constants at the top and ensure you're using the proper signature type based on your login method.
<Tip>Many additional examples for the Typescript and Python clients are available [here(TS)](https://github.com/Polymarket/clob-client/tree/main/examples) and [here(Python)](https://github.com/Polymarket/py-clob-client/tree/main/examples) .</Tip>
<CodeGroup>
```python Python First Trade [expandable] theme={null}
from py_clob_client.client import ClobClient
from py_clob_client.clob_types import OrderArgs, OrderType
from py_clob_client.order_builder.constants import BUY
host: str = "https://clob.polymarket.com"
key: str = "" #This is your Private Key. Export from https://reveal.magic.link/polymarket or from your Web3 Extension
chain_id: int = 137 #No need to adjust this
POLYMARKET_PROXY_ADDRESS: str = '' #This is the address listed below your profile picture when using the Polymarket site.
#Select from the following 3 initialization options to match your login method, and remove any unused lines so only one client is initialized.
### Initialization of a client using a Polymarket Proxy associated with an Email/Magic account. If you login with your email use this example.
token_id="", #Token ID you want to purchase goes here. Example token: 114304586861386186441621124384163963092522056897081085884483958561365015034812 ( Xi Jinping out in 2025, YES side )
//Client initialization example and dumping API Keys
import { ApiKeyCreds, ClobClient, OrderType, Side, } from "@polymarket/clob-client";
import { Wallet } from "@ethersproject/wallet";
const host = 'https://clob.polymarket.com';
const funder = ''; //This is the address listed below your profile picture when using the Polymarket site.
const signer = new Wallet(""); //This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
//In general don't create a new API key, always derive or createOrDerive
const creds = new ClobClient(host, 137, signer).createOrDeriveApiKey();
tokenID: "", //Use https://docs.polymarket.com/developers/gamma-markets-api/get-markets to grab a sample token
price: 0.01,
side: Side.BUY,
size: 5,
feeRateBps: 0,
},
{ tickSize: "0.001",negRisk: false }, //You'll need to adjust these based on the market. Get the tickSize and negRisk T/F from the get-markets above
//Refer to the API documentation to locate a tokenID: https://docs.polymarket.com/developers/gamma-markets-api/fetch-markets-guide
//Example token: 114304586861386186441621124384163963092522056897081085884483958561365015034812 ( Xi Jinping out in 2025, YES side )
//{ tickSize: "0.001",negRisk: true },
OrderType.GTC,
);
console.log(resp2)
})();
```
</CodeGroup>
#### In addition to detailed comments in the code snippet, here are some more tips to help you get started.
* See the Python example for details on the proper way to initialize a Py-Clob-Client depending on your wallet type. Three exhaustive examples are given. If using a MetaMask wallet or EOA please see the resources [here](https://github.com/Polymarket/py-clob-client?tab=readme-ov-file), for instructions on setting allowances.
* When buying into a market you purchase a "Token" that token represents either a Yes or No outcome of the event. To easily get required token pairs for a given event we have provided an interactive endpoint [here](https://docs.polymarket.com/developers/gamma-markets-api/get-markets).
* Not enough USDC to perform the trade. See the formula at the bottom of [this](https://docs.polymarket.com/developers/CLOB/orders/orders) page for details.
key: str = "" #This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
chain_id: int = 137 #No need to adjust this
POLYMARKET_PROXY_ADDRESS: str = '' #This is the address you deposit/send USDC to to FUND your Polymarket account.
#Select from the following 3 initialization options to matches your login method, and remove any unused lines so only one client is initialized.
### Initialization of a client using a Polymarket Proxy associated with an Email/Magic account. If you login with your email use this example.
//Client initialization example and dumping API Keys
import {ClobClient, ApiKeyCreds } from "@polymarket/clob-client";
import { Wallet } from "@ethersproject/wallet";
const host = 'https://clob.polymarket.com';
const signer = new Wallet("YourPrivateKey"); //This is your Private Key. If using email login export from https://reveal.magic.link/polymarket otherwise export from your Web3 Application
// Initialize the clob client
// NOTE: the signer must be approved on the CTFExchange contract
const clobClient = new ClobClient(host, 137, signer);
(async () => {
const apiKey = await clobClient.deriveApiKey();
console.log(apiKey);
})();
```
</CodeGroup>
## Using those keys to connect to the Market or User Websocket