diff --git a/.changeset/sixty-cups-roll.md b/.changeset/sixty-cups-roll.md new file mode 100644 index 0000000..427f4b5 --- /dev/null +++ b/.changeset/sixty-cups-roll.md @@ -0,0 +1,5 @@ +--- +"@mangrovedao/mgv": patch +--- + +Fix validate kandel params when one sided diff --git a/src/actions/kandel/view.test.ts b/src/actions/kandel/view.test.ts index e0fe485..fc04c2e 100644 --- a/src/actions/kandel/view.test.ts +++ b/src/actions/kandel/view.test.ts @@ -126,7 +126,7 @@ describe('view kandel', () => { marketConfig: book.marketConfig, }) - expect(isValid).toBe(false) + expect(isValid).toBe(true) // even though out of range, params are valid const kandel = await sowAndPopulate(params, minProvision) diff --git a/src/lib/kandel/params.ts b/src/lib/kandel/params.ts index b4269ef..123f8a0 100644 --- a/src/lib/kandel/params.ts +++ b/src/lib/kandel/params.ts @@ -194,7 +194,8 @@ export function validateKandelParams( marketConfig.gasprice * BigInt(1e6) - const isValid = askGives >= minAsk && bidGives >= minBid + const isValid = + (nAsks === 0n || askGives >= minAsk) && (nBids === 0n || bidGives >= minBid) return { params: {