Skip to content

Commit 920aa9c

Browse files
Apply suggestions from code review
Co-authored-by: guibescos <[email protected]>
1 parent 1970a2a commit 920aa9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

target_chains/solana/sdk/js/pyth_solana_receiver/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ This method does sacrifice some security however -- please see the method docume
179179

180180
TWAP prices updates are calculated using a pair of verifiable cumulative price updates per price feed (the "start" and "end" updates for the given time window), and then performing an averaging calculation on-chain to create the time-weighted average price.
181181

182-
The flow of using verifying, posting, and consuming these prices are the same as standard price updates. Get the binary update data from Hermes or Benchmarks, verify the VAAs via the Wormhole contract, and post the VAAs to the Pyth receiver contract. After this, you can consume the calculated TWAP posted to the TwapUpdate account. You can also optionally close these ephemeral accounts after the TWAP has been consumed to save on rent.
182+
The flow of using, verifying, posting, and consuming these prices are the same as standard price updates. Get the binary update data from Hermes or Benchmarks, post and verify the VAAs via the Wormhole contract, and verify the updates against the VAAs via Pyth receiver contract. After this, you can consume the calculated TWAP posted to the TwapUpdate account. You can also optionally close these ephemeral accounts after the TWAP has been consumed to save on rent.
183183

184184
```typescript
185185
// Fetch the binary TWAP data from hermes or benchmarks. See Preliminaries section above for more info.
@@ -200,7 +200,7 @@ await transactionBuilder.addTwapConsumerInstructions(
200200
getTwapUpdateAccount: (priceFeedId: string) => PublicKey
201201
): Promise<InstructionWithEphemeralSigners[]> => {
202202
// Generate instructions here that use the TWAP updates posted above.
203-
// getTwaoUpdateAccount(<price feed id>) will give you the account for each TWAP update.
203+
// getTwapUpdateAccount(<price feed id>) will give you the account for each TWAP update.
204204
return [];
205205
}
206206
);

target_chains/solana/sdk/js/pyth_solana_receiver/src/PythSolanaReceiver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ export class PythTransactionBuilder extends TransactionBuilder {
215215
*
216216
* const transactionBuilder = pythSolanaReceiver.newTransactionBuilder({});
217217
* await transactionBuilder.addPostTwapUpdates(priceUpdateData);
218-
* console.log("The SOL/USD price update will get posted to:", transactionBuilder.getPriceUpdateAccount(SOL_PRICE_FEED_ID).toBase58())
219-
* await transactionBuilder.addPriceConsumerInstructions(...)
218+
* console.log("The SOL/USD price update will get posted to:", transactionBuilder.getTwapUpdateAccount(SOL_PRICE_FEED_ID).toBase58())
219+
* await transactionBuilder.addTwapConsumerInstructions(...)
220220
* ```
221221
*/
222222
async addPostTwapUpdates(twapUpdateDataArray: string[]) {

0 commit comments

Comments
 (0)