Skip to content

Commit

Permalink
fix(semibook): use tickPriceHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Amas committed Nov 23, 2023
1 parent 0527b78 commit 087873b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/semibook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
} from "./types/typechain/MgvReader";
import { MAX_TICK, MIN_TICK } from "./util/coreCalculations/Constants";
import { Density } from "./util/coreCalculations/Density";
import { TickLib } from "./util/coreCalculations/TickLib";
import logger from "./util/logger";
import Trade from "./util/trade";
import { Result } from "./util/types";
Expand Down Expand Up @@ -457,7 +456,7 @@ class Semibook
acc.totalGasreq = acc.totalGasreq.add(offer.gasreq);
acc.lastGasreq = offer.gasreq;
const offerWants = offer.gives.mul(
TickLib.priceFromTick(offer!.tick),
this.tickPriceHelper.priceFromTick(offer!.tick),
);
if (
(fillWants && fillVolume.gt(offer.gives)) ||
Expand Down Expand Up @@ -1009,7 +1008,9 @@ class Semibook
if (desiredVolume.to === "buy") {
return offer.gives;
} else {
return offer.gives.mul(TickLib.priceFromTick(offer.tick));
return offer.gives.mul(
this.tickPriceHelper.priceFromTick(offer.tick),
);
}
};
let volume = Big(0);
Expand Down

0 comments on commit 087873b

Please sign in to comment.