Order creation requires both JWT authentication and an API key. Make sure to include both the
Authorization: Bearer <token> header and the x-api-key header in your requests.Order Types
Buy Orders:- Purchase market positions (e.g., buying “yes” on a market)
- Requires USDC balance in your smart wallet
- When filled, ERC-1155 tokens are minted to your wallet
- Sell existing market positions
- Requires ERC-1155 token balance in your smart wallet
- When filled, tokens are burned from your wallet
Order Flow
Orders progress through these stages automatically:-
Create Order - Submit order details via API
- Market ID, side, quantity, price
- For buy orders: quote amount (USDC to lock)
- Order is created with status “pending”
-
Balance Validation - System validates and locks required funds
- Buy orders: Locks USDC in your smart wallet
- Sell orders: Validates you hold the required ERC-1155 tokens
- Status changes to “validated”
-
Prediction Market Execution - Order is placed on the prediction market exchange
- Order submitted to the prediction market with your credentials
- Prediction market order ID is stored
- Status changes to “placed”
-
Fill Detection - System monitors for order fills
- Polls the prediction market API for fill status
- When filled, captures fill details (price, quantity, cost)
- Status changes to “filled”
-
On-chain Execution - Tokens are minted or burned
- Buy orders: ERC-1155 tokens minted to your wallet
- Sell orders: ERC-1155 tokens burned from your wallet
- Transaction hash is stored
- Status changes to “txn_filled” then “completed”
Order Parameters
- Market ID - The prediction market identifier
- Side - The outcome side (“yes”, “no”, etc.)
- Order Type - “buy” or “sell”
- Quantity - Number of contracts/shares
- Price - Price in cents (1-99), limit price with slippage tolerance
- Quote Amount - USDC amount to lock (required for buy orders only)
