Skip to content

Commit

Permalink
fix: BN casting to Number issue
Browse files Browse the repository at this point in the history
  • Loading branch information
calmdentist committed Nov 9, 2024
1 parent 59e1cbf commit 37cb0b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/indexer/src/indexers/amm-market/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export async function indexAmmMarketAccountWithContext(

let priceFromReserves: BN;

if (ammMarketAccount.baseAmount.toNumber() === 0 || ammMarketAccount.baseAmount.toNumber() === 0) {
if (ammMarketAccount.baseAmount.isZero() || ammMarketAccount.quoteAmount.isZero()) {
logger.error("NO RESERVES", ammMarketAccount);
return Ok("no price from reserves");
}
Expand Down

0 comments on commit 37cb0b5

Please sign in to comment.