Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trivial] filter out empty solutions when quoting #2072

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

fleupold
Copy link
Contributor

Description

We are seeing a lot of WARN logs for orders that can't be quoted a la:

driver::infra::observe: failed to quote order order=Order { tokens: Tokens { sell: TokenAddress(ContractAddress(0xf939e0a03fb07f59a73314e73794be0e57ac1b4e)), buy: TokenAddress(ContractAddress(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)) }, amount: TargetAmount(100000000000000000), side: Buy, deadline: Deadline { driver: 2023-11-23T07:58:46.894119698Z, solvers: 2023-11-23T07:58:45.995982488Z } } err=QuotingFailed(ClearingSellMissing)

This is because some solvers instead of returning no solution return the "trivial" solution if they cannot solve the auciton:

solvers::api::routes::solve: auction_id=Quote solutions=[Solution { id: Id(0), prices: ClearingPrices({}), trades: [], interactions: [], score: RiskAdjusted(SuccessProbability(1.0)) }]

Since this warning looks a bit cryptic and we already do have an error for NoSolutions, this PR makes it that we instead show

/quote{solver=baseline}: driver::infra::observe: failed to quote order order=Order { tokens: Tokens { sell: TokenAddress(ContractAddress(0x15f74458ae0bfdaa1a96ca1aa779d715cc1eefe4)), buy: TokenAddress(ContractAddress(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)) }, amount: TargetAmount(100000000000000000), side: Buy, deadline: Deadline { driver: 2023-11-23T08:04:36.803626137Z, solvers: 2023-11-23T08:04:35.904046019Z } } err=QuotingFailed(NoSolutions)

Changes

Filter out empty solutions before passing them to create an invalid quote.

How to test

Run locally, get a quote which cannot be filled, observe logs

@fleupold fleupold requested a review from a team as a code owner November 23, 2023 08:05
@fleupold fleupold enabled auto-merge (squash) November 24, 2023 14:04
@fleupold fleupold merged commit d2fa208 into main Nov 24, 2023
7 of 8 checks passed
@fleupold fleupold deleted the filter_empty_solution_in_quote branch November 24, 2023 14:08
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants