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

Allowed Slippage for limit swaps #1451

Open
wants to merge 5 commits into
base: release-53
Choose a base branch
from

Conversation

hubert-de-lalye
Copy link
Collaborator

@hubert-de-lalye hubert-de-lalye commented Dec 12, 2024


Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for vigilant-albattani-df38ec ready!

Name Link
🔨 Latest commit b895c8b
🔍 Latest deploy log https://app.netlify.com/sites/vigilant-albattani-df38ec/deploys/67618327ef498300081beeec
😎 Deploy Preview https://deploy-preview-1451--vigilant-albattani-df38ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

cloudflare-workers-and-pages bot commented Dec 12, 2024

Deploying gmx-interface with  Cloudflare Pages  Cloudflare Pages

Latest commit: b895c8b
Status: ✅  Deploy successful!
Preview URL: https://0b71e630.gmx-interface.pages.dev
Branch Preview URL: https://swap-impact-field.gmx-interface.pages.dev

View logs

@hubert-de-lalye hubert-de-lalye self-assigned this Dec 12, 2024
@hubert-de-lalye hubert-de-lalye changed the title [WIP] Acceptable Swap Impact [WIP] Allowed Slippage for limit swaps Dec 13, 2024
@hubert-de-lalye hubert-de-lalye changed the title [WIP] Allowed Slippage for limit swaps Allowed Slippage for limit swaps Dec 16, 2024
@hubert-de-lalye hubert-de-lalye changed the base branch from release-52 to release-53 December 16, 2024 18:39
swapPath = allPaths[0].path;
const sortedPaths = opts.order
? [...allPaths].sort((a, b) => {
for (const field of opts.order ?? []) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh, maybe create different sort functions for sort each strategy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved this to separated getSwapPathComparator and added unit tests for it, it's a generic function and strategy passed as priority list of liquidity and/or path length

initialSwapImpactFeeBps?: bigint;
setAllowedSwapSlippageBps: (value: bigint) => void;
totalSwapImpactBps: bigint;
notAvailable?: boolean;
Copy link
Collaborator

@divhead divhead Dec 17, 2024

Choose a reason for hiding this comment

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

not critial, but, probably rename it to “disabled”? would be a more familiar name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this inherited from AcceptableSwapImpact component, and I think naming is ok cuz it will render N/A, it's differs from just disabled state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants