Skip to content

Commit

Permalink
waves minor calc change
Browse files Browse the repository at this point in the history
  • Loading branch information
ttodua committed Jun 10, 2022
1 parent afb5e37 commit 418f9fc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions js/wavesexchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,12 @@ module.exports = class wavesexchange extends Exchange {

parseOrderBookSide (bookSide, market = undefined, limit = undefined) {
const precision = market['precision'];
const precisionDigitsAmount = this.precisionFromString (this.safeString (precision, 'amount'));
const precisionDigitsPrice = this.precisionFromString (this.safeString (precision, 'price'));
const wavesPrecision = this.safeString (this.options, 'wavesPrecision', '0.00000001');
const wavesPrecisionDigits = this.precisionFromString (wavesPrecision);
const amountPrecision = Math.pow (10, precisionDigitsAmount);
const difference = precisionDigitsAmount - precisionDigitsPrice;
const pricePrecision = Math.pow (10, wavesPrecisionDigits - difference);
const precisionAmountDigits = this.precisionFromString (this.safeString (precision, 'amount'));
const precisionPriceDigits = this.precisionFromString (this.safeString (precision, 'price'));
const wavesPrecisionStr = this.safeString (this.options, 'wavesPrecision', '0.00000001');
const amountPrecision = Math.pow (10, precisionAmountDigits);
const difference = precisionAmountDigits - precisionPriceDigits;
const pricePrecision = Math.pow (10, this.precisionFromString (wavesPrecisionStr) - difference);
const result = [];
for (let i = 0; i < bookSide.length; i++) {
const entry = bookSide[i];
Expand Down

0 comments on commit 418f9fc

Please sign in to comment.