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

feat: Balance Check for Quote Verification #1962

Closed
nlordell opened this issue Oct 13, 2023 · 1 comment
Closed

feat: Balance Check for Quote Verification #1962

nlordell opened this issue Oct 13, 2023 · 1 comment
Labels
E:3.2 Verified Quotes See https://github.com/cowprotocol/pm/issues/15 for details

Comments

@nlordell
Copy link
Contributor

Background

We currently require balances for quote verification. This adds additional overhead to clients that need to decide what kind of quote to make to the API. This is an issue for external integrations (for example DeFi Llama) where implementing quoting logic changes is more difficult and partially outside of our control.

Details

In the interim, however, we can change the trade simulation Solidity code to first check the trader has sufficient balance and:

  • If it does, then simulate as we do now
  • If it does not, return early and pretend the simulation passed and use the indicative amounts and gas usage for the quote

This would allow quotes to work from accounts without balance (for example, CoW Swap UI with a disconnected account) while still keeping the full benefit for

Note that there could be some abuse where a client could get a quote with an account without balance in order to "lock in" a fee using indicative (and not real) gas amounts, but I don't believe that this will be abused extensively in practice.

@nlordell nlordell changed the title chore: improvement: Balance Check for Quote Verification Oct 13, 2023
@nlordell nlordell added the E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details label Oct 13, 2023
@nlordell nlordell changed the title improvement: Balance Check for Quote Verification feat: Balance Check for Quote Verification Oct 13, 2023
@fleupold fleupold added E:3.2 Verified Quotes See https://github.com/cowprotocol/pm/issues/15 for details and removed E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details labels Oct 16, 2023
@MartinquaXD
Copy link
Contributor

Implemented in #2330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:3.2 Verified Quotes See https://github.com/cowprotocol/pm/issues/15 for details
Projects
None yet
Development

No branches or pull requests

3 participants