Skip to main content
Place a market order to trade against available liquidity immediately, or use a limit order to specify a price and wait for a match. Before placing an order, choose an outcome token and confirm that the market is accepting orders. The examples below assume you already have a market object; to find or fetch one, see Discover Markets.
Given a market, read its outcome token IDs:

Limit Orders

A limit order specifies the price at which you are willing to trade and can rest on the book until it fills, expires, or you cancel it. Use one when price control matters more than immediate execution. A limit order also defines how long any unfilled amount remains active:
GTD orders expire one minute before their stated expiration as a security threshold. To set an effective lifetime of N seconds, use now + 60 + N. In addition, the expiration must be at least 3 minutes in the future — orders expiring sooner are rejected — so the minimum effective lifetime is about two minutes.

Place a Limit Order

Given a SecureClient, place the limit order and check its response:
1

Place the Order

First, call placeLimitOrder() with the price and number of shares. The price must follow the market’s minimum price increment, and the size must meet its minimum order size. Omit expiration for a GTC order or provide a Unix timestamp in seconds for a GTD order.
Both examples buy 10 shares at a price of 0.52 USD per share. The GTD order has an effective lifetime of one hour.
2

Check the Response

Then, check response.ok to determine whether the CLOB accepted the order:
An accepted response includes the order ID and one of these statuses. If the order fills fully or partially, the tradeIds collection identifies the resulting trades. When available, transactionsHashes contains their transaction hashes:A rejected order returns ok: false with a code and message.