From 8def832c5e1cbff25429cb959c1f4308505383ce Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 18 May 2026 14:19:43 +0200 Subject: [PATCH] Persist request slippage cap state Proof: node --test test/intent-requests.test.mjs verifies uncapped request preflights persist null slippage cap state. Assumptions: request preflight payloads should expose both amount and slippage cap state so operator-visible records match DB strategy config. Still fake: request settlement truth still depends on inventory-delta attribution instead of venue-native terminal fill events. --- src/core/intent-request-controller.mjs | 3 +++ test/intent-requests.test.mjs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/core/intent-request-controller.mjs b/src/core/intent-request-controller.mjs index 2658b25..2cc7ff1 100644 --- a/src/core/intent-request-controller.mjs +++ b/src/core/intent-request-controller.mjs @@ -203,6 +203,9 @@ export function createIntentRequestController({ request_max_notional: requestPair.requestMaxNotional == null ? null : String(requestPair.requestMaxNotional), + request_max_slippage_bps: requestPair.requestMaxSlippageBps == null + ? null + : Number(requestPair.requestMaxSlippageBps), price_route_id: requestPair.priceRoute?.routeId || null, source_asset_id: sourceAsset.assetId, source_symbol: sourceAsset.symbol, diff --git a/test/intent-requests.test.mjs b/test/intent-requests.test.mjs index edf1b83..923c720 100644 --- a/test/intent-requests.test.mjs +++ b/test/intent-requests.test.mjs @@ -253,6 +253,7 @@ test('DB null request limits allow operator-chosen amount and slippage', async ( assert.equal(preflight.state, 'draft'); assert.equal(preflight.reason_code, 'quote_available'); assert.equal(preflight.request_max_notional, null); + assert.equal(preflight.request_max_slippage_bps, null); assert.equal(preflight.slippage_bps, 250); assert.equal(preflight.live_submit_capable, true); assert.equal(relay.quoteCalls, 1);