Skip to content

Return all successful quotes from CompetitionPriceEstimator#4664

Open
MartinquaXD wants to merge 3 commits into
mainfrom
return-multiple-quotes
Open

Return all successful quotes from CompetitionPriceEstimator#4664
MartinquaXD wants to merge 3 commits into
mainfrom
return-multiple-quotes

Conversation

@MartinquaXD

Copy link
Copy Markdown
Contributor

Description

The upcoming fastPath feature will allow the best quoter to win a short exclusivity period where it's allowed to settle an order immediately instead of waiting for it to be put into an auction.
The solvers is supposed to be rewarded as if it won a regular auction which means we need to know it's reference score (score compared to the second best quote).
To do that we now need to get multiple quotes from the CompetitionPriceEstimator.

Changes

Introduce CompetitionPriceEstimating which returns either an error or all quotes sorted from best to worst.

How to test

This PR does not introduce any wider logic changes since the quoter still just picks the best quote.
However, the unit tests got updated to show that all quotes now get returned in the expected order - instead of just asserting that the winning quote is correct.

@MartinquaXD
MartinquaXD requested a review from a team as a code owner July 23, 2026 14:33
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Claude finished @MartinquaXD's task in 3m 38s —— View job


PR Review: Return all successful quotes from CompetitionPriceEstimator

  • Read the PR diff and changed files
  • Analyze competition/mod.rs, quote.rs, order_quoting.rs changes
  • Post inline comments for issues found
  • Post review summary

The refactor is clean and self-consistent. The new CompetitionPriceEstimating trait / RankedEstimates type cleanly replaces the single-best-quote path, and the sort-then-take-first logic preserves the previous winner/error selection in the common case (best Ok wins; else highest-priority error; unreasonable Oks dropped; rest correctly contains only reasonable Oks in descending order). The de-duplication of the old repeated report_winner/is-ok check is a nice cleanup. Test updates correctly assert the full ranked ordering.

One thing worth confirming (inline): the switch from max_by to stable sort_by + take-first flips tie-break behavior — on equally-ranked results the winner is now the first candidate rather than the last. Harmless for "pick best quote", but since fastPath rewards the winning quoter, tie attribution may matter.

Nothing blocking from my side.

Note

I could not run cargo check/nextest in this environment (commands require approval), so compilation and test correctness were verified by static analysis only.
· return-multiple-quotes

Comment thread crates/price-estimation/src/competition/quote.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant