Skip to main content

Create Market

Description

Create a new spot market. The new market is immediately queryable and tradeable — no restart required. Status defaults to listed.

Admin only. Requires the ADMIN_API_KEY environment variable to be set on the server and passed as X-API-Key in the request header.

HTTP Request

POST /admin/spot/markets (X-API-Key: ADMIN_API_KEY)

Weight

0 — admin endpoints have no weight limit. Each market mutation pings the engine with a ReloadMarket command so the in-memory MarketCache picks up the change without restart.

Request Parameters

NameTypeRequiredDescription
idSTRINGYESMarket identifier (e.g. DFUSDT). Case-sensitive. Must be unique — returns 409 MARKET_EXISTS on collision.
base_tokenSTRINGYESBase token symbol (e.g. DF).
quote_tokenSTRINGYESQuote token symbol (e.g. USDT).
tick_sizeDECIMALYESMinimum price increment as a string (e.g. "0.0001").
lot_sizeDECIMALYESMinimum quantity increment as a string (e.g. "0.01").
min_notionalDECIMALYESMinimum order notional value (price * quantity) as a string (e.g. "1").
maker_fee_bpsNUMBERYESMaker fee in basis points (integer). 0 for fee-free.
taker_fee_bpsNUMBERYESTaker fee in basis points (integer). 0 for fee-free.

Response Example

200 OK

{
"ok": true,
"id": "DFUSDT"
}
FieldNotes
okAlways true on success.
idThe market id that was created, echoed back.

Error Responses

HTTPerrorWhen
409MARKET_EXISTSA market with this id already exists.
500DB_ERRORUnexpected Postgres error during the insert. Investigate server logs.

Full list: Error Codes.

Code Examples

cURL

ADMIN_API_KEY="your_admin_api_key"

curl -s -X POST "https://api-sepolia.p99.world/api/v1/admin/spot/markets" \
-H "X-API-Key: ${ADMIN_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"id": "DFUSDT",
"base_token": "DF",
"quote_token": "USDT",
"tick_size": "0.0001",
"lot_size": "0.01",
"min_notional": "1",
"maker_fee_bps": 0,
"taker_fee_bps": 0
}'

Python

import requests

ADMIN_API_KEY = "your_admin_api_key"
BASE_URL = "https://api-sepolia.p99.world/api/v1"

def admin_post(path: str, body: dict) -> dict:
r = requests.post(
f"{BASE_URL}{path}",
json=body,
headers={"X-API-Key": ADMIN_API_KEY, "Content-Type": "application/json"},
timeout=5,
)
r.raise_for_status()
return r.json()

result = admin_post("/admin/spot/markets", {
"id": "DFUSDT",
"base_token": "DF",
"quote_token": "USDT",
"tick_size": "0.0001",
"lot_size": "0.01",
"min_notional": "1",
"maker_fee_bps": 0,
"taker_fee_bps": 0,
})
print(result["ok"], result["id"])