Skip to content

Commit

Permalink
sdk: fix phoenix Fix overflow (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarry-xiao committed Dec 18, 2023
1 parent 2cb866b commit 7a7d218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/src/phoenix/phoenixSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ export class PhoenixSubscriber implements L2OrderBookGenerator {

for (let i = 0; i < ladder[side].length; i++) {
const { price, quantity } = ladder[side][i];
const size = new BN(Math.floor(quantity * basePrecision));
const size = new BN(quantity).mul(new BN(basePrecision));
yield {
price: new BN(Math.floor(price * pricePrecision)),
price: new BN(price).mul(new BN(pricePrecision)),
size,
sources: {
phoenix: size,
Expand Down

0 comments on commit 7a7d218

Please sign in to comment.