Skip to content

feat: default Skip slippage tolerance of 0.1% - #2127

Closed
Kefancao wants to merge 1 commit into
mainfrom
kefan/skip-default-slippage
Closed

Kefancao wants to merge 1 commit into
mainfrom
kefan/skip-default-slippage

Conversation

@Kefancao

Copy link
Copy Markdown
Contributor

What

Sets an explicit default slippage tolerance of 0.1% on all Skip route execution, replacing the Skip API's implicit server-side 1% default (and the Noble sweep's hardcoded '1').

  • DEFAULT_SKIP_SLIPPAGE_TOLERANCE_PERCENT = '0.1' in constants/skip.ts (Skip's slippageTolerancePercent is percent units).
  • Injected once in the skipClient wrapper (executeRoute / messages / messagesDirect), spread before the caller's request so per-call values still override. Deposits (including the updatedSkipClient signer path), withdrawals, swaps, and the Noble sweep all execute through these, so one injection point covers everything — this also resolves the TODO(deposit2.0): add custom slippage tolerance here in depositHooks.ts.
  • Noble balance sweep's hardcoded '1' now uses the shared constant.

Behavior notes for review

  • This is a real tightening (1% → 0.1%) on execution: routes with swap legs (EVM swaps, Osmosis venue) will fail rather than fill if price moves >0.1% mid-execution. Stable-to-stable bridge routes are effectively unaffected.
  • The Noble sweep is an unattended background job; pure USDC IBC legs don't exercise tolerance, but flag if you'd rather keep it at 1% for robustness — it's one hunk.
  • route() quote requests are untouched (the SDK's RouteRequest takes no tolerance; it's execution-scoped via BaseSettings).

Testing

tsc --noEmit clean. No unit tests cover the wrapper defaults today; happy to add one if there's a preferred harness for hook wrappers.

Made with Cursor

Skip route execution previously inherited the Skip API's server-side 1%
slippage default everywhere except the Noble sweep (hardcoded '1').

- add DEFAULT_SKIP_SLIPPAGE_TOLERANCE_PERCENT = '0.1' (percent units)
- inject it in the skipClient wrapper's executeRoute/messages/messagesDirect,
  spread before the caller's request so explicit values still override
- covers deposits (resolves the deposit2.0 slippage TODO), withdrawals,
  swaps, and the Noble balance sweep

Co-authored-by: Cursor <cursoragent@cursor.com>
@Kefancao
Kefancao requested a review from a team as a code owner October 19, 2026 17:42
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

You must have Developer access to commit code to dYdX Trading on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes.

Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles

@Kefancao Kefancao closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant