money-bill-trend-upPlace & Manage Orders

PredictBase allows users to place, update, and cancel orders programmatically using authenticated API requests.

All order-related endpoints require a user-bound API key and enforce strict ownership and status checks.


Authentication

All endpoints on this page require an API key passed via the request header:

x-api-key: YOUR_API_KEY

The API key must be authorized for the user performing the action.


Create a new Order

Places a new buy or sell order on an existing market.

Endpoint

POST /create-order

Full URL

https://api.predictbase.app/create-order

Request Body

{
  "kind": "NEW_ORDER",
  "order": {
    "type": "LIMIT",
    "side": "BUY",
    "marketId": "10744",
    "optionIndex": 0,
    "qty": 1,
    "price": 0.42,
    "userId": "0xUserAddress",
    "timeInForce": "GTC",
    "receivedAt": 1765595666776
  },
  "meta": {
    "clientOrderId": "ORD#abc123",
    "originalQty": 1
  }

Response (Success)


Update an Order

Updates the price of an existing order while it is still pending.

Endpoint

Full URL

Request Body

Response (Success)

Errors

Status
Meaning

400

Missing orderId, user, or price

409

Invalid status or user mismatch

500

Unexpected server error


Cancel an Order

Cancels an existing order that has not been fully filled.

Endpoint

Full URL

Response (Success)

Possible Errors

Status
Meaning

404

Order not found

403

User mismatch

400

Order status not cancelable

409

Order was filled or updated concurrently

500

Unexpected server error


View your Orders

Returns a list of user active orders.

Endpoint

Full URL

Response (Success)


Behavior

  • The user is resolved from the API key

  • Order prices are specified in USD (USDC) dollar value.

    • price = 0.42 means $0.42 USD (42 cents)

    • price = 1.00 means $1.00 USD

    • Prices must be between 0.00 and 1.00


💡 Common Use Cases

  • Trading bots

  • Market-making strategies

  • Order management dashboards

  • Automated re-pricing systems

Last updated