Skip to content

Feat/delta slippage param#227

Merged
0xNazarii merged 51 commits intomasterfrom
feat/deltaSlippageParam
Mar 23, 2026
Merged

Feat/delta slippage param#227
0xNazarii merged 51 commits intomasterfrom
feat/deltaSlippageParam

Conversation

@0xNazarii
Copy link
Copy Markdown
Contributor

@0xNazarii 0xNazarii commented Mar 11, 2026

Note

Medium Risk
Introduces new Delta order-building semantics (auto-computed amounts via slippage) and adds a new ExternalOrder flow with new typed-data/signing and posting paths, which could impact order correctness/signatures if miscomputed. Changes are mostly additive but touch core Delta order construction and API typing.

Overview
Adds slippage-based Delta order building: buildDeltaOrder/submitDeltaOrder now accept slippage (bps) and auto-compute srcAmount/destAmount for SELL/BUY, centralizing partner-fee and amount resolution in new helpers.

Introduces External Delta Orders (handler-executed token logic) via new build/sign/post/preSign/submitExternalDeltaOrder APIs, new EIP-712 typed data (ExternalOrder), and updates DeltaAuction typing and getDeltaOrders filtering to include onChainOrderType.

Updates docs and examples to cover external orders, bumps package version to 9.4.0, and marks Limit/NFT order APIs as deprecated (with related snapshot/test fixture cleanup/updates).

Written by Cursor Bugbot for commit 8063d1a. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 11, 2026

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 16.99 KB (+3.72% 🔺)
dist/sdk.esm.js 16.93 KB (+3.54% 🔺)

Comment thread src/methods/delta/buildDeltaOrder.ts Outdated
Comment thread src/methods/delta/buildDeltaOrder.ts Outdated
Comment thread src/methods/delta/buildDeltaOrder.ts Outdated
Comment thread .gitignore Outdated
Comment thread src/methods/delta/buildDeltaOrder.ts Outdated
Comment thread src/methods/delta/buildDeltaOrder.ts Outdated
Comment thread tests/__snapshots__/simpleSdk.test.ts.snap
import { assert } from 'ts-essentials';

// default deadline = 10 min
export const DELTA_DEFAULT_EXPIRY = 10 * 60; // seconds
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Default order expiry silently reduced for all orders

Medium Severity

DELTA_DEFAULT_EXPIRY was changed from 60 * 60 (1 hour) to 10 * 60 (10 minutes) when it was moved from buildDeltaOrderData.ts to misc.ts. This affects all standard delta orders — not just the new external orders — since both buildDeltaSignableOrderData and buildExternalOrderSignableData share this constant. Users who rely on the default deadline without passing an explicit one will see their orders expire 6× faster, which is a significant behavioral change silently bundled into a feature PR about slippage parameters.

Additional Locations (1)
Fix in Cursor Fix in Web

Comment thread src/methods/delta/postDeltaOrder.ts
@0xNazarii 0xNazarii merged commit 47ef072 into master Mar 23, 2026
3 checks passed
@0xNazarii 0xNazarii deleted the feat/deltaSlippageParam branch March 23, 2026 13:23
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/sdk/simple.ts

export type SimpleFetchSDK = {
swap: SwapFetchMethods;
/** @deprecated Limit Orders are deprecated and will be removed in a future version. */
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fetch-only SDK missing external delta order methods

Low Severity

DeltaFetchMethods includes BuildDeltaOrderFunctions and PostDeltaOrderFunctions for regular orders but omits the corresponding BuildExternalDeltaOrderFunctions and PostExternalDeltaOrderFunctions. These external order methods only require ConstructFetchInput (no signer/provider), so they belong in the fetch-only SDK type. Users of SimpleFetchSDK can't build or post external delta orders despite these operations being pure fetch/compute.

Fix in Cursor Fix in Web

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