API overview
The Opshuns API is an Elixir/Phoenix JSON service. Base URL for this docs build (set DOCS_API_URL in env):
https://api.testnet.opshuns.com
WebSockets use the same host on /socket (Phoenix Channels).
What the API does
| Area | Purpose |
|---|---|
| Auth | SIWE login → bearer token (or maker API key) |
| Options RFQ | Takers open short quote windows; makers post EIP-712 signed offers (FillMatched on-chain) |
| On-chain fills | Also FixedPackage, Dutch auction, and Authority — see fill modes |
| CLOB | Resting book + bilateral fillMatched — CLOB |
| Pubsub | Register for chain-scoped request feeds and private maker streams |
| Networks | Public registry of chain IDs, RPCs, and contract addresses |
| Indexer / portfolio | On-chain CLOB discovery, status, and wallet snapshots (Postgres-backed) |
| Orders | Record CLOB orders and issue exclusive fills |
| Borrow RFQ | Coming soon. Borrowers post collateral; lenders post signed loan offers |
Quote sessions themselves are ephemeral (in-memory processes). Config (networks, maker orgs, keys) lives in Khepri. Indexer data lives in Postgres.
Conventions
- JSON request/response bodies
- Ethereum addresses are normalized lowercase
0x… - Large integers (amounts, strikes, nonces) are often decimal strings
- Authenticated routes:
Authorization: Bearer <token-or-maker-key> - Errors:
{ "error": "…" }with appropriate HTTP status
Endpoint map (high level)
Public
| Method | Path | Notes |
|---|---|---|
GET | /api/health | Liveness |
GET | /api/login/nonce | SIWE challenge |
POST | /api/login | Exchange signed SIWE message for token |
GET | /api/networks | Chains + contracts |
GET | /api/payment-tokens | Payment token metadata (testnet faucet, quote defaults) |
GET | /api/default-premium-tokens | Default premium tokens |
GET | /api/recommended-min-notional | Suggested minimum notionals |
GET | /api/landing-page-settings | Trading landing CMS (networks, premium + payment tokens) |
GET | /api/filler-page-settings | Maker/filler page CMS content |
GET | /api/bond-requirements | Premium / exclusive-fill bond minima per token |
POST | /api/quote | Create options RFQ (no login). Spread payloads |
GET | /api/quote/:id | Poll quote (stream token required) |
POST | /api/orders | Create a CLOB order record. Orders |
GET | /api/indexer/status | Indexer health |
GET | /api/indexer/cores | Discovered CLOB addresses |
GET | /api/portfolio/:address | Portfolio across networks (?chain_id= optional) |
POST | /api/maker/applications | Apply to become a maker org (login optional) |
Authenticated
| Method | Path | Notes |
|---|---|---|
GET | /api/me | Session / maker role (admin / owner / manager / member) |
POST | /api/pubsub/premium | Maker pubsub registration |
POST | /api/pubsub/freemium | Freemium pubsub registration |
POST | /api/quote/:id | Maker options offer |
POST | /api/exclusive-fill | Maker exclusive fill over order ids |
Maker org admin
| Method | Path | Notes |
|---|---|---|
GET | /api/maker/keys | List member keys |
POST | /api/maker/keys | Issue a member key (signed admin action) |
DELETE | /api/maker/keys/:id | Revoke a key (signed admin action) |
PUT | /api/maker/organization | Transfer org admin (signed transfer_admin) |
Coming soon (Borrow)
Borrow is not live. These routes are the planned surface and may change.
| Method | Path | Notes |
|---|---|---|
POST | /api/margin/quote | Create Borrow RFQ (planned, no login) |
GET | /api/margin/quote/:id | Poll Borrow quote (stream token) |
POST | /api/margin/quote/:id | Lender Borrow offer (maker auth) |
POST | /api/margin/quote/:id/select | Borrower selects a loan offer |
Deprecated
Legacy announcement quotes (/api/quotes*) return 410 Gone. Use /api/quote.
POST /api/premium/activate returns 410 Gone (maker orgs replaced premium bonds for API access).
Next
- API-only option quotes — submit each spread as intents; polarity + structure hashed with the taker address
- Orders & exclusive fills
- Authentication
- WebSockets & pubsub
- Networks & settings
- Market maker overview