fix: price against all healthy Surplus offers
This commit is contained in:
@@ -89,7 +89,6 @@ export function eligibleCompetitors(
|
|||||||
.filter((offer) =>
|
.filter((offer) =>
|
||||||
offer.available &&
|
offer.available &&
|
||||||
offer.healthy &&
|
offer.healthy &&
|
||||||
offer.trusted &&
|
|
||||||
offer.seller !== normalizedWallet &&
|
offer.seller !== normalizedWallet &&
|
||||||
!ownOfferIds.has(offer.id)
|
!ownOfferIds.has(offer.id)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ describe("Surplus multi-model selection", () => {
|
|||||||
.toBe("alpha-model");
|
.toBe("alpha-model");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("excludes unhealthy, untrusted, unavailable, and self offers", () => {
|
it("prices against healthy available offers while excluding self", () => {
|
||||||
const base: SurplusOrderBookOffer = {
|
const base: SurplusOrderBookOffer = {
|
||||||
id: "external",
|
id: "external",
|
||||||
seller: "0x2222222222222222222222222222222222222222",
|
seller: "0x2222222222222222222222222222222222222222",
|
||||||
@@ -149,6 +149,9 @@ describe("Surplus multi-model selection", () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
expect(eligibleCompetitors(offers, seller, new Set(["managed-id"])))
|
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 },
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user