-
Notifications
You must be signed in to change notification settings - Fork 152
Reimplement sell=buy PoC PR #3894
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?
Conversation
de09f52 to
858ac73
Compare
| let pair = liquidity::TokenPair::try_new(self.tokens.sell(), self.tokens.buy()) | ||
| .expect("sell != buy by construction"); | ||
| iter::once(pair).collect() | ||
| fn liquidity_pairs(&self) -> Option<HashSet<liquidity::TokenPair>> { |
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.
Not related to your changes, but it's super confusing that the method is called liquidity_pairs (plural) when it only returns one pair. 😵💫
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.
I will figure out a more fitting name
| .await | ||
| .unwrap() | ||
| .unwrap(); | ||
| assert_eq!(quote_response.verified, order_quote.verified); |
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.
What are these asserts for? 🤔 What does it signify that the order has a verified quote and has metadata?
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.
These assertions are also present on the normal place_order_with_quote and it makes sure that the quote and order's quote are verified.
|
I think this PR needs to be converted to a draft, since more changes are expected. @m-sz , is that correct? |
|
Yep, had a bunch of 1:1s and will be adding feature flag to the whole change to control it in orderbook. |
|
I have updated the PR with CLI argument to orderbook to allow for same sell and buy tokens. |
Sell=buy token initiative
The ability to swap the same token pairs unlocks the potential for CoW to generally become a transaction relay service. This feature will allow users to execute pre- and post- interaction hooks as gasless transactions. The overall implementation has certain caveats:
Lift restrictions on sell=buy token
Based on input from @fhenneke: