Conversation
Transaction hash was being lost inside the helper function from fynd client.
The current verbosity wasn't great, in docker we would only see the quote, everything happening in the background was hidden (approvals, ect..) making it feel slow. In this commit we: - Added console messages to indicate ERC-20 allowance checks and transaction submissions. - Enhanced output formatting for swap details, including token addresses and transaction hashes.
…ture swaps This change ensures that the full unlimited amount is approved for Permit2, eliminating the need for repeated approvals during subsequent swaps. This enhancement improves the efficiency of the swap process.
With the current design, an approval is always required because the check amount always match the approval amount. This means if we approve x and swap, on the next try we will have allowance < x and the check won't skip even if we still have enough allowance. This update adds the `AllowanceCheck` enum to control ERC-20 approval behavior in the `FyndClient`. It allows users to specify whether to skip allowance checks or to check against a minimum threshold before building approval transactions. With this we can approve a bigger amount against permit2 and skip approval in subsequent tries.
vm:curve is not available from Fynd endpoint, change it to ekubo and fluid.
No API Breaking Changes DetectedThe PR title signals breaking changes, but |
Troshchk
left a comment
There was a problem hiding this comment.
Thank you!
Just have one question
tvinagre
left a comment
There was a problem hiding this comment.
LGTM
I agree with the comment on max approval, we can maybe 3x the swap amount instead
tools/fynd-swap-cli/src/main.rs
Outdated
| &signer, | ||
| sell_token_bytes.clone(), | ||
| amount.clone(), | ||
| max_uint160(), |
There was a problem hiding this comment.
Is this approving Max to Permit2 or the router?
If permit2, then it's fine for me. If it is the router, I'd stick to amount
There was a problem hiding this comment.
Why do we need to approve more than the swap amount?
There was a problem hiding this comment.
When the router transfer_from it consumes the allowance. So swapping becomes 2 transaction every time (approve then swap) instead of just one transaction
There was a problem hiding this comment.
Update: we decided to not approve more than needed even if it's against Permit2 for security reasons. See 03bad3a
|
This PR is included in version 0.47.0 🎉 |
Summary