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(volumeFee): add volume fee for Safe #5139

Merged
merged 9 commits into from
Dec 2, 2024
Merged

feat(volumeFee): add volume fee for Safe #5139

merged 9 commits into from
Dec 2, 2024

Conversation

shoom3301
Copy link
Collaborator

@shoom3301 shoom3301 commented Nov 29, 2024

Summary

Reference: https://help.safe.global/en/articles/178530-how-does-the-widget-fee-work-for-native-swaps

Basically, CoW Swap should work the same with https://app.safe.global/swap when it is open in Safe Apps.
I literally copy-pasted the logic from Safe frontend.
The only thing that might be different is stablecoins list. We have our own list, our list at least matches mainnet (USDC/USDT/DAI).

image

To Test

Volume fee should work exactly the same with https://app.safe.global/swap

@shoom3301 shoom3301 requested review from a team November 29, 2024 11:59
@shoom3301 shoom3301 self-assigned this Nov 29, 2024
Copy link

vercel bot commented Nov 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview Dec 2, 2024 0:50am
cowfi ✅ Ready (Inspect) Visit Preview Dec 2, 2024 0:50am
explorer-dev ✅ Ready (Inspect) Visit Preview Dec 2, 2024 0:50am
swap-dev ✅ Ready (Inspect) Visit Preview Dec 2, 2024 0:50am
widget-configurator ✅ Ready (Inspect) Visit Preview Dec 2, 2024 0:50am

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! nice job

*/
export const safeAppFeeAtom = atom<VolumeFee | null>((get) => {
const { chainId } = get(walletInfoAtom)
const { isSafeApp } = get(walletDetailsAtom)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this affect also wallet connect, or just the safe app?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just Safe App

Copy link
Contributor

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @shoom3301 , great, but:

  1. Fee breakdowns are not working. No matter which amount to sell I select. the min fee size is applied to a trade
  2. It would be nice to remove intends in this tooltip (we don't have them in other tooltips)
    remove spaces in the tooltip
  3. It would be great to add a feature flag for this feature
  4. Question: We are loosing our internal fees on Arb and GC. (0.1%). Are we OK with this?
  5. Should we rename this fee inside the AppData (discussion)?
    image

Copy link
Contributor

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarfication/fixes.
The flag is working, fee breakdowns are working.
2 things to clarify are left;

  1. Should we change fees on Base?
  2. make sure that recipient address is correct.

@elena-zh
Copy link
Contributor

elena-zh commented Dec 2, 2024

I've done one more test round: everything works great!

@shoom3301 shoom3301 merged commit bb14c6a into develop Dec 2, 2024
11 of 12 checks passed
@shoom3301 shoom3301 deleted the feat/safe-fee branch December 2, 2024 15:50
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants