Skip to content

Commit

Permalink
fix: isZerocheck
Browse files Browse the repository at this point in the history
  • Loading branch information
R-K-H committed Nov 10, 2024
1 parent d3bd873 commit 56f73d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/indexer/src/indexers/amm-market/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function indexAmmMarketAccountWithContext(
);

// if we don't have an oracle.aggregator of 0 let's run this mf
if (ammMarketAccount.oracle.aggregator.toString() !== BN_0.toString()) {
if (!ammMarketAccount.oracle.aggregator.isZero()) {
// indexing the twap
const market = await usingDb((db) =>
db
Expand Down Expand Up @@ -102,6 +102,8 @@ export async function indexAmmMarketAccountWithContext(

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

Expand Down

0 comments on commit 56f73d7

Please sign in to comment.