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

Implement/move RiskCalculator to solvers crate #1899

Closed
Tracked by #1893
sunce86 opened this issue Sep 27, 2023 · 0 comments · Fixed by #1919
Closed
Tracked by #1893

Implement/move RiskCalculator to solvers crate #1899

sunce86 opened this issue Sep 27, 2023 · 0 comments · Fixed by #1919

Comments

@sunce86
Copy link
Contributor

sunce86 commented Sep 27, 2023

For colocated driver, risk parameters should be loaded within solvers crate. Then, RiskCalculator should be used to calculate the success_probability that will be forwarded to driver for Naive,Baseline,Dex solvers.

First, commit d43b05c should be reverted to enable reading the risk parameters.

@sunce86 sunce86 linked a pull request Oct 4, 2023 that will close this issue
sunce86 added a commit that referenced this issue Oct 12, 2023
# Description
Implements #1899

# Changes
Risk parameters are now part of `solvers` crate configuration.
Based on risk parameters, `success_probability` is calculated and
forwarded to `driver`.

This PR is aware of bad gas estimates used. Better gas estimates might
come from #1531
Currently, `Dex` and `Baseline` solvers are using these bad gas
estimates, while `Naive` solver returns `success_probability=1` since it
does not have any gas estimate.

# Release
Risk parameters need to be defined in the configuration. Risk parameters
should be extracted from
https://github.com/cowprotocol/services/blob/main/crates/solver/src/solver/risk_computation.rs#L53

IF we want to stop using bad gas estimates and just fallback to
`success_probability=1`, then risk parameters need to be set as
`[0,0,0,f64::MAX]`.
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 a pull request may close this issue.

1 participant