From ced400f92899835d236e1883df338c98e274e783 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 27 Aug 2026 13:26:50 +0200 Subject: [PATCH] fix: price against all healthy Surplus offers --- supplier/src/surplus/selection.ts | 1 - tests/unit/surplus-policy.test.ts | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/supplier/src/surplus/selection.ts b/supplier/src/surplus/selection.ts index bc55a33..d3c8234 100644 --- a/supplier/src/surplus/selection.ts +++ b/supplier/src/surplus/selection.ts @@ -89,7 +89,6 @@ export function eligibleCompetitors( .filter((offer) => offer.available && offer.healthy && - offer.trusted && offer.seller !== normalizedWallet && !ownOfferIds.has(offer.id) ) diff --git a/tests/unit/surplus-policy.test.ts b/tests/unit/surplus-policy.test.ts index f6b8a00..ff3776a 100644 --- a/tests/unit/surplus-policy.test.ts +++ b/tests/unit/surplus-policy.test.ts @@ -126,7 +126,7 @@ describe("Surplus multi-model selection", () => { .toBe("alpha-model"); }); - it("excludes unhealthy, untrusted, unavailable, and self offers", () => { + it("prices against healthy available offers while excluding self", () => { const base: SurplusOrderBookOffer = { id: "external", seller: "0x2222222222222222222222222222222222222222", @@ -149,6 +149,9 @@ describe("Surplus multi-model selection", () => { ]; expect(eligibleCompetitors(offers, seller, new Set(["managed-id"]))) - .toEqual([{ id: "external", inputMicroUsdPer1m: 4_000, outputMicroUsdPer1m: 8_000 }]); + .toEqual([ + { id: "external", inputMicroUsdPer1m: 4_000, outputMicroUsdPer1m: 8_000 }, + { id: "untrusted", inputMicroUsdPer1m: 4_000, outputMicroUsdPer1m: 8_000 }, + ]); }); });