API Reference

REST Endpoints

The backend exposes a REST API — http://localhost:4000 locally, or https://hyperdex.onrender.com live. Maker bids are sent over the WebSocket (not REST); admin endpoints are gated to the admin wallet. Amounts are in stroops (1 token = 1e7).

GET/health

System health. Returns active maker count and DB status.

Response

{ "status":"ok", "activeMakers":1, "priceBookEntries":1, "dbStatus":"connected" }
POST/api/quote

Single-shot quote — dispatches an RFQ and returns the best signed quote.

Request Body

{ "tokenIn":"EURC_SAC", "tokenOut":"USDC_SAC", "amountIn":"200000000", "takerAddress":"GABIR…" }

Response

{ "success":true, "quote":{ "quoteId":"…", "amountOut":"…", "signature":"hex", … } }
POST/api/quote/start

Opens a 30-second sealed-bid auction to all connected makers.

Request Body

{ "tokenIn":"EURC_SAC", "tokenOut":"USDC_SAC", "amountIn":"200000000", "takerAddress":"GABIR…" }

Response

{ "auctionId":"uuid", "makerCount":2 }
GET/api/quote/result/:auctionId

Poll until the auction window closes; returns the winning quote.

Response

{ "status":"completed", "bestQuote":{…}, "quotesReceived":2, "makerName":"Alpha MM" }
POST/api/quote/confirm

Notify the backend of the on-chain settlement tx hash.

Request Body

{ "quoteId":"…", "txHash":"…", "takerAddress":"G…" }

Response

{ "success":true }
GET/api/makers

Lists all makers with WebSocket connection status.

Response

[ { "address":"G…", "name":"Alpha MM", "connectionStatus":"connected", "poolAddress":"C…" } ]
GET/api/makers/:address/inventory

Returns a maker pool’s USDC + EURC balances.

Response

{ "usdc":"1000.0000000", "eurc":"500.0000000", "poolAddress":"C…" }
POST/api/makers/apply

Submit a maker registration application.

Request Body

{ "stellarAddress":"G…", "name":"My MM", "contactEmail":"…", "supportedPairs":[…] }

Response

{ "applicationId":"uuid", "status":"pending" }
GET/api/admin/pendingAdmin wallet

Lists all pending maker applications.

Response

{ "applications":[…], "total":1 }
POST/api/admin/pending/:id/approveAdmin wallet

Approves an application and returns a one-time API key.

Response

{ "apiKey":"sk_live_xxx" }
POST/api/admin/pending/:id/rejectAdmin wallet

Rejects a maker application.

Request Body

{ "reason":"Insufficient inventory" }

Response

{ "status":"rejected" }
HyperDex | Trade Without Limits