wenrange Orchestrator API (1.0.0)

Download OpenAPI specification:

The orchestrator brokers quote requests between users and solvers. It exposes REST endpoints to the UI for spot price and for buy / buyback quotes, and a WebSocket server for solvers (documented separately as AsyncAPI).

This service holds no funds and cannot sign commitments. Quote responses are signed by the winning solver; the UI submits them directly to the on-chain OptionsMarket contract.

Health

Liveness probes.

Liveness probe

Always returns {"ok": true} while the service is running.

Responses

Response samples

Content type
application/json
{
  • "ok": true
}

Spot

Live spot price (sourced from Pyth Hermes).

Current spot price

Returns the orchestrator's current view of the asset's spot price. Sourced from a streaming Pyth Hermes SSE feed. Returns 503 until the upstream feed delivers its first sample.

Responses

Response samples

Content type
application/json
{
  • "asset": "BTC",
  • "price": 67432.5,
  • "as_of": "2026-05-27T14:30:45.123Z"
}

Quotes

Buy and buyback quoting. The */quote variants return price only; the full variants additionally return a signed commitment ready to submit on-chain.

Quote a new position (price only)

Broadcasts a buy-quote request to all connected solvers and returns the best (lowest) price. The orchestrator waits a short listening window (~500ms) for solver responses.

This variant does not return a signed commitment. Use /position/open when the user is ready to submit a transaction.

Request Body schema: application/json
required
asset
required
string

Asset identifier. Must match a deployed market. Case-normalized.

lower_bound
integer or null <int64>

Lower price bound in quote-token units. Must be a non-negative multiple of the per-asset tick_size (e.g. 100 for BTC). Use null for open-below ranges.

upper_bound
integer or null <int64>

Upper price bound in quote-token units. Must be a positive multiple of the per-asset tick_size. Use null for open-above ranges.

expire
required
string

Maturity in UTC, formatted YYYY-MM-DD HH:mm, always on the hour (mm=00). Must be at least the next full hour.

Responses

Request samples

Content type
application/json
{
  • "asset": "BTC",
  • "lower_bound": 50000,
  • "upper_bound": 80000,
  • "expire": "2026-05-28 18:00"
}

Response samples

Content type
application/json
{
  • "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
  • "solver_name": "reference-solver",
  • "solver_id": 1,
  • "price": 0.42
}

Quote a new position (with signed commitment)

Same as /position/open/quote but additionally returns the winning solver's signed commitment, packed and ready to submit to OptionsMarket.buy(packed, signature) on-chain.

The commitment binds to the buyer address — only a transaction from that address can submit it.

Request Body schema: application/json
required
asset
required
string

Asset identifier. Must match a deployed market. Case-normalized.

lower_bound
integer or null <int64>

Lower price bound in quote-token units. Must be a non-negative multiple of the per-asset tick_size (e.g. 100 for BTC). Use null for open-below ranges.

upper_bound
integer or null <int64>

Upper price bound in quote-token units. Must be a positive multiple of the per-asset tick_size. Use null for open-above ranges.

expire
required
string

Maturity in UTC, formatted YYYY-MM-DD HH:mm, always on the hour (mm=00). Must be at least the next full hour.

buyer
required
string (EthereumAddress) ^0x[0-9a-fA-F]{40}$

Ethereum address, 0x-prefixed 40-hex (mixed-case checksum accepted).

quantity
required
integer <int64> >= 1

Number of units to buy.

Responses

Request samples

Content type
application/json
{
  • "asset": "BTC",
  • "lower_bound": 50000,
  • "upper_bound": 80000,
  • "expire": "2026-05-28 18:00",
  • "buyer": "0x1234567890AbCdEf1234567890AbCdEf12345678",
  • "quantity": 10
}

Response samples

Content type
application/json
{
  • "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
  • "solver_name": "reference-solver",
  • "solver_id": 1,
  • "price": 0.42,
  • "commitment_packed": "0x000000000000000000000000000000000000000000000000000000000000000a...",
  • "commitment_signature": "0xabc..."
}

Quote a buyback (price only)

Broadcasts a buyback-quote request to all connected solvers (including the original issuer) and returns the best (highest) price. Issuers typically win because closing their own position releases their frozen collateral.

Request Body schema: application/json
required
asset
required
string
solver_id
required
integer <int32> >= 0

Issuing solver's registry ID.

token_id
required
string (TokenID) ^[0-9]+$

ERC-1155 position token ID as a decimal string. The ID packs lowerBound, upperBound, maturityHour, and solverId into the low 16 bytes of a uint256; see the Protocol reference.

Responses

Request samples

Content type
application/json
{
  • "asset": "BTC",
  • "solver_id": 1,
  • "token_id": "1234567890123456789012345678901234567890"
}

Response samples

Content type
application/json
{
  • "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
  • "solver_name": "reference-solver",
  • "solver_id": 1,
  • "price": 0.42
}

Quote a buyback (with signed commitment)

Same as /position/close/quote but additionally returns the winning solver's signed commitment, ready to submit to OptionsMarket.buyback(packed, signature) on-chain.

The commitment binds to the user address — only a transaction from that address can submit it.

Request Body schema: application/json
required
asset
required
string
solver_id
required
integer <int32> >= 0

Issuing solver's registry ID.

token_id
required
string (TokenID) ^[0-9]+$

ERC-1155 position token ID as a decimal string. The ID packs lowerBound, upperBound, maturityHour, and solverId into the low 16 bytes of a uint256; see the Protocol reference.

user
required
string (EthereumAddress) ^0x[0-9a-fA-F]{40}$

Ethereum address, 0x-prefixed 40-hex (mixed-case checksum accepted).

quantity
required
integer <int64> >= 1

Number of units to sell back.

Responses

Request samples

Content type
application/json
{
  • "asset": "BTC",
  • "solver_id": 1,
  • "token_id": "1234567890123456789012345678901234567890",
  • "user": "0x1234567890AbCdEf1234567890AbCdEf12345678",
  • "quantity": 10
}

Response samples

Content type
application/json
{
  • "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
  • "solver_name": "reference-solver",
  • "solver_id": 1,
  • "price": 0.42,
  • "commitment_packed": "0x000000000000000000000000000000000000000000000000000000000000000a...",
  • "commitment_signature": "0xabc..."
}