Skip to content

Commit 782e651

Browse files
committed
fix(apps/price_pusher): ignore invalid price updates on push
when a feed is not found, the code throws an error which is typically good but often a feed is removed and that results in the entire push failing. this change adds the flag to ignore invalid price updates, which allows the push to continue.
1 parent ccd6582 commit 782e651

File tree

8 files changed

+8
-1
lines changed

8 files changed

+8
-1
lines changed

apps/price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "9.3.3",
3+
"version": "9.3.4",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

apps/price_pusher/src/aptos/aptos.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export class AptosPricePusher implements IPricePusher {
109109
async getPriceFeedsUpdateData(priceIds: string[]): Promise<number[][]> {
110110
const response = await this.hermesClient.getLatestPriceUpdates(priceIds, {
111111
encoding: "base64",
112+
ignoreInvalidPriceIds: true,
112113
});
113114
return response.binary.data.map((data) =>
114115
Array.from(Buffer.from(data, "base64")),

apps/price_pusher/src/fuel/fuel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export class FuelPricePusher implements IPricePusher {
101101
try {
102102
const response = await this.hermesClient.getLatestPriceUpdates(priceIds, {
103103
encoding: "base64",
104+
ignoreInvalidPriceIds: true,
104105
});
105106
priceFeedUpdateData = response.binary.data;
106107
} catch (err: any) {

apps/price_pusher/src/injective/injective.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ export class InjectivePricePusher implements IPricePusher {
301301
try {
302302
const response = await this.hermesClient.getLatestPriceUpdates(priceIds, {
303303
encoding: "base64",
304+
ignoreInvalidPriceIds: true,
304305
});
305306
const vaas = response.binary.data;
306307

apps/price_pusher/src/near/near.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export class NearPricePusher implements IPricePusher {
131131
): Promise<string[]> {
132132
const response = await this.hermesClient.getLatestPriceUpdates(priceIds, {
133133
encoding: "base64",
134+
ignoreInvalidPriceIds: true,
134135
});
135136
return response.binary.data;
136137
}

apps/price_pusher/src/solana/solana.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export class SolanaPricePusher implements IPricePusher {
118118
shuffledPriceIds,
119119
{
120120
encoding: "base64",
121+
ignoreInvalidPriceIds: true,
121122
},
122123
);
123124
priceFeedUpdateData = response.binary.data;

apps/price_pusher/src/sui/sui.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ export class SuiPricePusher implements IPricePusher {
225225
priceIdChunk,
226226
{
227227
encoding: "base64",
228+
ignoreInvalidPriceIds: true,
228229
},
229230
);
230231
if (response.binary.data.length !== 1) {

apps/price_pusher/src/ton/ton.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export class TonPricePusher implements IPricePusher {
9898
try {
9999
const response = await this.hermesClient.getLatestPriceUpdates(priceIds, {
100100
encoding: "base64",
101+
ignoreInvalidPriceIds: true,
101102
});
102103
priceFeedUpdateData = response.binary.data;
103104
} catch (err: any) {

0 commit comments

Comments
 (0)