Skip to main content
POST /api/v1/market/create-market
Auth required: Yes (Admin) Creates a new prediction market on-chain. This endpoint is restricted to admin accounts. It deploys a new market contract via the factory, initializes the APMM pool, and creates option tokens.
This is an admin-only endpoint. Regular user accounts will receive a 403 error.

Request Body

title
string
required
Market question (e.g., “Will BTC exceed $100k by March 2026?”).
description
string
required
Detailed description and resolution criteria.
rules
string
required
Resolution rules — what data source is used and how the market resolves.
options
array
required
Array of option labels (minimum 2). Each option becomes a tradeable token.
categoryId
string
required
Category to place the market in.
tags
string[]
Tags for discoverability.
endTime
string
required
ISO 8601 timestamp for when the market stops accepting trades.
baseTokenAddress
string
required
Collateral token address (e.g., USDC).
initialLiquidity
string
required
Initial liquidity to seed the APMM pool (in base token units).
imageUrl
string
Market cover image URL.
userOperation
object
required
Signed ERC-4337 UserOperation for the on-chain deployment transaction.

Example Request

curl -X POST "https://api-staging.promethex.market/api/v1/market/create-market" \
  -H "Authorization: Bearer $ADMIN_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Will ETH reach $5000 by Q2 2026?",
    "description": "Resolves Yes if ETH/USD exceeds $5000...",
    "rules": "Resolution source: CoinGecko ETH/USD price...",
    "options": [
      { "title": "Yes" },
      { "title": "No" }
    ],
    "categoryId": "1",
    "tags": ["crypto", "ethereum"],
    "endTime": "2026-06-30T00:00:00Z",
    "baseTokenAddress": "0xUSDC...",
    "initialLiquidity": "50000000000",
    "userOperation": { ... }
  }'

Response

{
  "code": 0,
  "data": {
    "marketAddress": "0xNewMarket...1234",
    "opHash": "0xabcdef...",
    "options": [
      {
        "optionAddress": "0xOption1...aaaa",
        "title": "Yes"
      },
      {
        "optionAddress": "0xOption2...bbbb",
        "title": "No"
      }
    ]
  }
}
marketAddress
string
Newly deployed market contract address.
opHash
string
UserOperation hash to track the deployment transaction.
options
array
Created option tokens with their on-chain addresses.

Market Creation Flow

Admin                    PrometheX API             Blockchain
  │                          │                         │
  ├── POST /create-market ─► │                         │
  │                          ├── Submit UserOp ──────► │
  │                          │                         ├── Deploy market contract
  │                          │                         ├── Create option tokens
  │                          │                         ├── Initialize APMM pool
  │                          │  ◄── Tx confirmed ──── │
  │  ◄── { marketAddress } ─ │                         │
After creation, the market is in running status. It will appear in the public market list immediately after the on-chain transaction confirms.