Skip to main content
Alpha — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.

Request Body

maker
string
required
Your EOA wallet address. The Safe trading address is derived automatically and returned in safeAddress.
signer
string
Signer address. For Safe wallets (signatureType 2), this is your EOA address. Defaults to maker if not provided.
tokenId
string
required
The outcome token ID to trade.
side
string
required
Order side: BUY or SELL.
price
number
required
Order price (must be greater than 0 and at most 1).
size
number
required
Number of tokens to buy or sell. Must be positive.
isNegRisk
boolean
default:false
Set to true for neg-risk (multi-outcome) markets.
feeRateBps
number
default:0
Fee rate in basis points (0 = no fee).
nonce
number
default:0
Order nonce for replay protection.
expiration
number
default:0
Expiration timestamp in seconds. 0 means no expiration.
tickSize
number
Tick size for rounding. If omitted, uses market default.
signatureType
number
default:0
Signature type. Use 0 for EOA signatures, 2 for EIP-1271 (Safe wallet) signatures.

Response

data
object
Order typed data and metadata.
hostname
string
Server node identifier.
took
number
Request processing time in milliseconds.

Usage Example

curl -X POST "https://api.mobula.io/api/2/pm/order/build" \
  -H "Content-Type: application/json" \
  -d '{
    "maker": "0xYourWalletAddress",
    "tokenId": "71321045533314185944161150504789982525459828614995786377552078351132518100924",
    "side": "BUY",
    "price": 0.35,
    "size": 100,
    "isNegRisk": false
  }'

Integration Example

// 1. Build order
const buildRes = await fetch('https://api.mobula.io/api/2/pm/order/build', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    maker: walletAddress,
    tokenId: outcomeTokenId,
    side: 'BUY',
    price: 0.35,
    size: 100
  })
});
const { data: { typedData } } = await buildRes.json();

// 2. Sign the order
const signature = await walletClient.signTypedData(typedData);

// 3. Submit the signed order (see Order Submit)
The makerAmount and takerAmount in the order message are computed from price and size:
  • BUY: makerAmount = price * size (USDC you pay), takerAmount = size (tokens you receive)
  • SELL: makerAmount = size (tokens you give), takerAmount = price * size (USDC you receive)
Both amounts are in 6-decimal fixed-point format (multiplied by 10^6).
Order endpoints currently support Polymarket only. The platform parameter is not required — all orders are routed to Polymarket’s CLOB on Polygon.