Repository navigation
Conversation
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>
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'inconstants/skip.ts(Skip'sslippageTolerancePercentis percent units).skipClientwrapper (executeRoute/messages/messagesDirect), spread before the caller's request so per-call values still override. Deposits (including theupdatedSkipClientsigner path), withdrawals, swaps, and the Noble sweep all execute through these, so one injection point covers everything — this also resolves theTODO(deposit2.0): add custom slippage tolerance hereindepositHooks.ts.'1'now uses the shared constant.Behavior notes for review
route()quote requests are untouched (the SDK'sRouteRequesttakes no tolerance; it's execution-scoped viaBaseSettings).Testing
tsc --noEmitclean. No unit tests cover the wrapper defaults today; happy to add one if there's a preferred harness for hook wrappers.Made with Cursor