From a516122f619fcfaaddf0c266fa10ed43808261f6 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Mon, 2 May 2022 13:58:59 -0400 Subject: [PATCH] round shares to avoid negative shares error message --- common/calculate-cpmm.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/calculate-cpmm.ts b/common/calculate-cpmm.ts index d36d2f21..4c0d30eb 100644 --- a/common/calculate-cpmm.ts +++ b/common/calculate-cpmm.ts @@ -172,7 +172,7 @@ export function calculateCpmmSale( shares: number, outcome: string ) { - if (shares < 0) { + if (Math.round(shares) < 0) { throw new Error('Cannot sell non-positive shares') }