Solver endpoints
Your solver service must expose these HTTP endpoints:| Endpoint | Called by | Purpose |
|---|---|---|
POST /quote | Fisherman | Return a price for one user request. |
POST /solve | Fisherman | Return a settlement plan for a batch of active intents. |
POST /reveal | Fisherman | Reveal solution details (reserved, not required for current flow). |
POST /settle | Fisherman | Submit the winning certificate on-chain. |
POST /notify | Both | Report won, lost, failed, or settled status. |
application/json and must return JSON. Non-2xx responses are recorded as solver failures.
Registration
Fisherman seeds solver endpoints fromSOLVER_URLS. If set to https://solver.example.com, Fisherman calls https://solver.example.com/quote, /solve, etc.
Quote endpoint
Request (SolverQuoteRequest)
Response (QuoteResult)
Validation
Fisherman rejects a quote if:requestId,sellType,buyType, orsidediffers from the request- configured endpoint address does not match
solver estimatedFeeAmount > grossBuyAmountgrossBuyAmount - estimatedFeeAmount != netBuyAmountrecommendedMinAmountOut > netBuyAmountvalidUntilMs <= Date.now()side == exactInandsellAmount != request.amountside == exactOutandnetBuyAmount < request.amount
Timeout
Quote timeout per solver ismin(endpoint.timeoutMs, QUOTE_RESPONSE_WINDOW_MS). Default timeout is 5000 ms; default window is 1200 ms. Missing the window results in status: "failed".
Solve endpoint
Request (SolveRequest)
Response (SolveResponse)
Validation
Fisherman rejects a solution if:- no intent is included or length exceeds
maxBatchSize - token pair or epoch differs from the request
- parallel arrays have different lengths
expiresAtMs <= Date.now()- duplicate or unknown intent ids, or intent is not open
- fill is zero or exceeds the intent sell amount
grossPayoutis below the protected minimum- protected minimum is below
intent.minAmountOut scoreis not a bigint-compatible decimal string
Winner selection
Higherscore wins. Ties are broken by lower Fisherman solverEndpointId.
Settle endpoint
Fisherman callsPOST /settle on the winning solver with SettleRequest. The solver must:
- Verify the certificate belongs to its address and is not expired.
- Build a Sui programmable transaction using the certificate epoch.
- Submit settlement on-chain.
- Return an acknowledgement with the transaction digest.
EWrongEpoch abort in the contracts.
Notify endpoint
Fisherman sends notification events:HTTP status guidance
| Condition | Status |
|---|---|
| Intentional participation | 200 with valid JSON body |
| Cannot quote/solve the pair | Non-2xx |
| Degraded or shutting down | Non-2xx |
| Missing liquidity | Non-2xx |
invalid with a validation error.
Idempotency keys
| Operation | Idempotency key |
|---|---|
| Quote | requestId |
| Solve | auctionId |
| Settlement | certificate.id |
| Notification | (kind, auctionId, solutionId, certificateId) |
Required checklist
- Implement
POST /quote,/solve,/settle,/notify - Use decimal strings for all u64 values
- Preserve
requestIdexactly and echo token pair and side - Enforce quote expiry and user floors in solve responses
- Use a deterministic
solutionId - Return within
QUOTE_RESPONSE_WINDOW_MS - Add structured logs for
requestId,auctionId,solutionId, andcertificate.id
Related Topics
Join as a solver
Integration path and requirements.
Solver settlement
On-chain execution after winning.