Skip to main content

Solution Validation and Ranking

The current Reiy runtime ranks solver solutions in Fisherman, not in an on-chain allocation-selection phase. Fisherman validates solver responses, picks the highest valid score, signs a certificate, and asks the winning solver to settle on-chain.

Solve request

For each auction round, Fisherman sends enabled solvers a SolveRequest containing:
  • auctionId
  • sellType and buyType
  • epoch
  • deadlineMs
  • maxBatchSize
  • feeConfig
  • the grouped open intents
Compatible intents are grouped by sellType, buyType, and targetEpoch.

Solve response

A solver returns a SolveResponse with:
FieldMeaning
solverSolver identity.
solutionIdSolver-provided solution id.
sellType, buyTypeDirected token pair for the solution.
epochMust match the request epoch.
intentIdsIntents covered by the solution.
fillsFill amount per intent.
grossPayoutsGross payout per intent before protocol fees.
protectedMinsMinimum payout each intent must remain above.
scoreSolver-declared score used for ranking.
expiresAtMsSolution expiry.
counterOptional opposite-direction draft for CoW-cross settlement.

Fisherman validation

Fisherman rejects a solution before ranking if:
  • It is empty or exceeds maxBatchSize.
  • The token pair does not match the auction round.
  • The epoch does not match.
  • Vector lengths do not match.
  • The solution has already expired.
  • An intent id is duplicated or not in the round.
  • A covered intent is not open.
  • A fill is zero or greater than the intent sell amount.
  • grossPayout < protectedMin.
  • protectedMin < intent.minAmountOut.
  • score is not a valid integer string.
Invalid solver replies are stored as invalid solution records for observability.

Winner ranking

Fisherman sorts valid solutions by score: winner=arg maxvalid solutionsscore\begin{aligned} winner = \operatorname{arg\,max}_{valid\ solutions} score \end{aligned} If scores tie, Fisherman breaks the tie deterministically by solver endpoint id. The current implementation does not use on-chain PairBenchmark or Allocation objects for winner selection. It also does not expose an on-chain bid or selection phase gate.

Certificate signing

After ranking, Fisherman signs a certificate for the winning solver. The certificate binds:
  • protocol state id
  • config id
  • coordinator key version
  • live epoch
  • solution id
  • solver address
  • token types
  • intent ids
  • fills
  • gross payouts
  • protected minimums
  • expiry
For a CoW-cross solution, Fisherman can sign a linked counter certificate so both directions are submitted together.

Contract settlement checks

At settlement, the Move contracts verify:
  • the transaction sender is the signed solver
  • the solver is registered and has at least min_solver_stake
  • the coordinator signature is valid
  • the certificate has not expired
  • the certificate epoch is the live AuctionState.current_epoch
  • each intent target epoch matches the certificate epoch
  • intents are not expired and have not already been partial-filled in the same epoch
  • fill is valid for full or partial settlement
  • protectedMin >= intent.minAmountOut
  • protectedMin >= m_eff for the actual fill
  • delivered payout equals the signed grossPayout
  • payout after volume fee remains at or above protectedMin
If any check fails, the PTB aborts and escrow does not move.

Auction rounds and certificates

Current coordination lifecycle.

Fee formulas

Settlement fee calculation.
Last modified on June 23, 2026