You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The upcoming
fastPathfeature 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
CompetitionPriceEstimatingwhich 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.