@pythnetwork/price-pusher 6.6.1 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ By default, Pyth does not automatically update the on-chain price every time the
10
10
  instead, anyone can permissionlessly update the on-chain price prior to using it.
11
11
  For more information please refer to [this document](https://docs.pyth.network/documentation/how-pyth-works).
12
12
 
13
- Protocols integrating with can update the on-chain Pyth prices in two different ways.
13
+ Protocols integrating with Pyth can update the on-chain Pyth prices in two different ways.
14
14
  The first approach is on-demand updates: package a Pyth price update together with each transaction that depends on it.
15
15
  On-demand updates minimize latency and are more gas efficient, as prices are only updated on-chain when they are needed.
16
16
 
@@ -145,6 +145,33 @@ npm run start -- near \
145
145
  [--pushing-frequency 10] \
146
146
  [--polling-frequency 5]
147
147
 
148
+ # For Solana, using Jito (recommended)
149
+ npm run start -- solana \
150
+ --endpoint https://api.mainnet-beta.solana.com \
151
+ --keypair-file ./id.json \
152
+ --shard-id 1 \
153
+ --jito-endpoint mainnet.block-engine.jito.wtf \
154
+ --jito-keypair-file ./jito.json \
155
+ --jito-tip-lamports 100000 \
156
+ --jito-bundle-size 5 \
157
+ --price-config-file ./price-config.yaml \
158
+ --price-service-endpoint https://hermes.pyth.network/ \
159
+ --pyth-contract-address pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT \
160
+ --pushing-frequency 30 \
161
+ [--polling-frequency 5]
162
+
163
+ # For Solana, using Solana RPC
164
+ npm run start -- solana \
165
+ --endpoint https://api.devnet.solana.com \
166
+ --keypair-file ./id.json \
167
+ --shard-id 1 \
168
+ --price-config-file ./price-config.yaml \
169
+ --price-service-endpoint https://hermes.pyth.network/ \
170
+ --pyth-contract-address pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT \
171
+ --pushing-frequency 30 \
172
+ [--polling-frequency 5]
173
+
174
+
148
175
 
149
176
  # Or, run the price pusher docker image instead of building from the source
150
177
  docker run public.ecr.aws/pyth-network/xc-price-pusher:v<version> -- <above-arguments>
@@ -14,6 +14,8 @@ declare const _default: {
14
14
  "tx-speed": Options;
15
15
  "override-gas-price-multiplier": Options;
16
16
  "override-gas-price-multiplier-cap": Options;
17
+ "gas-limit": Options;
18
+ "update-fee-multiplier": Options;
17
19
  };
18
20
  handler: (argv: any) => void;
19
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/evm/command.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;oBAuDL,GAAG;;AAnD9B,wBA4HE"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/evm/command.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;oBAqEL,GAAG;;AAjE9B,wBA8IE"}
@@ -73,6 +73,19 @@ exports.default = {
73
73
  required: false,
74
74
  default: 5,
75
75
  },
76
+ "gas-limit": {
77
+ description: "Gas limit for the transaction",
78
+ type: "number",
79
+ required: false,
80
+ },
81
+ "update-fee-multiplier": {
82
+ description: "Multiplier for the fee to update the price. It is useful in networks " +
83
+ "such as Hedera where setting on-chain getUpdateFee as the transaction value " +
84
+ "won't work. Default to 1",
85
+ type: "number",
86
+ required: false,
87
+ default: 1,
88
+ },
76
89
  ...options.priceConfigFile,
77
90
  ...options.priceServiceEndpoint,
78
91
  ...options.mnemonicFile,
@@ -82,7 +95,7 @@ exports.default = {
82
95
  },
