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
| Name | Type | Required | Description |
|---|---|---|---|
id | STRING | YES | Market identifier (e.g. DFUSDT). Case-sensitive. Must be unique — returns 409 MARKET_EXISTS on collision. |
base_token | STRING | YES | Base token symbol (e.g. DF). |
quote_token | STRING | YES | Quote token symbol (e.g. USDT). |
tick_size | DECIMAL | YES | Minimum price increment as a string (e.g. "0.0001"). |
lot_size | DECIMAL | YES | Minimum quantity increment as a string (e.g. "0.01"). |
min_notional | DECIMAL | YES | Minimum order notional value (price * quantity) as a string (e.g. "1"). |
maker_fee_bps | NUMBER | YES | Maker fee in basis points (integer). 0 for fee-free. |
taker_fee_bps | NUMBER | YES | Taker fee in basis points (integer). 0 for fee-free. |
Response Example
200 OK
{
"ok": true,
"id": "DFUSDT"
}
| Field | Notes |
|---|---|
ok | Always true on success. |
id | The market id that was created, echoed back. |
Error Responses
| HTTP | error | When |
|---|---|---|
409 | MARKET_EXISTS | A market with this id already exists. |
500 | DB_ERROR | Unexpected 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"])