Skip to content

Commit

Permalink
fix(price-pusher): randomize price feed ids (#1761)
Browse files Browse the repository at this point in the history
* fix: randomize price feed ids

* Actual good sorting

* add space
  • Loading branch information
guibescos authored Jul 11, 2024
1 parent 27656f9 commit f5af412
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/price_pusher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pythnetwork/price-pusher",
"version": "7.0.1",
"version": "7.0.2",
"description": "Pyth Price Pusher",
"homepage": "https://pyth.network",
"main": "lib/index.js",
Expand Down
9 changes: 8 additions & 1 deletion apps/price_pusher/src/solana/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@ export class SolanaPricePusher implements IPricePusher {
return;
}

const shuffledPriceIds = priceIds
.map((x) => {
return { element: x, key: Math.random() };
})
.sort((a, b) => a.key - b.key)
.map((x) => x.element);

let priceFeedUpdateData;
try {
priceFeedUpdateData = await this.priceServiceConnection.getLatestVaas(
priceIds
shuffledPriceIds
);
} catch (err: any) {
this.logger.error(err, "getPriceFeedsUpdateData failed:");
Expand Down

0 comments on commit f5af412

Please sign in to comment.