Skip to main content

Core Order Types

UserOrder

Simplified order interface for users creating orders.
interface UserOrder {
  tokenID: string;
  price: number;
  size: number;
  side: Side;
  feeRateBps?: number;
  nonce?: number;
  expiration?: number;
  taker?: string;
}
tokenID
string
required
TokenID of the Conditional token asset being traded
price
number
required
Price used to create the order
size
number
required
Size in terms of the ConditionalToken
side
Side
required
Side of the order (BUY or SELL)
feeRateBps
number
Fee rate, in basis points, charged to the order maker, charged on proceeds
nonce
number
Nonce used for onchain cancellations
expiration
number
Timestamp after which the order is expired
taker
string
Address of the order taker. The zero address is used to indicate a public order

Example

const order: UserOrder = {
  tokenID: "0x123...",
  price: 0.52,
  size: 100,
  side: Side.BUY,
  feeRateBps: 5,
  nonce: 1,
  expiration: 1735689600,
  taker: "0x0000000000000000000000000000000000000000"
};

UserMarketOrder

Simplified market order interface for users.
interface UserMarketOrder {
  tokenID: string;
  price?: number;
  amount: number;
  side: Side;
  feeRateBps?: number;
  nonce?: number;
  taker?: string;
  orderType?: OrderType.FOK | OrderType.FAK;
}
tokenID
string
required
TokenID of the Conditional token asset being traded
price
number
Price used to create the order. If not present, the market price will be used.
amount
number
required
  • BUY orders: $$$ Amount to buy
  • SELL orders: Shares to sell
side
Side
required
Side of the order (BUY or SELL)
feeRateBps
number
Fee rate, in basis points, charged to the order maker, charged on proceeds
nonce
number
Nonce used for onchain cancellations
taker
string
Address of the order taker. The zero address is used to indicate a public order
orderType
OrderType.FOK | OrderType.FAK
Specifies the type of order execution:
  • FOK (Fill or Kill): The order must be filled entirely or not at all
  • FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled

Example

const marketOrder: UserMarketOrder = {
  tokenID: "0x123...",
  amount: 50,
  side: Side.BUY,
  orderType: OrderType.FOK
};

SignedOrder

Complete signed order ready for submission to the CLOB.
interface SignedOrder extends Order {
  readonly signature: OrderSignature;
}

interface Order extends EIP712Object {
  readonly salt: string;
  readonly maker: string;
  readonly signer: string;
  readonly taker: string;
  readonly tokenId: string;
  readonly makerAmount: string;
  readonly takerAmount: string;
  readonly expiration: string;
  readonly nonce: string;
  readonly feeRateBps: string;
  readonly side: Side;
  readonly signatureType: SignatureType;
}
signature
string
required
The order signature
salt
string
required
Unique salt to ensure entropy
maker
string
required
Maker of the order, i.e., the source of funds for the order
signer
string
required
Signer of the order
taker
string
required
Address of the order taker. The zero address is used to indicate a public order
tokenId
string
required
Token Id of the CTF ERC1155 asset to be bought or sold.
  • If BUY: tokenId of the asset to be bought (makerAssetId)
  • If SELL: tokenId of the asset to be sold (takerAssetId)
makerAmount
string
required
Maker amount, i.e., the max amount of tokens to be sold
takerAmount
string
required
Taker amount, i.e., the minimum amount of tokens to be received
expiration
string
required
Timestamp after which the order is expired
nonce
string
required
Nonce used for onchain cancellations
feeRateBps
string
required
Fee rate, in basis points, charged to the order maker, charged on proceeds
side
Side
required
The side of the order (BUY or SELL)
signatureType
SignatureType
required
Signature type used by the order

OrderData

Order data interface for creating orders before signing.
interface OrderData {
  maker: string;
  taker: string;
  tokenId: string;
  makerAmount: string;
  takerAmount: string;
  side: Side;
  feeRateBps: string;
  nonce: string;
  signer?: string;
  expiration?: string;
  signatureType?: SignatureType;
}
maker
string
required
Maker of the order, i.e., the source of funds for the order
taker
string
required
Address of the order taker. The zero address is used to indicate a public order
tokenId
string
required
Token Id of the CTF ERC1155 asset to be bought or sold.
  • If BUY: tokenId of the asset to be bought (makerAssetId)
  • If SELL: tokenId of the asset to be sold (takerAssetId)
makerAmount
string
required
Maker amount, i.e., the max amount of tokens to be sold
takerAmount
string
required
Taker amount, i.e., the minimum amount of tokens to be received
side
Side
required
The side of the order (BUY or SELL)
feeRateBps
string
required
Fee rate, in basis points, charged to the order maker, charged on proceeds
nonce
string
required
Nonce used for onchain cancellations
signer
string
Signer of the order. If not present, the signer is the maker of the order
expiration
string
Timestamp after which the order is expired. If not present, the value is “0” (no expiration)
signatureType
SignatureType
Signature type used by the order. Default value is “EOA”

NewOrder

Complete order structure for order creation.
interface NewOrder<T extends OrderType> {
  readonly order: {
    readonly salt: number;
    readonly maker: string;
    readonly signer: string;
    readonly taker: string;
    readonly tokenId: string;
    readonly makerAmount: string;
    readonly takerAmount: string;
    readonly expiration: string;
    readonly nonce: string;
    readonly feeRateBps: string;
    readonly side: Side;
    readonly signatureType: SignatureType;
    readonly signature: string;
  };
  readonly owner: string;
  readonly orderType: T;
  readonly deferExec: boolean;
  readonly postOnly?: boolean;
}

