The orchestrator ↔ solver link is JSON over WebSocket. Solvers connect to
the orchestrator, complete an EIP-191 challenge/response handshake, then
receive quote-request commands and reply with prices (and, for non-_quote
commands, a signed EIP-712 commitment).
All frames are JSON text frames. There is no global envelope
discriminator: message types are identified by their top-level type
(handshake) or command (quote request) field, and solver responses are
identified by the direction of the connection.
Handshake timeout: 5 seconds.
Liveness: orchestrator sends a WebSocket PING every 20 seconds; solver
must answer PONG within 60 seconds or the connection is closed
(ClosePolicyViolation).
Production
Local development
Solver session. One connection per registered solver.
Orchestrator sends a random nonce on connect.
Available only on servers:
Accepts the following message:
Sent immediately on connect.
{
"type": "auth_challenge",
"nonce": "string"
}
Solver session. One connection per registered solver.
Solver returns an EIP-191 signature over the challenge.
Available only on servers:
Accepts the following message:
Solver's EIP-191 signature over the message `"OptionsMarket solver auth v1\nnonce: 0x<hex from challenge>"`, hashed with the standard `\x19Ethereum Signed Message:\n<len>...` prefix.
{
"type": "auth_response",
"signature": "string"
}
Solver session. One connection per registered solver.
Orchestrator accepts or rejects the auth.
Available only on servers:
Accepts the following message:
Acceptance (`auth_ok`) or rejection (`auth_reject`).
{
"type": "auth_ok",
"address": "string"
}
Solver session. One connection per registered solver.
Orchestrator broadcasts a quote request.
Available only on servers:
Accepts one of the following messages:
{
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
"command": "position_open_quote",
"payload": {
"asset": "BTC",
"lower_bound_ticks": 4294967295,
"upper_bound_ticks": 4294967295,
"maturity_hour": 4294967295
}
}
{
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
"command": "position_open",
"payload": {
"asset": "BTC",
"lower_bound_ticks": 4294967295,
"upper_bound_ticks": 4294967295,
"maturity_hour": 4294967295,
"buyer": "string",
"quantity": 1
}
}
{
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
"command": "position_close_quote",
"payload": {
"asset": "BTC",
"solver_id": 0,
"token_id": "string"
}
}
{
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
"command": "position_close",
"payload": {
"asset": "BTC",
"solver_id": 0,
"token_id": "string",
"user": "string",
"quantity": 1
}
}
Solver session. One connection per registered solver.
Solver replies with a price (and commitment, for non-quote commands).
Available only on servers:
Accepts the following message:
Reply to a quote command. `commitment_packed` and `commitment_signature` are present only for the non-`_quote` commands. Set `error` to decline a request.
{
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
"solver_name": "string",
"solver_id": 0,
"price": 0.1,
"commitment_packed": "string",
"commitment_signature": "string",
"error": "string"
}
Sent immediately on connect.
Solver's EIP-191 signature over the message `"OptionsMarket solver auth v1\nnonce: 0x<hex from challenge>"`, hashed with the standard `\x19Ethereum Signed Message:\n<len>...` prefix.
Acceptance (`auth_ok`) or rejection (`auth_reject`).
Reply to a quote command. `commitment_packed` and `commitment_signature` are present only for the non-`_quote` commands. Set `error` to decline a request.
ERC-1155 token ID as decimal string (uint256).