Client Initialization
L2 methods require the client to initialize with a signer, signature type, API credentials, and funder address.- TypeScript
- Python
Order Creation and Management
createAndPostOrder
Convenience method that creates, signs, and posts a limit order in a single call. Use when you want to buy or sell at a specific price.Signature
The token ID of the outcome to trade.
The limit price for the order.
The size of the order.
The side of the order (buy or sell).
Optional fee rate in basis points.
Optional nonce for the order.
Optional expiration timestamp for the order.
Optional taker address.
Tick size for the order. One of
"0.1", "0.01", "0.001", "0.0001".Optional. Whether the market uses negative risk.
Whether the order was successfully placed.
Error message if the order was not successful.
The ID of the placed order.
Array of transaction hashes associated with the order.
The current status of the order.
The amount being taken in the order.
The amount being made in the order.
createAndPostMarketOrder
Convenience method that creates, signs, and posts a market order in a single call. Use when you want to buy or sell at the current market price.Signature
The token ID of the outcome to trade.
The amount for the market order.
The side of the order (buy or sell).
Optional price hint for the market order.
Optional fee rate in basis points.
Optional nonce for the order.
Optional taker address.
Optional order type override. Defaults to FOK.
Whether the order was successfully placed.
Error message if the order was not successful.
The ID of the placed order.
Array of transaction hashes associated with the order.
The current status of the order.
The amount being taken in the order.
The amount being made in the order.
postOrder
Posts a pre-signed order to the CLOB. Use withcreateOrder() or createMarketOrder() from L1 methods.
Signature
postOrders
Posts up to 15 pre-signed orders in a single batch.Signature
The pre-signed order to post.
The order type (e.g. GTC, FOK, FAK).
Optional. Whether to post the order as post-only. Defaults to false.
cancelOrder
Cancels a single open order.Signature
Array of order IDs that were successfully canceled.
Map of order IDs to reasons why they could not be canceled.
cancelOrders
Cancels multiple orders in a single batch.Signature
cancelAll
Cancels all open orders.Signature
cancelMarketOrders
Cancels all open orders for a specific market.Signature
Optional. The market condition ID to cancel orders for.
Optional. The token ID to cancel orders for.
Order and Trade Queries
getOrder
Get details for a specific order by ID.Signature
The unique order ID.
The current status of the order.
The API key of the order owner.
The on-chain address of the order maker.
The market condition ID the order belongs to.
The token ID the order is for.
The side of the order (BUY or SELL).
The original size of the order when it was placed.
The amount of the order that has been matched so far.
The limit price of the order.
Array of trade IDs associated with this order.
The outcome label for the order’s token.
Unix timestamp of when the order was created.
The expiration time of the order.
The order type (e.g. GTC, FOK, FAK, GTD).
getOpenOrders
Get all your open orders.Signature
Optional. Filter by order ID.
Optional. Filter by market condition ID.
Optional. Filter by token ID.
getTrades
Get your trade history (filled orders).Signature
Optional. Filter by trade ID.
Optional. Filter by maker address.
Optional. Filter by market condition ID.
Optional. Filter by token ID.
Optional. Return trades before this timestamp.
Optional. Return trades after this timestamp.
The unique trade ID.
The order ID of the taker side.
The market condition ID for the trade.
The token ID for the trade.
The side of the trade (BUY or SELL).
The size of the trade.
The fee rate in basis points.
The price at which the trade was matched.
The current status of the trade.
The time at which the trade was matched.
The time of the last update to this trade.
The outcome label for the traded token.
The bucket index for the trade.
The API key of the trade owner.
The on-chain address of the maker.
Array of maker order objects that participated in this trade. Each
MakerOrder contains the following fields:The maker order ID.
The API key of the maker order owner.
The on-chain address of the maker order maker.
The amount matched for this maker order.
The price of the maker order.
The fee rate in basis points for the maker order.
The token ID for the maker order.
The outcome label for the maker order’s token.
The side of the maker order (BUY or SELL).
The on-chain transaction hash for the trade.
Whether the authenticated user is the taker or a maker in this trade.
getTradesPaginated
Get trade history with pagination for large result sets.Signature
Array of trade objects for the current page.
The maximum number of trades returned per page.
The total number of trades matching the query.
Balance and Allowances
getBalanceAllowance
Get your balance and allowance for specific tokens.Signature
The type of asset to query. One of
"COLLATERAL" or "CONDITIONAL".Optional. The token ID to query (required when
asset_type is CONDITIONAL).The current balance for the specified asset.
The current allowance for the specified asset.
updateBalanceAllowance
Updates the cached balance and allowance for specific tokens.Signature
API Key Management
getApiKeys
Get all API keys associated with your account.Signature
Array of API key credential objects associated with the account.
deleteApiKey
Deletes (revokes) the currently authenticated API key.Signature
Notifications
getNotifications
Retrieves all event notifications for the authenticated user. Records are automatically removed after 48 hours.Signature
Unique notification ID.
The user’s API key, or an empty string for global notifications.
Type-specific payload data for the notification.
Optional Unix timestamp of when the notification was created.
Notification type (see below).
| Name | Value | Description |
|---|---|---|
| Order Cancellation | 1 | User’s order was canceled |
| Order Fill | 2 | User’s order was filled (maker or taker) |
| Market Resolved | 4 | Market was resolved |
dropNotifications
Mark notifications as read/dismissed.Signature
Array of notification IDs to dismiss.