Skip to main content
POST
/
2
/
pm
/
order
/
submit
Submit signed prediction market order
curl --request POST \
  --url https://demo-api.mobula.io/api/2/pm/order/submit \
  --header 'Content-Type: application/json' \
  --data '
{
  "order": {
    "salt": "<string>",
    "maker": "<string>",
    "signer": "<string>",
    "taker": "<string>",
    "tokenId": "<string>",
    "makerAmount": "<string>",
    "takerAmount": "<string>",
    "expiration": "<string>",
    "nonce": "<string>",
    "feeRateBps": "<string>",
    "side": "<string>",
    "signatureType": "<string>"
  },
  "signature": "<string>",
  "apiKey": "<string>",
  "apiSecret": "<string>",
  "apiPassphrase": "<string>",
  "owner": "<string>",
  "orderType": "GTC"
}
'
{
  "data": {
    "success": true,
    "orderId": "<string>",
    "status": "live",
    "transactionsHashes": [
      "<string>"
    ]
  },
  "hostname": "<string>",
  "took": 123
}

Request Body

order
object
required
The order object from the Order Build response’s typedData.message.
signature
string
required
The EIP-712 signature of the order.
apiKey
string
required
CLOB API key (obtained from Auth Derive).
apiSecret
string
required
CLOB API secret (obtained from Auth Derive).
apiPassphrase
string
required
CLOB API passphrase (obtained from Auth Derive).
owner
string
Order owner address. Defaults to maker if not provided.
orderType
string
default:"GTC"
Order type: GTC (Good Til Cancelled), GTD (Good Til Date), or FOK (Fill Or Kill).

Response

data
object
CLOB order response.
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/submit" \
  -H "Content-Type: application/json" \
  -d '{
    "order": {
      "salt": "123456789",
      "maker": "0xYourSafeAddress",
      "signer": "0xYourWalletAddress",
      "taker": "0x0000000000000000000000000000000000000000",
      "tokenId": "71321...",
      "makerAmount": "35000000",
      "takerAmount": "100000000",
      "expiration": "0",
      "nonce": "0",
      "feeRateBps": "0",
      "side": "0",
      "signatureType": "0"
    },
    "signature": "0xabc123...",
    "apiKey": "your-clob-api-key",
    "apiSecret": "your-clob-api-secret",
    "apiPassphrase": "your-clob-passphrase",
    "orderType": "GTC"
  }'

Complete Trading Flow

// Prerequisites: account deployed, tokens approved, CLOB credentials obtained

// 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 order
const submitRes = await fetch('https://api.mobula.io/api/2/pm/order/submit', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    order: typedData.message,
    signature,
    apiKey: clobCredentials.apiKey,
    apiSecret: clobCredentials.apiSecret,
    apiPassphrase: clobCredentials.apiPassphrase,
    orderType: 'GTC'
  })
});
const result = await submitRes.json();

Body

application/json
order
object
required

The EIP-712 order struct

signature
string
required
apiKey
string
required
apiSecret
string
required
apiPassphrase
string
required
owner
string

Optional owner address

orderType
enum<string>
default:GTC
Available options:
GTC,
GTD,
FOK

Response

200 - application/json

Order submission result

data
object
hostname
string
took
number