Skip to content

Commit

Permalink
ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jarry-xiao committed Dec 21, 2023
1 parent 34ebdad commit 4d5e0ac
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions sdk/src/phoenix/phoenixSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,14 @@ export class PhoenixSubscriber implements L2OrderBookGenerator {
}

*getL2Levels(side: 'bids' | 'asks'): Generator<L2Level> {
const tickSize = this.market.data.header
.tickSizeInQuoteAtomsPerBaseUnit as BN;
const baseLotsToRawBaseUnits = this.market.baseLotsToRawBaseUnits(1);

const basePrecision = new BN(
Math.pow(10, this.market.data.header.baseParams.decimals) *
baseLotsToRawBaseUnits
const basePrecision = Math.pow(
10,
this.market.data.header.baseParams.decimals
);

const pricePrecision = PRICE_PRECISION.div(tickSize as BN);
const pricePrecision = PRICE_PRECISION.toNumber();

const ladder = getMarketLadder(
const ladder = getMarketUiLadder(
this.market,
this.lastSlot,
this.lastUnixTimestamp,
Expand Down

0 comments on commit 4d5e0ac

Please sign in to comment.