Raise default route impact / slippage protection from 0.5% to 5% #497

Closed
opened 2026-07-15 04:07:49 +00:00 by PlasticDigits · 11 comments
PlasticDigits commented 2026-07-15 04:07:49 +00:00 (Migrated from gitlab.com)

Summary

Default frontend slippage / route impact protection is 0.5%, which is too low. The protection used for the insufficient-liquidity (route impact) warning should default to 5%, not 0.5%.

Current behavior

  • Zustand store default: slippageTolerance: 0.5 in frontend-dapp/src/stores/dex.ts.

  • That value is passed on-chain as max_spread (slippageTolerance / 100) and drives the Swap insufficient-liquidity copy:

    Route impact exceeds your {slippageTolerance}% protection — try a smaller amount or another route.

  • With a 0.5% default, normal trade sizes often trip the preflight / insufficient-liquidity warning even when liquidity is acceptable for retail users.

Expected behavior

  • Default slippageTolerance should be 5 (5%).
  • Insufficient-liquidity / route-impact warning should use that 5% default unless the user changes Settings.
  • Confirm UI presets / tests that hard-code 0.5% as the default (e.g. Swap / Trade confirm max-spread expectations) are updated accordingly.

Relevant files

  • frontend-dapp/src/stores/dex.ts — slippageTolerance: 0.5
  • frontend-dapp/src/pages/SwapPage.tsx — insufficient liquidity warning + settings presets [0.1, 0.5, 1.0]
  • frontend-dapp/src/components/trade/TradeMarketOrderPanel.tsx — trade surface uses same store default
  • Tests asserting confirm max-spread 0.5% (Swap / Trade pre-submit summaries)

Acceptance criteria

  • Default protection is 5% for new sessions / unset store state.
  • Insufficient liquidity warning reflects 5% unless user overrides.
  • Unit / UI tests updated for the new default.
## Summary Default frontend **slippage / route impact protection** is **0.5%**, which is too low. The protection used for the insufficient-liquidity (route impact) warning should default to **5%**, not **0.5%**. ## Current behavior - Zustand store default: `slippageTolerance: 0.5` in `frontend-dapp/src/stores/dex.ts`. - That value is passed on-chain as `max_spread` (`slippageTolerance / 100`) and drives the Swap insufficient-liquidity copy: > Route impact exceeds your {slippageTolerance}% protection — try a smaller amount or another route. - With a 0.5% default, normal trade sizes often trip the preflight / insufficient-liquidity warning even when liquidity is acceptable for retail users. ## Expected behavior - Default `slippageTolerance` should be **5** (5%). - Insufficient-liquidity / route-impact warning should use that 5% default unless the user changes Settings. - Confirm UI presets / tests that hard-code `0.5%` as the default (e.g. Swap / Trade confirm max-spread expectations) are updated accordingly. ## Relevant files - `frontend-dapp/src/stores/dex.ts` — `slippageTolerance: 0.5` - `frontend-dapp/src/pages/SwapPage.tsx` — insufficient liquidity warning + settings presets `[0.1, 0.5, 1.0]` - `frontend-dapp/src/components/trade/TradeMarketOrderPanel.tsx` — trade surface uses same store default - Tests asserting confirm max-spread `0.5%` (Swap / Trade pre-submit summaries) ## Acceptance criteria - [ ] Default protection is 5% for new sessions / unset store state. - [ ] Insufficient liquidity warning reflects 5% unless user overrides. - [ ] Unit / UI tests updated for the new default.
PlasticDigits commented 2026-07-25 04:23:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 0f34a036a9

mentioned in commit 0f34a036a992d3c5cc466c7c4b55271b8c3542d1
PlasticDigits commented 2026-07-25 04:24:21 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1030

mentioned in merge request !1030
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-07-25 04:43:25 +00:00
PlasticDigits commented 2026-07-25 04:43:54 +00:00 (Migrated from gitlab.com)

mentioned in commit 6c0e51e234

mentioned in commit 6c0e51e2344bd85977095ea9c20b2df05438e73e
PlasticDigits commented 2026-08-15 21:45:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #528

mentioned in issue #528
PlasticDigits commented 2026-08-15 21:45:47 +00:00 (Migrated from gitlab.com)

marked as related to #528

marked as related to #528
PlasticDigits commented 2026-08-16 09:55:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #533

mentioned in issue #533
PlasticDigits commented 2026-08-18 00:43:31 +00:00 (Migrated from gitlab.com)

mentioned in issue #559

mentioned in issue #559
PlasticDigits commented 2026-08-22 11:02:34 +00:00 (Migrated from gitlab.com)

mentioned in issue #595

mentioned in issue #595
PlasticDigits commented 2026-08-27 00:17:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #678

mentioned in issue #678
PlasticDigits commented 2026-08-27 00:17:54 +00:00 (Migrated from gitlab.com)

marked as related to #678

marked as related to #678
PlasticDigits commented 2026-08-28 05:28:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #693

mentioned in issue #693
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#497
No description provided.