Skip to content

Commit d88ab77

Browse files
committed
fix(apps/price_pusher): do not push if source price is undefined
1 parent e50c6aa commit d88ab77

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/price_pusher/src/price-config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ export function shouldUpdate(
9696
): UpdateCondition {
9797
const priceId = priceConfig.id;
9898

99-
// There is no price to update the target with.
99+
// There is no price to update the target with. So we should not update it.
100100
if (sourceLatestPrice === undefined) {
101-
return UpdateCondition.YES;
101+
logger.info(
102+
`${priceConfig.alias} (${priceId}) is not available on the source network. Ignoring it.`,
103+
);
104+
return UpdateCondition.NO;
102105
}
103106

104107
// It means that price never existed there. So we should push the latest price feed.
@@ -140,7 +143,7 @@ export function shouldUpdate(
140143
}%? / early: < ${priceConfig.earlyUpdatePriceDeviation}%?) OR ` +
141144
`Confidence ratio: ${confidenceRatioPct.toFixed(5)}% (< ${
142145
priceConfig.confidenceRatio
143-
}%? / early: < ${priceConfig.earlyUpdatePriceDeviation}%?)`,
146+
}%? / early: < ${priceConfig.earlyUpdateConfidenceRatio}%?)`,
144147
);
145148

146149
if (

0 commit comments

Comments
 (0)