Order Enums

Side

Order side enumeration.
enum Side {
  BUY = "BUY",
  SELL = "SELL"
}
Also available as numeric enum from order-utils:
enum Side {
  BUY,
  SELL
}

Example

import { Side } from "@polymarket/clob-client";

const buyOrder = {
  side: Side.BUY,
  // ...
};

OrderType

Order execution type enumeration.
enum OrderType {
  GTC = "GTC",  // Good Till Cancel
  FOK = "FOK",  // Fill or Kill
  GTD = "GTD",  // Good Till Date
  FAK = "FAK"   // Fill and Kill
}
GTC
string
Good Till Cancel: Order remains active until filled or explicitly canceled
FOK
string
Fill or Kill: Order must be filled entirely or not at all
GTD
string
Good Till Date: Order remains active until a specified expiration date
FAK
string
Fill and Kill: Order can be partially filled, and any unfilled portion is canceled

Example

import { OrderType } from "@polymarket/clob-client";

const order = {
  orderType: OrderType.GTC,
  // ...
};

SignatureType

Signature type enumeration for order signing.
enum SignatureType {
  EOA,              // ECDSA EIP712 signatures signed by EOAs
  POLY_PROXY,       // EIP712 signatures signed by EOAs that own Polymarket Proxy wallets
  POLY_GNOSIS_SAFE  // EIP712 signatures signed by EOAs that own Polymarket Gnosis safes
}
EOA
number
ECDSA EIP712 signatures signed by Externally Owned Accounts
POLY_PROXY
number
EIP712 signatures signed by EOAs that own Polymarket Proxy wallets
POLY_GNOSIS_SAFE
number
EIP712 signatures signed by EOAs that own Polymarket Gnosis safes

Order Responses

OpenOrder

Represents an open order on the order book.
interface OpenOrder {
  id: string;
  status: string;
  owner: string;
  maker_address: string;
  market: string;
  asset_id: string;
  side: string;
  original_size: string;
  size_matched: string;
  price: string;
  associate_trades: string[];
  outcome: string;
  created_at: number;
  expiration: string;
  order_type: string;
}

Example

const openOrder: OpenOrder = {
  id: "0x456...",
  status: "LIVE",
  owner: "0x789...",
  maker_address: "0x789...",
  market: "0xabc...",
  asset_id: "0x123...",
  side: "BUY",
  original_size: "100",
  size_matched: "25",
  price: "0.52",
  associate_trades: ["0xdef..."],
  outcome: "Yes",
  created_at: 1735689600,
  expiration: "1735776000",
  order_type: "GTC"
};

OrderResponse

Response returned after posting an order.
interface OrderResponse {
  success: boolean;
  errorMsg: string;
  orderID: string;
  transactionsHashes: string[];
  status: string;
  takingAmount: string;
  makingAmount: string;
}
success
boolean
Whether the order was successfully posted
errorMsg
string
Error message if the order failed
orderID
string
Unique identifier for the order
transactionsHashes
string[]
Array of transaction hashes if the order was filled
status
string
Current status of the order
takingAmount
string
Amount taken in the order
makingAmount
string
Amount made in the order

OrderPayload

Simple order identifier payload.
interface OrderPayload {
  orderID: string;
}

Order Parameters

PostOrdersArgs

Arguments for posting an order.
interface PostOrdersArgs {
  order: SignedOrder;
  orderType: OrderType;
  postOnly?: boolean;
}
order
SignedOrder
required
The signed order to post
orderType
OrderType
required
Type of order execution (GTC, FOK, GTD, FAK)
postOnly
boolean
If true, the order will only be posted to the book and not immediately matched

OpenOrderParams

Filter parameters for querying open orders.
interface OpenOrderParams {
  id?: string;
  market?: string;
  asset_id?: string;
}
id
string
Filter by order ID
market
string
Filter by market condition ID
asset_id
string
Filter by asset/token ID

OrderMarketCancelParams

Parameters for canceling orders by market.
interface OrderMarketCancelParams {
  market?: string;
  asset_id?: string;
}
market
string
Cancel all orders in this market
asset_id
string
Cancel all orders for this asset ID

Order Utilities

OrderHash

Type alias for order hash.
type OrderHash = string;

OrderSignature

Type alias for order signature.
type OrderSignature = string;

CreateOrderOptions

Options for creating orders.
type CreateOrderOptions = {
  tickSize: TickSize;
  negRisk?: boolean;
};

type TickSize = "0.1" | "0.01" | "0.001" | "0.0001";
tickSize
TickSize
required
Tick size for the order (“0.1”, “0.01”, “0.001”, or “0.0001”)
negRisk
boolean
Whether the order is for a negative risk market

Example

const options: CreateOrderOptions = {
  tickSize: "0.01",
  negRisk: false
};

MakerOrder

Represents the maker side of a trade.
interface MakerOrder {
  order_id: string;
  owner: string;
  maker_address: string;
  matched_amount: string;
  price: string;
  fee_rate_bps: string;
  asset_id: string;
  outcome: string;
  side: Side;
}

Type Aliases

OpenOrdersResponse

type OpenOrdersResponse = OpenOrder[];
Array of open orders returned from the API.

Build docs developers (and LLMs) love