https://exchange.jamesxu.dev
A machine-readable OpenAPI schema and Swagger UI are also available:
Public endpoints
No authentication required.| Method | Path | Purpose |
|---|---|---|
GET | /health | Service and persistence health |
GET | /api/v1/markets | List configured markets |
GET /health
GET /health
Returns the service status and current persistence state. No authentication required.Response fields
ok when persistence is disabled or ok. degraded when persistence is retrying, backpressured, or stopped.Always
exchange.Current server time in RFC 3339 format.
Current persistence status including mode.
GET /api/v1/markets
GET /api/v1/markets
Returns the list of all configured markets. No authentication required.
- Trader endpoints
- Admin endpoints
Trader routes require the
x-api-key header. API keys are provisioned by an admin and are prefixed with exch_.| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/user | Authenticated user profile |
GET | /api/v1/positions | User positions across markets |
GET | /api/v1/portfolio | Portfolio snapshot with PnL |
GET | /api/v1/leaderboard | Leaderboard ranked by marked net PnL |
GET | /api/v1/open-orders | Open orders, optional ?market= filter |
GET | /api/v1/fills | Fills, optional ?market= filter |
POST | /api/v1/orders | Submit a limit order |
PATCH | /api/v1/orders/{order_id} | Amend remaining quantity |
DELETE | /api/v1/orders/{order_id} | Cancel an order |
GET /api/v1/user
GET /api/v1/user
Returns the authenticated trader’s profile.
GET /api/v1/positions
GET /api/v1/positions
Returns all open positions for the authenticated trader.
net_quantityis a signed integer. Positive values are long, negative values are short.realized_pnlaccumulates as fills close or reduce the position.
GET /api/v1/portfolio
GET /api/v1/portfolio
Returns a portfolio snapshot including position limit and all current positions.
position_limit reflects the exchange-wide per-market net position limit of +/-1000.GET /api/v1/leaderboard
GET /api/v1/leaderboard
Returns traders ranked by their current marked net PnL. Marking uses settled prices, orderbook mid prices, or market reference prices.Query parameters
Optional. Maximum number of rows to return. Omit to return all traders.
GET /api/v1/open-orders
GET /api/v1/open-orders
Returns all resting open orders for the authenticated trader. Filter by market using the optional
market query parameter.Query parametersOptional. Filter results to a single market, e.g.
BTC-USD.GET /api/v1/fills
GET /api/v1/fills
Returns all fills for the authenticated trader. Filter by market using the optional
market query parameter.Query parametersOptional. Filter results to a single market, e.g.
BTC-USD.POST /api/v1/orders
POST /api/v1/orders
Submits a limit order. Returns the order, any fills that occurred, and whether the order is resting in the book.Request bodyResponse fields
Market symbol, e.g.
BTC-USD. Must follow the BASE-QUOTE format.BUY or SELL.Limit price. Must be greater than zero and align to the market’s
tick_size.Order quantity. Must be at least the market’s
min_order_quantity.The submitted order with its assigned
id and current remaining quantity.List of fills that occurred immediately on submission. Empty if the order rested.
true if the order has remaining quantity in the book after matching.PATCH /api/v1/orders/{order_id}
PATCH /api/v1/orders/{order_id}
Amends the remaining quantity of a resting order. You can only reduce Request body
remaining — increasing it is not allowed.Path parametersUUID of the resting order to amend.
New remaining quantity. Must be greater than zero and less than or equal to the current remaining.
DELETE /api/v1/orders/{order_id}
DELETE /api/v1/orders/{order_id}
Cancels a resting order. Returns the canceled order.Path parameters
UUID of the order to cancel.
Data model notes
sideisBUYorSELLprice,quantity, andremainingare unsigned 64-bit integers (u64)- The per-market net position limit is +/-1000
- Traders can sell from flat and go short; order admission is based on worst-case net exposure if all resting open orders were to execute
- Realized PnL is tracked on positions; no pre-seeded inventory or cash balance is required to open a long or short position
- Leaderboard ranking uses settled prices, orderbook marks, or market reference prices
- Pagination is not yet implemented