83
96
  handler: function (argv) {
84
97
  // FIXME: type checks for this
85
- const { endpoint, priceConfigFile, priceServiceEndpoint, mnemonicFile, pythContractAddress, pushingFrequency, pollingFrequency, customGasStation, txSpeed, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, } = argv;
98
+ const { endpoint, priceConfigFile, priceServiceEndpoint, mnemonicFile, pythContractAddress, pushingFrequency, pollingFrequency, customGasStation, txSpeed, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, gasLimit, updateFeeMultiplier, } = argv;
86
99
  const priceConfigs = (0, price_config_1.readPriceConfigFile)(priceConfigFile);
87
100
  const priceServiceConnection = new price_service_client_1.PriceServiceConnection(priceServiceEndpoint, {
88
101
  logger: {
@@ -105,7 +118,7 @@ exports.default = {
105
118
  pollingFrequency,
106
119
  });
107
120
  const gasStation = (0, custom_gas_station_1.getCustomGasStation)(customGasStation, txSpeed);
108
- const evmPusher = new evm_1.EvmPricePusher(priceServiceConnection, pythContractFactory, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, gasStation);
121
+ const evmPusher = new evm_1.EvmPricePusher(priceServiceConnection, pythContractFactory, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, updateFeeMultiplier, gasLimit, gasStation);
109
122
  const controller = new controller_1.Controller(priceConfigs, pythListener, evmListener, evmPusher, { pushingFrequency });
110
123
  controller.start();
111
124
  },
package/lib/evm/evm.d.ts CHANGED
@@ -19,12 +19,14 @@ export declare class EvmPricePusher implements IPricePusher {
19
19
  private connection;
20
20
  private overrideGasPriceMultiplier;
21
21
  private overrideGasPriceMultiplierCap;
22
+ private updateFeeMultiplier;
23
+ private gasLimit?;
22
24
  private customGasStation?;
23
25
  private pythContract;
24
26
  private web3;
25
27
  private pusherAddress;
26
28
  private lastPushAttempt;
27
- constructor(connection: PriceServiceConnection, pythContractFactory: PythContractFactory, overrideGasPriceMultiplier: number, overrideGasPriceMultiplierCap: number, customGasStation?: CustomGasStation);
29
+ constructor(connection: PriceServiceConnection, pythContractFactory: PythContractFactory, overrideGasPriceMultiplier: number, overrideGasPriceMultiplierCap: number, updateFeeMultiplier: number, gasLimit?: number | undefined, customGasStation?: CustomGasStation);
28
30
  updatePriceFeed(priceIds: string[], pubTimesToPush: UnixTimestamp[]): Promise<void>;
29
31
  private getPriceFeedsUpdateData;
30
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"evm.d.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;AAED,qBAAa,cAAe,YAAW,YAAY;IAQ/C,OAAO,CAAC,UAAU;IAElB,OAAO,CAAC,0BAA0B;IAClC,OAAO,CAAC,6BAA6B;IACrC,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,QAAQ,CAAC;IAZnB,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,YAAY,CAAW;IAC/B,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,eAAe,CAA0B;gBAGvC,UAAU,EAAE,sBAAsB,EAC1C,mBAAmB,EAAE,mBAAmB,EAChC,0BAA0B,EAAE,MAAM,EAClC,6BAA6B,EAAE,MAAM,EACrC,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,CAAC,oBAAQ,EACzB,gBAAgB,CAAC,EAAE,gBAAgB;IAa/B,eAAe,CACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,cAAc,EAAE,aAAa,EAAE,GAC9B,OAAO,CAAC,IAAI,CAAC;YAuJF,uBAAuB;CAQtC;AAED,qBAAa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,mBAAmB;gBAFnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,mBAAmB,EAAE,MAAM;IAGrC;;;;;;OAMG;IACH,2BAA2B,IAAI,QAAQ;IAcvC;;;;;OAKG;IACH,kBAAkB,IAAI,QAAQ;IAS9B,oBAAoB,IAAI,OAAO;IAI/B,kBAAkB;IA0BlB,uBAAuB;CAQxB"}
package/lib/evm/evm.js CHANGED
@@ -81,15 +81,19 @@ class EvmPricePusher {
81
81
  connection;
82
82
  overrideGasPriceMultiplier;
83
83
  overrideGasPriceMultiplierCap;
84
+ updateFeeMultiplier;
85
+ gasLimit;
84
86
  customGasStation;
85
87
  pythContract;
86
88
  web3;
87
89
  pusherAddress;
88
90
  lastPushAttempt;
89
- constructor(connection, pythContractFactory, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, customGasStation) {
91
+ constructor(connection, pythContractFactory, overrideGasPriceMultiplier, overrideGasPriceMultiplierCap, updateFeeMultiplier, gasLimit, customGasStation) {
90
92
  this.connection = connection;
91
93
  this.overrideGasPriceMultiplier = overrideGasPriceMultiplier;
92
94
  this.overrideGasPriceMultiplierCap = overrideGasPriceMultiplierCap;
95
+ this.updateFeeMultiplier = updateFeeMultiplier;
96
+ this.gasLimit = gasLimit;
93
97
  this.customGasStation = customGasStation;
94
98
  this.pythContract = pythContractFactory.createPythContractWithPayer();
95
99
  this.web3 = new web3_1.default(pythContractFactory.createWeb3PayerProvider());
@@ -114,6 +118,7 @@ class EvmPricePusher {
114
118
  updateFee = await this.pythContract.methods
115
119
  .getUpdateFee(priceFeedUpdateData)
116
120
  .call();
121
+ updateFee = Number(updateFee) * (this.updateFeeMultiplier || 1);
117
122
  console.log(`Update fee: ${updateFee}`);
118
123
  }
119
124
  catch (e) {
@@ -143,7 +148,12 @@ class EvmPricePusher {
143
148
  console.log(`Using gas price: ${gasPrice} and nonce: ${txNonce}`);
144
149
  this.pythContract.methods
145
150
  .updatePriceFeedsIfNecessary(priceFeedUpdateData, priceIdsWith0x, pubTimesToPush)
146
- .send({ value: updateFee, gasPrice, nonce: txNonce })
151
+ .send({
152
+ value: updateFee,
153
+ gasPrice,
154
+ nonce: txNonce,
155
+ gasLimit: this.gasLimit,
156
+ })
147
157
  .on("transactionHash", (hash) => {
148
158
  console.log(`Successful. Tx hash: ${hash}`);
149
159
  })
@@ -106,7 +106,7 @@ exports.default = {
106
106
  const pythListener = new pyth_price_listener_1.PythPriceListener(priceServiceConnection, priceItems);
107
107
  const wallet = new nodewallet_1.default(web3_js_1.Keypair.fromSecretKey(Uint8Array.from(JSON.parse(fs_1.default.readFileSync(keypairFile, "ascii")))));
108
108
  const pythSolanaReceiver = new pyth_solana_receiver_1.PythSolanaReceiver({
109
- connection: new web3_js_1.Connection(endpoint),
109
+ connection: new web3_js_1.Connection(endpoint, "processed"),
110
110
  wallet,
111
111
  pushOracleProgramId: new web3_js_2.PublicKey(pythContractAddress),
112
112
  });
@@ -16,8 +16,7 @@ export declare class SolanaPricePusher implements IPricePusher {
16
16
  private priceServiceConnection;
17
17
  private shardId;
18
18
  private computeUnitPriceMicroLamports;
19
- private alreadySending;
20
- constructor(pythSolanaReceiver: PythSolanaReceiver, priceServiceConnection: PriceServiceConnection, shardId: number, computeUnitPriceMicroLamports: number, alreadySending?: boolean);
19
+ constructor(pythSolanaReceiver: PythSolanaReceiver, priceServiceConnection: PriceServiceConnection, shardId: number, computeUnitPriceMicroLamports: number);
21
20
  updatePriceFeed(priceIds: string[], pubTimesToPush: number[]): Promise<void>;
22
21
  }
23
22
  export declare class SolanaPricePusherJito implements IPricePusher {
@@ -1 +1 @@
1
- {"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../src/solana/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAK3E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,qBAAa,mBAAoB,SAAQ,kBAAkB;IAEvD,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,OAAO;gBADP,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,MAAM,EACvB,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE;QACN,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;IAKG,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CA2B3E;AAED,qBAAa,iBAAkB,YAA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kBAAkB;IAEvD,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,OAAO;gBADP,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,MAAM,EACvB,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE;QACN,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;IAKG,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CA2B3E;AAED,qBAAa,iBAAkB,YAAW,YAAY;IAElD,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,6BAA6B;gBAH7B,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,MAAM,EACf,6BAA6B,EAAE,MAAM;IAGzC,eAAe,CACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,cAAc,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,IAAI,CAAC;CAwCjB;AAED,qBAAa,qBAAsB,YAAW,YAAY;IAEtD,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,cAAc;gBALd,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,MAAM;IAG1B,eAAe,CACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,cAAc,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,IAAI,CAAC;CAyDjB"}
@@ -39,20 +39,13 @@ class SolanaPricePusher {
39
39
  priceServiceConnection;
40
40
  shardId;
41
41
  computeUnitPriceMicroLamports;
42
- alreadySending;
43
- constructor(pythSolanaReceiver, priceServiceConnection, shardId, computeUnitPriceMicroLamports, alreadySending = false) {
42
+ constructor(pythSolanaReceiver, priceServiceConnection, shardId, computeUnitPriceMicroLamports) {
44
43
  this.pythSolanaReceiver = pythSolanaReceiver;
45
44
  this.priceServiceConnection = priceServiceConnection;
46
45
  this.shardId = shardId;
47
46
  this.computeUnitPriceMicroLamports = computeUnitPriceMicroLamports;
48
- this.alreadySending = alreadySending;
49
47
  }
50
48
  async updatePriceFeed(priceIds, pubTimesToPush) {
51
- if (this.alreadySending) {
52
- console.log(new Date(), "updatePriceFeed already in progress");
53
- return;
54
- }
55
- this.alreadySending = true;
56
49
  if (priceIds.length === 0) {
57
50
  return;
58
51
  }
@@ -75,11 +68,9 @@ class SolanaPricePusher {
75
68
  try {
76
69
  await (0, solana_utils_1.sendTransactions)(transactions, this.pythSolanaReceiver.connection, this.pythSolanaReceiver.wallet);
77
70
  console.log(new Date(), "updatePriceFeed successful");
78
- this.alreadySending = false;
79
71
  }
80
72
  catch (e) {
81
73
  console.error(new Date(), "updatePriceFeed failed", e);
82
- this.alreadySending = false;
83
74
  return;
84
75
  }
85
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pythnetwork/price-pusher",
3
- "version": "6.6.1",
3
+ "version": "6.7.0",
4
4
  "description": "Pyth Price Pusher",
5
5
  "homepage": "https://pyth.network",
6
6
  "main": "lib/index.js",
@@ -67,5 +67,5 @@
67
67
  "yaml": "^2.1.1",
68
68
  "yargs": "^17.5.1"
69
69
  },
70
- "gitHead": "508de7583953af4299143affea71f8dd4633cd32"
70
+ "gitHead": "586a4398bd2b1f178ee70a38ff101bd1aec8971f"
71
71
  }