-
Notifications
You must be signed in to change notification settings - Fork 186
Align priceQuality implementation with API docs #4805
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -373,10 +373,29 @@ pub async fn run(config: Configuration) { | |
| ) | ||
| }; | ||
|
|
||
| let optimal_quoter = Arc::new( | ||
| let verified_quoter = Arc::new( | ||
| create_quoter(price_estimator.clone()).with_streaming_estimator(price_estimator.clone()), | ||
| ); | ||
|
|
||
| let unverified_price_estimator = price_estimator_factory | ||
| .unverified_price_estimator( | ||
| &config | ||
| .order_quoting | ||
| .price_estimation_drivers | ||
| .iter() | ||
| .map( | ||
| |price_estimator_driver| configs::native_price_estimators::ExternalSolver { | ||
| name: price_estimator_driver.name.clone(), | ||
| url: price_estimator_driver.url.clone(), | ||
| }, | ||
| ) | ||
| .collect::<Vec<_>>(), | ||
| native_price_estimator.clone(), | ||
| gas_price_estimator.clone(), | ||
| ) | ||
| .unwrap(); | ||
|
Comment on lines
+380
to
+396
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This let price_estimation_solvers: Vec<_> = config
.order_quoting
.price_estimation_drivers
.iter()
.map(|d| configs::native_price_estimators::ExternalSolver {
name: d.name.clone(),
url: d.url.clone(),
})
.collect();and pass |
||
| let optimal_quoter = Arc::new(create_quoter(unverified_price_estimator)); | ||
|
|
||
| // Fast quoting is able to return early and if none of the produced quotes are | ||
| // verifiable we are left with no quote at all. Since fast estimates don't | ||
| // make any promises on correctness we can just skip quote verification for | ||
|
|
@@ -418,7 +437,7 @@ pub async fn run(config: Configuration) { | |
| config.eip1271_skip_creation_validation, | ||
| deny_listed_tokens.clone(), | ||
| hooks_contract, | ||
| optimal_quoter.clone(), | ||
| verified_quoter.clone(), | ||
| balance_fetcher, | ||
| signature_validator, | ||
| validator_simulator, | ||
|
|
@@ -471,8 +490,9 @@ pub async fn run(config: Configuration) { | |
| *native_token.address(), | ||
| token_info_fetcher.clone(), | ||
| ) | ||
| .with_verified_quoter(verified_quoter.clone()) | ||
| .with_fast_quoter(fast_quoter) | ||
| .with_streaming_quoter(optimal_quoter.clone()); | ||
| .with_streaming_quoter(verified_quoter.clone()); | ||
|
|
||
| let (shutdown_sender, shutdown_receiver) = tokio::sync::oneshot::channel(); | ||
| let serve_api = serve_api( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit