-
Notifications
You must be signed in to change notification settings - Fork 101
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: make hooks use partially fillable by default #5086
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: apps/cowswap-frontend/src/modules/hooksStore/containers/HooksStoreWidget/index.tsx
📄 File: apps/cowswap-frontend/src/modules/hooksStore/hooks/useSetupHooksStoreOrderParams.ts (Click to Expand)
📄 File: apps/cowswap-frontend/src/modules/swap/containers/SwapWidget/index.tsx (Click to Expand)
📄 File: apps/cowswap-frontend/src/modules/swap/hooks/useSwapButtonContext.ts (Click to Expand)
📄 File: apps/cowswap-frontend/src/modules/swap/hooks/useSwapFlowContext.ts (Click to Expand)
Did you find this useful? React with a 👍 or 👎 |
Hey @anxolin , changes LGTM. But there are some info points for you:
Assumptions: if the order will be 99.99% filled, it will still hang in the Open state with no 'fill' indication, so users may be confused and call cancellation of the order. Once the order 'expires', the refund od this 0.01% part will be triggered and won't be executed. |
All good points. Agree is not ideal to be left in the OPEN state, and the ETH flow is not great either, but I think this outcome is way better than before. After all 99.99% is better than 0%. I think the feature is to allow to show % of execution in the modal. We could add it as a issue for feature request, but due too the limited time we have in Bangkok and that this UX isse affects a PRO user which is not core and highly experimental, I would let this PR go through :) EDIT: I wrote the above too late last night, so I didn't read you properly. Let me amend the above
Right! God point, I though we had support for ETH flow, but obviously we don't. I think we should delete the native token from the sell amount instead. Does it make sense to you? |
@elena-zh regarding ETH Flow. I don't think is related to this PR. This PR tries to be more flexible to let your order go through even if the hook yields less tokens. The issue with ETH Flow is already in DEV. I would suggest we track down this enhancements and solve them with independence next week. I would suggest we disallow to sell ETH in HOOKS |
@anxolin ,
There were no partially fillable ETH orders in Dev yesterday :) And my point was not to allow them being partially fillable, so this was related to the current PR. |
Opened #5087 task for improving PF handling on the UI |
Summary
Hook orders will be partially fillable.
Context
Hook SWAPs might depend on pre-hooks that on creation time, the simulation gives you some tokens but at execution are less.
One example is in LP withdrawals. You can't guarantee that at execution time you won't have the same amount of tokens you had when you created the hook.
For this reason, is better to make all hook orders partially executable, so it can trade all the available balance.
Future PRs could consider adding the option to choose.
Dev reviewers
My head 🤯 with the hook logic, I had to do too many changes to change the defaultparams/state/several-level-nested-hooks.partiallyFillable
. It is very likely that there was a simpler way to do it, but I felt it was a bit hard to reason about the current setup, as there's a mix ofHappy to receive feedback on a simpler approachI figure it out. I just used an existing hook we had to not drill-down the props down
Test
Place a hook order and verify is partially fillable.
Swap should still be FoK