diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 4c83fd72b..da1098d50 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -1337,12 +1337,12 @@ UniValue PricesInfo(uint256 bettxid, int32_t refheight) for (auto b : bets) { totalbets += b.amount; totalprofits += b.profits; - costbasis += b.amount * b.costbasis; + costbasis += b.amount * b.costbasis / PRICES_NORMFACTOR; // prevent overflow std::cerr << "PricesInfo() acc costbasis=" << costbasis << " b.amount=" << b.amount << " b.costbasis=" << b.costbasis << std::endl; } int64_t equity = totalbets + totalprofits; - costbasis /= totalbets; + costbasis /= totalbets * PRICES_NORMFACTOR; int64_t liqprice = costbasis - costbasis / leverage;