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

Driver /quote response with JIT orders #3033

Closed
wants to merge 9 commits into from

Conversation

squadgazzz
Copy link
Contributor

@squadgazzz squadgazzz commented Oct 1, 2024

Description

Allows solvers to return pre-interactions and JIT orders with their quote. That way solvers could quote with CoW AMMs (require JIT orders and pre-interactions). They could also index the orderbook and return resting limit orders as JIT orders.

Changes

  • update driver -> autopilot/orderbook /quote reponse to pass a list of pre-interactions and a list of JIT orders
  • updated the openapi spec

How to test

New driver tests(I can't express more how I want the driver's test framework to become more friendly).

Fixes #3027

@squadgazzz squadgazzz force-pushed the 3027/driver-quote-response-jit-orders branch from beba8c2 to 996f487 Compare October 1, 2024 16:28
@squadgazzz squadgazzz changed the title [WIP] Driver quote response jit orders Driver quote response with jit orders Oct 2, 2024
@squadgazzz squadgazzz changed the title Driver quote response with jit orders Driver /quote response with JIT orders Oct 2, 2024
@squadgazzz squadgazzz marked this pull request as ready for review October 2, 2024 15:07
@squadgazzz squadgazzz requested a review from a team as a code owner October 2, 2024 15:07
Copy link
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that you already noticed that the driver test framework is a pain I think we should consider testing this with an e2e test instead.

crates/driver/src/tests/setup/mod.rs Outdated Show resolved Hide resolved
crates/driver/src/tests/setup/mod.rs Outdated Show resolved Hide resolved
crates/driver/src/tests/setup/mod.rs Outdated Show resolved Hide resolved
crates/driver/openapi.yml Outdated Show resolved Hide resolved
@squadgazzz
Copy link
Contributor Author

squadgazzz commented Oct 3, 2024

I think we should consider testing this with an e2e test instead.

The plan was to prepare an e2e test once autopilot and orderbook are prepared to handle the updated quote response. Does it make sense to have an e2e test with the current PR state?

Copy link
Contributor

@sunce86 sunce86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks reasonable, but as I mentioned, I can't find the reason why we need this data, how, when and by who will it be used. Is there a follow up PR?

type: string
signingScheme:
type: string
enum: ["eip712", "ethsign", "presign", "eip1271"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all these fields? Where are they used and by who?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need all the signed order data to verify quotes via simulations. Will happen in a follow up PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume fee_amount is forced to be 0 with the decision of not putting it in the list. Although, theoretically solvers can settle a JIT order with fee_amount != 0 leading to a different signature.

But still, probably not worth handling...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Let's not re-introduce fee_amount handling if we can avoid it. Hopefully fee_amount goes away entirely in the new contract anyway. 🤞

crates/driver/src/infra/api/routes/quote/dto/quote.rs Outdated Show resolved Hide resolved
@MartinquaXD
Copy link
Contributor

Does it make sense to have an e2e test with the current PR state?

Not yet. I'd say we can leave this PR unmerged until then since it's pretty straight forward. Once all the pieces are in place they can be merged together. WDYT?

Copy link
Contributor

@sunce86 sunce86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

Copy link

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

@squadgazzz
Copy link
Contributor Author

Will be reimplemented in scope of the #3082

@squadgazzz squadgazzz closed this Oct 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2024
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.

chore: Extend /quote response with pre-interactions and Jit orders
3 participants