Skip to content

fix(enso): cap route slippage to 0-10000 bps - #1413

Open
SashaMIT wants to merge 1 commit into
coinbase:mainfrom
SashaMIT:fix/enso-slippage-cap
Open

fix(enso): cap route slippage to 0-10000 bps#1413
SashaMIT wants to merge 1 commit into
coinbase:mainfrom
SashaMIT:fix/enso-slippage-cap

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Enso route schema accepted any numeric slippage (including values above 100%), so an agent or tool could request unbounded slippage on swaps. Cap slippage to 0-10000 bps (100%), matching Jupiter (#1393) and the 0x provider. Null still means omit (Enso API default / documented 50 bps). Sibling of #1409-#1412; does not reopen those findings.

Cap

  • Schema: .int().min(0).max(10000).nullable()
  • Units: basis points (1/10000). Max 10000 = 100%.
  • Default remains documented as 50 (0.5%) when the field is omitted/null.

Test plan

  • pnpm exec jest --testPathPattern='enso/ensoActionProvider' --coverage=false (13/13)
  • Regression: rejects slippage 10001, negative, and non-integer
  • Regression: accepts 0, 10000, 50, and null

Made with Cursor

Prevent agents from requesting unbounded Enso slippage via schema validation.
Matches Jupiter (coinbase#1393) and 0x provider caps.
@SashaMIT
SashaMIT requested a review from murrlincoln as a code owner August 8, 2026 02:46
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

2 participants