norm operation grouping
This commit is contained in:
@@ -1337,12 +1337,12 @@ UniValue PricesInfo(uint256 bettxid, int32_t refheight)
|
|||||||
for (auto b : bets) {
|
for (auto b : bets) {
|
||||||
totalbets += b.amount;
|
totalbets += b.amount;
|
||||||
totalprofits += b.profits;
|
totalprofits += b.profits;
|
||||||
costbasis += b.amount * b.costbasis / PRICES_NORMFACTOR; // prevent overflow
|
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;
|
std::cerr << "PricesInfo() acc costbasis=" << costbasis << " b.amount=" << b.amount << " b.costbasis=" << b.costbasis << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t equity = totalbets + totalprofits;
|
int64_t equity = totalbets + totalprofits;
|
||||||
costbasis /= totalbets / PRICES_NORMFACTOR;
|
costbasis /= (totalbets / PRICES_NORMFACTOR);
|
||||||
int64_t liqprice = costbasis - costbasis / leverage;
|
int64_t liqprice = costbasis - costbasis / leverage;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user