Skip to main content
POST
/
2
/
pm
/
order
/
submit
Submit a signed V2 order to the CLOB
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>",
    "tokenId": "<string>",
    "makerAmount": "<string>",
    "takerAmount": "<string>",
    "side": "<string>",
    "signatureType": "<string>",
    "timestamp": "<string>",
    "metadata": "<string>",
    "builder": "<string>",
    "taker": "<string>",
    "expiration": "0"
  },
  "signature": "<string>",
  "apiKey": "<string>",
  "apiSecret": "<string>",
  "apiPassphrase": "<string>",
  "owner": "<string>",
  "orderType": "GTC"
}
'
{
  "hostname": "<string>",
  "took": 123,
  "data": "<unknown>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.mobula.io/llms.txt

Use this file to discover all available pages before exploring further.

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

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
signature
string
required
Minimum string length: 1
apiKey
string
required
Minimum string length: 1
apiSecret
string
required
Minimum string length: 1
apiPassphrase
string
required
Minimum string length: 1
owner
string
orderType
enum<string>
default:GTC
Available options:
GTC,
GTD,
FOK,
FAK

Response

201 - application/json

Prediction Markets response

hostname
string
required
took
number
required
data
any | null

See the per-endpoint reference for the exact response shape.