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

Partial approvals with permittable tokens: caveats #5272

Open
2 tasks
elena-zh opened this issue Jan 9, 2025 · 0 comments
Open
2 tasks

Partial approvals with permittable tokens: caveats #5272

elena-zh opened this issue Jan 9, 2025 · 0 comments
Labels
Bug Something isn't working Medium Severity indicator. It causes some undesirable behavior, but the system is still functional

Comments

@elena-zh
Copy link

elena-zh commented Jan 9, 2025

Discussed in https://cowservices.slack.com/archives/C0361CDG8GP/p1736415591712009

  • ** 1. Subsequent SWAP orders cannot be executed**
  1. I've placed the 1st order with a permittable token, sold 3 USDC (approval amount of 3 usdc)
  2. When the order was pending, I placed the 2nd order with the same token pair to sell 4 USDC
  3. The 1st order got executed
  4. And now the 2nd order cannot be filled. However, However, it contains permittable hook inside of it. But the logs say about 'Insuff balance' error for this order
    image

Possible solution:

Leandro: Identify when the permit is no longer valid in the pending SWAP orders. We already do this for limit orders. Again, might not make much difference as users might not check their activity modal

Anxo: This is good, but probably we need some way to make it more visible that there's a problem with an order
On top I would add:
Swaps should be treated optimistically, meaning, if I send 2 I assume the 1st will be successful so I need to execute the second one.
Problem will be the edge case of the second executing before.


  • 2. No 'Insufficient approval' warning for already placed limit orders with an infinite approval amount

Tested with 0x9FA3c00a92Ec5f96B1Ad2527ab41B3932EFEDa58 account on Base

Limit orders with infinite approvals don't show 'Insufficient approval' warning when a swap with a limited approval gat executed before the limit order.

Example: the Limit order with an infinite approval does now show a warning after a Swap with a limited approval is executed.
image

Leandro: No, there used to be a warning if the permit was no longer valid. At least if the permit nonce was bumped

@elena-zh elena-zh changed the title Partial approvals with permittable tokens: subsequent orders with a permit hook cannot be executed Partial approvals with permittable tokens: subsequent orders cannot be executed Jan 9, 2025
@elena-zh elena-zh added Bug Something isn't working Medium Severity indicator. It causes some undesirable behavior, but the system is still functional labels Jan 9, 2025
@elena-zh elena-zh changed the title Partial approvals with permittable tokens: subsequent orders cannot be executed Partial approvals with permittable tokens: caveats Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Medium Severity indicator. It causes some undesirable behavior, but the system is still functional
Projects
None yet
Development

No branches or pull requests

1 participant