round shares to avoid negative shares error message

This commit is contained in:
mantikoros 2022-05-02 13:58:59 -04:00
parent db695875c4
commit a516122f61

View File

@ -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')
}