From a2127b462bd33ac453c8fc5c853321b71cfe21fd Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Fri, 12 Sep 2025 17:40:43 +0100 Subject: [PATCH 1/3] fix: info boxes --- .../content/docs/entropy/chainlist.mdx | 9 ++-- .../api-instances-and-providers/hermes.mdx | 4 +- .../pyth-core/contract-addresses/pythnet.mdx | 2 + .../pyth-core/create-your-first-pyth-app.mdx | 5 +- .../create-your-first-pyth-app/evm/part-2.mdx | 4 +- .../content/docs/pyth-core/current-fees.mdx | 5 +- .../docs/pyth-core/fetch-price-updates.mdx | 4 +- .../pythnet-reference/schedule-format.mdx | 4 +- .../docs/pyth-core/sponsored-feeds.mdx | 4 +- .../pyth-core/use-real-time-data/aptos.mdx | 4 +- .../pyth-core/use-real-time-data/fuel.mdx | 4 +- .../pyth-core/use-real-time-data/iota.mdx | 12 ++--- .../use-real-time-data/off-chain.mdx | 3 +- .../pyth-core/use-real-time-data/solana.mdx | 32 +++++------ .../pyth-core/use-real-time-data/starknet.mdx | 9 ++-- .../docs/pyth-core/use-real-time-data/sui.mdx | 12 ++--- .../src/InfoBox/index.stories.tsx | 53 +++++++++++++++++++ 17 files changed, 110 insertions(+), 60 deletions(-) create mode 100644 packages/component-library/src/InfoBox/index.stories.tsx diff --git a/apps/developer-hub/content/docs/entropy/chainlist.mdx b/apps/developer-hub/content/docs/entropy/chainlist.mdx index 3554fccc52..6ccfa9219c 100644 --- a/apps/developer-hub/content/docs/entropy/chainlist.mdx +++ b/apps/developer-hub/content/docs/entropy/chainlist.mdx @@ -9,8 +9,8 @@ import { EntropyTable } from "../../../src/components/EntropyTable"; ## Mainnets - The fees for mainnet are dynamically set. Always use the on-chain method - `entropy.getFeeV2()` to get the current fee. +
The fees for mainnet are dynamically set. Always use the on-chain method + `entropy.getFeeV2()` to get the current fee.
The following tables shows the total fees payable when using the **default provider**. @@ -29,10 +29,9 @@ The default provider fulfills the request by sending a transaction with a gas li Entropy callbacks the consumer as part of this transaction. ## Testnets - - The fees for testnets kept deliberately low and different from the mainnet - fees. +
The fees for testnets kept deliberately low and different from the mainnet + fees.
The Entropy contract is deployed on the following testnet chains: diff --git a/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx b/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx index 84aaff4599..804a5a72fd 100644 --- a/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx +++ b/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx @@ -24,9 +24,9 @@ Network: URL: https://hermes.pyth.network -For developers building on **Aptos testnet**, **Sui testnet** or **Near testnet**, please use the Hermes Beta endpoint: +
For developers building on **Aptos testnet**, **Sui testnet** or **Near testnet**, please use the Hermes Beta endpoint:
-URL: https://hermes-beta.pyth.network +
URL: https://hermes-beta.pyth.network
diff --git a/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx b/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx index a505f8bac7..4ee0b999f9 100644 --- a/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx +++ b/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx @@ -10,6 +10,7 @@ index: false # Price Feed Program Addresses on Pythnet +{ **Important:** The addresses on this page are for the Pythnet network itself, which is used to construct and deliver Pyth prices to other blockchains. If @@ -18,6 +19,7 @@ index: false refer to the [Contract Addresses](/price-feeds/contract-addresses) page and select your specific blockchain environment. +} The following table contains the addresses of the programs deployed on Pythnet that operate together to construct Pyth prices and deliver them to other blockchains: diff --git a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx index df6bf5c370..8d669f298d 100644 --- a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx +++ b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx @@ -12,11 +12,10 @@ index: false This tutorial walks through creating a complete application that uses Pyth Price feeds. The application includes a smart contract and an off-chain code invoking the contract. - - The tutorial is an in-depth walkthrough of contract development; more +
The tutorial is an in-depth walkthrough of contract development; more experienced developers may want to refer to [Use Real-time Price - Data](./use-real-time-data) for a more concise version. + Data](./use-real-time-data) for a more concise version.
Please choose your environment to get started: diff --git a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx index 72e6425982..2a9d7392d8 100644 --- a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx +++ b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx @@ -19,8 +19,8 @@ This part of the tutorial will conver the following: - Update and fetch the price from the contract using [hermes-client](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). - This tutorial is continuation of the [Part 1: Create a Contract](./part-1). If - you haven't completed that part yet, please do so before continuing. +
This tutorial is continuation of the [Part 1: Create a Contract](./part-1). If + you haven't completed that part yet, please do so before continuing.
## Deploy the contract diff --git a/apps/developer-hub/content/docs/pyth-core/current-fees.mdx b/apps/developer-hub/content/docs/pyth-core/current-fees.mdx index 1e40f8910c..dc9ecb11e0 100644 --- a/apps/developer-hub/content/docs/pyth-core/current-fees.mdx +++ b/apps/developer-hub/content/docs/pyth-core/current-fees.mdx @@ -11,11 +11,10 @@ index: false The following tables shows the total fees payable when updating a price feed. Please note the fees shown below is the amount paid in `msg.value` per price feed update. - - **Note**: The default fee of all chains **not** mentioned below is **1(one)** +
**Note**: The default fee of all chains **not** mentioned below is **1(one)** unit of the smallest denomination of the blockchain's native token (e.g., **1 - wei on Ethereum**). + wei on Ethereum**).
| **Network** | **Fees** | diff --git a/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx b/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx index 8212332fa1..b6c605350a 100644 --- a/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx +++ b/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx @@ -21,10 +21,10 @@ provides three different ways to fetch price updates: 1. [SDK](#sdk) - Fetching a price from Hermes requires a price feed ID. This ID serves as a +
Fetching a price from Hermes requires a price feed ID. This ID serves as a unique identifier for each price feed (e.g., BTC/USD). The complete list of Pyth price feed IDs is available at - https://pyth.network/developers/price-feed-ids + https://pyth.network/developers/price-feed-ids
## REST API diff --git a/apps/developer-hub/content/docs/pyth-core/pythnet-reference/schedule-format.mdx b/apps/developer-hub/content/docs/pyth-core/pythnet-reference/schedule-format.mdx index b2d52f091e..471715b5e7 100644 --- a/apps/developer-hub/content/docs/pyth-core/pythnet-reference/schedule-format.mdx +++ b/apps/developer-hub/content/docs/pyth-core/pythnet-reference/schedule-format.mdx @@ -32,7 +32,7 @@ If `weekly_schedule` is also undefined, pyth-agent will default to 24/7 publishi - `Timezone` - A human-readable tz database TZ identifier of the market’s local timezone, such as `America/New_York`. **Full list of identifiers can be found [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)**. - Daylight-saving time is automatically handled by the pyth-agent. +
Daylight-saving time is automatically handled by the pyth-agent.
- `WeeklySchedule` - A list of seven comma-separated `DaySchedule` entries that define the recurring weekly schedule of a product’s market hours. Each `DaySchedule` entry corresponds to a day of the week, starting from Monday. @@ -71,7 +71,7 @@ If `weekly_schedule` is also undefined, pyth-agent will default to 24/7 publishi ## Weekly Schedule Format (Deprecated) - This field is deprecated in favor of `schedule`. +
This field is deprecated in favor of `schedule`.
This document outlines the rules for specifying contents of a new Pyth product metadata field - `weekly_schedule` . The field specifies the recurring weekly schedule of a product’s market hours. It serves as a reference for `pyth-agent` to stop publishing outside the hours specified in the schedule. Notable use cases include: diff --git a/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx b/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx index 295dd9846b..d046f7db3d 100644 --- a/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx +++ b/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx @@ -23,11 +23,11 @@ The sponsored feeds can vary by network. Please see the relevant section below f - [Movement](sponsored-feeds/movement) - DISCLAIMER: While the Pyth Data Association strives to deliver timely updates, +
DISCLAIMER: While the Pyth Data Association strives to deliver timely updates, these sponsored feeds may occasionally experience delays in updates caused by chain halts, gas estimations and other issues. Applications are advised to run their own scheduler. Find out how you can run your own scheduler - [here](/price-feeds/schedule-price-updates/using-scheduler). + [here](/price-feeds/schedule-price-updates/using-scheduler).
If you would like to see additional feeds on this list, please fill in this [form](https://tally.so/r/nGz2jj) to signal your interest. diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx index 3b2d3b7561..886b3d5621 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx @@ -63,11 +63,11 @@ module example::example { ``` - The `pyth_price_update` argument contains verified prices from Pyth. Calling +
The `pyth_price_update` argument contains verified prices from Pyth. Calling `pyth::update_price_feeds` with this value updates the on-chain Pyth price and ensures your application has recent price data. The pyth_price_update can be fetched from Hermes; Consult [Fetch Price Updates](../fetch-price-updates) for - more information on how to fetch the `pyth_price_update`. + more information on how to fetch the `pyth_price_update`.
The code snippet above does the following things: diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx index d5b5cf77b6..ed9e6052a6 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx @@ -90,9 +90,9 @@ Calling `pyth_contract.update_price_feeds` with this value updates the on-chain The `update_data` can be fetched from Hermes; Consult [Fetch Price Updates](https://docs.pyth.network/price-feeds/fetch-price-updates) for more information on how to fetch the `update_data`. - Regarding the Pyth contract on Fuel, the caller must pay the fee in the base +
Regarding the Pyth contract on Fuel, the caller must pay the fee in the base asset for functions like `update_price_feeds`. The fee is currently set to the - minimum possible value (1 wei). + minimum possible value (1 wei).
The code snippet above does the following things: diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx index 63f4c87360..1de775205e 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx @@ -166,20 +166,18 @@ const result = await wallet.signAndExecuteTransaction(txBlock); ``` By calling the `updatePriceFeeds` function, the `IotaPythClient` adds the necessary transactions to the transaction block to update the price feeds. - -Your IOTA Move module **should NOT** have a hard-coded call to `pyth::update_single_price_feed.` In other words, a contract should **never call** the IOTA Pyth `pyth::update_single_price_feed` entry point. Instead, it should be called directly from client code (e.g., Typescript or Rust). +
Your IOTA Move module **should NOT** have a hard-coded call to `pyth::update_single_price_feed.` In other words, a contract should **never call** the IOTA Pyth `pyth::update_single_price_feed` entry point. Instead, it should be called directly from client code (e.g., Typescript or Rust).
-When IOTA contracts are [upgraded](https://docs.iota.org/developer/iota-101/move-overview/package-upgrades/introduction), the address changes, which makes the old address no longer valid. If your module has a hard-coded call to `pyth::update_single_price_feed` living at a fixed call-site, it may eventually get bricked due to how Pyth upgrades are implemented. (Pyth only allow users to interact with the most recent package version for security reasons). +
When IOTA contracts are [upgraded](https://docs.iota.org/developer/iota-101/move-overview/package-upgrades/introduction), the address changes, which makes the old address no longer valid. If your module has a hard-coded call to `pyth::update_single_price_feed` living at a fixed call-site, it may eventually get bricked due to how Pyth upgrades are implemented. (Pyth only allow users to interact with the most recent package version for security reasons).
-Therefore, you should build a [IOTA programmable transaction](https://docs.iota.org/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview) that first updates the price by calling `pyth::update_single_price_feed` at the latest call-site from the client-side and then call a function in your contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the recently updated price. -You can use `IOTAPythClient` to build such transactions and handle all the complexity of updating the price feeds. +
Therefore, you should build a [IOTA programmable transaction](https://docs.iota.org/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview) that first updates the price by calling `pyth::update_single_price_feed` at the latest call-site from the client-side and then call a function in your contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the recently updated price.
+
You can use `IOTAPythClient` to build such transactions and handle all the complexity of updating the price feeds.
-Consult [Fetch Price Updates](../fetch-price-updates) for more information on how to fetch the `pyth_price_update`. +
Consult [Fetch Price Updates](../fetch-price-updates) for more information on how to fetch the `pyth_price_update`.
- ## Additional Resources You may find these additional resources helpful for developing your IOTA application. diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx index ee5557bb5e..2b5295f309 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx @@ -12,10 +12,11 @@ index: false This guide explains how to fetch the latest prices and subscribe to real-time price updates in off-chain applications. +{ [`price-service-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) was is deprecated and replaced by the [`hermes-client`](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). It can be used for fetching prices for off-chain applications as well as fetching price updates. Please refer to the [fetch-price-updates](../fetch-price-updates) guide for the details. - +} \ No newline at end of file diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx index 264ed5b70d..c707a9c3dd 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx @@ -27,10 +27,11 @@ pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.i ``` -At the time of writing, [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) is compatible with Anchor `v0.28.0{:js}`, `v0.29.0{:js}`, and `v0.30.1{:js}`. -If you are on `v0.30.0{:js}` or any other version, please move to `v0.30.1{:js}`. +
At the time of writing, [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) is compatible with Anchor `v0.28.0{:js}`, `v0.29.0{:js}`, and `v0.30.1{:js}`. +If you are on `v0.30.0{:js}` or any other version, please move to `v0.30.1{:js}`.
+ ### Typescript SDK Pyth provides two Typescript packages, [@pythnetwork/hermes-client](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js) and [@pythnetwork/pyth-solana-receiver](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/sdk/js/pyth_solana_receiver), for fetching Pyth prices and submitting them to the blockchain respectively. @@ -59,12 +60,14 @@ pub struct Sample<'info> { } ``` + -Users must ensure that the account passed to their instruction is owned by the Pyth Pull Oracle program. +
Users must ensure that the account passed to their instruction is owned by the Pyth Pull Oracle program. Using Anchor with the `Account<'info, PriceUpdateV2>` type will automatically perform this check. -However, it is the developer's responsibility to perform this check if they are not using Anchor. +However, it is the developer's responsibility to perform this check if they are not using Anchor.
+ Next, update the instruction logic to read the price from the price update account: ```rust copy @@ -85,14 +88,14 @@ pub fn sample(ctx: Context) -> Result<()> { ``` - Users must validate the price update for the appropriate **price +
Users must validate the price update for the appropriate **price feed** and **timestamp**. `PriceUpdateV2` guarantees that the account contains a verified price for _some_ price feed at _some_ point in time. There are various methods on this struct (such as `get_price_no_older_than`) that users - can use to implement the necessary checks. + can use to implement the necessary checks.
-If you choose the price feed account integration (see below), you -can use an account address check to validate the price feed ID. +
If you choose the price feed account integration (see below), you +can use an account address check to validate the price feed ID.
@@ -136,18 +139,17 @@ const solUsdPriceFeedAccount = pythSolanaReceiver ``` - The Price Feed Accounts integration assumes that an off-chain process is +
The Price Feed Accounts integration assumes that an off-chain process is continuously updating each price feed. The Pyth Data Association sponsors price updates for a subset of commonly used price feeds on shard 0. Please see [Sponsored Feeds](/price-feeds/sponsored-feeds) for a list of sponsored feeds - and their account addresses. + and their account addresses.
-Additionally, updating a price feed is a +
Additionally, updating a price feed is a permissionless operation, and anyone can run this process. Please see [Using Scheduler](/price-feeds/schedule-price-updates/using-scheduler) for more information. Running the scheduler can help with reliability and update -feed/shard pairs that are not part of the default schedule. - +feed/shard pairs that are not part of the default schedule.
### Price Update Accounts @@ -235,14 +237,14 @@ await pythSolanaReceiver.provider.sendAll( The [SDK documentation](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/sdk/js/pyth_solana_receiver) contains more information about interacting with the Pyth solana receiver contract, including working examples. - Posting and verifying price updates currently requires multiple transactions +
Posting and verifying price updates currently requires multiple transactions on Solana. If your usecase requires a single transaction, you can reduce the verification level of the posted price updates by replacing `addPostPriceUpdates` by `addPostPartiallyVerifiedPriceUpdates` in the transaction builder. Please read the [VerificationLevel](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs#L20) docs to understand more about the data integrity tradeoffs when using - partially verified price updates. + partially verified price updates.
## Time-Weighted Average Price (TWAP) diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx index 11c092631d..c035d04c14 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx @@ -116,14 +116,14 @@ Calling pyth.update_price_feeds with this value updates the on-chain Pyth price The pyth_price_update can be fetched from Hermes; Consult [Fetch Price Updates](https://docs.pyth.network/price-feeds/fetch-price-updates) for more information on how to fetch the pyth_price_update. - Unlike Ethereum, there is no native token on Starknet. You cannot pass tokens +
Unlike Ethereum, there is no native token on Starknet. You cannot pass tokens implicitly when calling functions. Moreover, there is no concept of a designated payer account, unlike Solana. In Starknet, all token transfers must be performed explicitly by calling functions on the token's ERC20 contract. Regarding the Pyth contract on Starknet, the caller must approve the fee transfer before calling `update_price_feeds` or using similar methods. You can use **STRK** or **ETH** to pay the fee, but STRK is preferred. The fee is - currently set to the minimum possible value (1e-18 STRK, 1 WEI). + currently set to the minimum possible value (1e-18 STRK, 1 WEI).
The code snippet above does the following things: @@ -157,11 +157,10 @@ const currentPrices = await connection.getLatestPriceFeeds([priceId]); // Convert the price update to Starknet format. const pythUpdate = ByteBuffer.fromBase64(currentPrices[0].vaa); ``` - - Price updates must be converted to `ByteBuffer` before being passed on to the +
Price updates must be converted to `ByteBuffer` before being passed on to the Pyth contract on Starknet. Use the `ByteBuffer` type from - `@pythnetwork/pyth-starknet-js` package as shown above. + `@pythnetwork/pyth-starknet-js` package as shown above.
## Additional Resources diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx index 4ccea26e97..225efd5a44 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx @@ -168,16 +168,14 @@ const result = await wallet.signAndExecuteTransactionBlock(txBlock); By calling the `updatePriceFeeds` function, the `SuiPythClient` adds the necessary transactions to the transaction block to update the price feeds. +
Your Sui Move module **should NOT** have a hard-coded call to `pyth::update_single_price_feed.` In other words, a contract should **never call** the Sui Pyth `pyth::update_single_price_feed` entry point. Instead, it should be called directly from client code (e.g., Typescript or Rust).
-Your Sui Move module **should NOT** have a hard-coded call to `pyth::update_single_price_feed.` In other words, a contract should **never call** the Sui Pyth `pyth::update_single_price_feed` entry point. Instead, it should be called directly from client code (e.g., Typescript or Rust). +
When Sui contracts are [upgraded](<(https://docs.sui.io/build/package-upgrades)>), the address changes, which makes the old address no longer valid. If your module has a hard-coded call to `pyth::update_single_price_feed` living at a fixed call-site, it may eventually get bricked due to how Pyth upgrades are implemented. (Pyth only allow users to interact with the most recent package version for security reasons).
-When Sui contracts are [upgraded](<(https://docs.sui.io/build/package-upgrades)>), the address changes, which makes the old address no longer valid. If your module has a hard-coded call to `pyth::update_single_price_feed` living at a fixed call-site, it may eventually get bricked due to how Pyth upgrades are implemented. (Pyth only allow users to interact with the most recent package version for security reasons). - -Therefore, you should build a [Sui programmable transaction](https://docs.sui.io/build/prog-trans-ts-sdk) that first updates the price by calling `pyth::update_single_price_feed` at the latest call-site from the client-side and then call a function in your contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the recently updated price. -You can use `SuiPythClient` to build such transactions and handle all the complexity of updating the price feeds. - -Consult [Fetch Price Updates](../fetch-price-updates) for more information on how to fetch the `pyth_price_update`. +
Therefore, you should build a [Sui programmable transaction](https://docs.sui.io/build/prog-trans-ts-sdk) that first updates the price by calling `pyth::update_single_price_feed` at the latest call-site from the client-side and then call a function in your contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the recently updated price. +You can use `SuiPythClient` to build such transactions and handle all the complexity of updating the price feeds.
+
Consult [Fetch Price Updates](../fetch-price-updates) for more information on how to fetch the `pyth_price_update`.
## Additional Resources diff --git a/packages/component-library/src/InfoBox/index.stories.tsx b/packages/component-library/src/InfoBox/index.stories.tsx new file mode 100644 index 0000000000..5d5514a576 --- /dev/null +++ b/packages/component-library/src/InfoBox/index.stories.tsx @@ -0,0 +1,53 @@ +import * as icons from "@phosphor-icons/react/dist/ssr"; +import type { Meta, StoryObj } from "@storybook/react"; + +import { InfoBox as InfoBoxComponent } from "./index.jsx"; + +const iconControl = { + control: "select", + options: Object.keys(icons), + mapping: Object.fromEntries( + Object.entries(icons).map(([iconName, Icon]) => [ + iconName, + , + ]), + ), + description: "The icon of the info box.", + table: { + category: "Appearance", + }, +} as const; + +const meta = { + component: InfoBoxComponent, + argTypes: { + header: { + control: "text", + table: { + category: "Content", + }, + }, + children: { + control: "text", + table: { + category: "Content", + }, + }, + variant: { + control: "select", + options: ["Neutral", "Info", "Warning", "Error", "Data", "Success"], + description: "The variant of the info box.", + table: { + category: "Appearance", + }, + }, + icon: iconControl, + }, +} satisfies Meta; +export default meta; + +export const InfoBox = { + args: { + children: "This is a default info box with some content.", + }, +} satisfies StoryObj; From 1f13ad7b7b259e509fb2ab62ea1dae118ece3db4 Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Fri, 12 Sep 2025 17:46:14 +0100 Subject: [PATCH 2/3] fix: more info boxes --- .../docs/pyth-core/contract-addresses/pythnet.mdx | 6 ++---- .../docs/pyth-core/use-real-time-data/off-chain.mdx | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx b/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx index 4ee0b999f9..fca54a2d9b 100644 --- a/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx +++ b/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx @@ -10,16 +10,14 @@ index: false # Price Feed Program Addresses on Pythnet -{ - **Important:** The addresses on this page are for the Pythnet network itself, +
**Important:** The addresses on this page are for the Pythnet network itself, which is used to construct and deliver Pyth prices to other blockchains. If you are building an application on EVM, Solana, SVM, or another chain, you should use the Pyth program deployed on your target chain instead. Please refer to the [Contract Addresses](/price-feeds/contract-addresses) page and - select your specific blockchain environment. + select your specific blockchain environment.
-} The following table contains the addresses of the programs deployed on Pythnet that operate together to construct Pyth prices and deliver them to other blockchains: diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx index 2b5295f309..c9353685b5 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx @@ -12,11 +12,10 @@ index: false This guide explains how to fetch the latest prices and subscribe to real-time price updates in off-chain applications. -{ + - [`price-service-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) was is deprecated and replaced by the [`hermes-client`](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). - It can be used for fetching prices for off-chain applications as well as fetching price updates. +
[`price-service-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) was is deprecated and replaced by the [`hermes-client`](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). + It can be used for fetching prices for off-chain applications as well as fetching price updates.
-Please refer to the [fetch-price-updates](../fetch-price-updates) guide for the details. +
Please refer to the [fetch-price-updates](../fetch-price-updates) guide for the details.
-} \ No newline at end of file From c4c72efddde92af006ccb556d2f585d8867b93bf Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Fri, 12 Sep 2025 18:26:30 +0100 Subject: [PATCH 3/3] fix: formatting --- .../content/docs/entropy/chainlist.mdx | 13 ++++-- .../api-instances-and-providers/hermes.mdx | 2 +- .../pyth-core/contract-addresses/pythnet.mdx | 15 ++++--- .../pyth-core/create-your-first-pyth-app.mdx | 9 ++-- .../create-your-first-pyth-app/evm/part-2.mdx | 6 ++- .../content/docs/pyth-core/current-fees.mdx | 9 ++-- .../docs/pyth-core/fetch-price-updates.mdx | 10 +++-- .../docs/pyth-core/sponsored-feeds.mdx | 12 +++--- .../pyth-core/use-real-time-data/aptos.mdx | 13 +++--- .../pyth-core/use-real-time-data/fuel.mdx | 8 ++-- .../pyth-core/use-real-time-data/iota.mdx | 43 +++++++++++++++---- .../use-real-time-data/off-chain.mdx | 1 - .../pyth-core/use-real-time-data/solana.mdx | 27 ++++++------ .../pyth-core/use-real-time-data/starknet.mdx | 28 +++++++----- .../docs/pyth-core/use-real-time-data/sui.mdx | 11 ++++- .../src/components/EntropyTable/index.tsx | 2 +- 16 files changed, 137 insertions(+), 72 deletions(-) diff --git a/apps/developer-hub/content/docs/entropy/chainlist.mdx b/apps/developer-hub/content/docs/entropy/chainlist.mdx index 6ccfa9219c..b33589359e 100644 --- a/apps/developer-hub/content/docs/entropy/chainlist.mdx +++ b/apps/developer-hub/content/docs/entropy/chainlist.mdx @@ -9,8 +9,10 @@ import { EntropyTable } from "../../../src/components/EntropyTable"; ## Mainnets -
The fees for mainnet are dynamically set. Always use the on-chain method - `entropy.getFeeV2()` to get the current fee.
+
+ The fees for mainnet are dynamically set. Always use the on-chain method + `entropy.getFeeV2()` to get the current fee. +
The following tables shows the total fees payable when using the **default provider**. @@ -29,9 +31,12 @@ The default provider fulfills the request by sending a transaction with a gas li Entropy callbacks the consumer as part of this transaction. ## Testnets + -
The fees for testnets kept deliberately low and different from the mainnet - fees.
+
+ The fees for testnets kept deliberately low and different from the mainnet + fees. +
The Entropy contract is deployed on the following testnet chains: diff --git a/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx b/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx index 804a5a72fd..f06cfac13d 100644 --- a/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx +++ b/apps/developer-hub/content/docs/pyth-core/api-instances-and-providers/hermes.mdx @@ -24,7 +24,7 @@ Network: URL: https://hermes.pyth.network -
For developers building on **Aptos testnet**, **Sui testnet** or **Near testnet**, please use the Hermes Beta endpoint:
+
For developers building on **Aptos testnet**, **Sui testnet** or **Near testnet**, please use the Hermes Beta endpoint:
URL: https://hermes-beta.pyth.network
diff --git a/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx b/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx index fca54a2d9b..bad98d851e 100644 --- a/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx +++ b/apps/developer-hub/content/docs/pyth-core/contract-addresses/pythnet.mdx @@ -11,12 +11,15 @@ index: false # Price Feed Program Addresses on Pythnet -
**Important:** The addresses on this page are for the Pythnet network itself, - which is used to construct and deliver Pyth prices to other blockchains. If - you are building an application on EVM, Solana, SVM, or another chain, you - should use the Pyth program deployed on your target chain instead. Please - refer to the [Contract Addresses](/price-feeds/contract-addresses) page and - select your specific blockchain environment.
+
+ **Important:** The addresses on this page are for the Pythnet network + itself, which is used to construct and deliver Pyth prices to other + blockchains. If you are building an application on EVM, Solana, SVM, or + another chain, you should use the Pyth program deployed on your target chain + instead. Please refer to the [Contract + Addresses](/price-feeds/contract-addresses) page and select your specific + blockchain environment. +
The following table contains the addresses of the programs deployed on Pythnet that operate together to construct Pyth prices and deliver them to other blockchains: diff --git a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx index 8d669f298d..5b28f99fbf 100644 --- a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx +++ b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app.mdx @@ -12,10 +12,13 @@ index: false This tutorial walks through creating a complete application that uses Pyth Price feeds. The application includes a smart contract and an off-chain code invoking the contract. + -
The tutorial is an in-depth walkthrough of contract development; more - experienced developers may want to refer to [Use Real-time Price - Data](./use-real-time-data) for a more concise version.
+
+ The tutorial is an in-depth walkthrough of contract development; more + experienced developers may want to refer to [Use Real-time Price + Data](./use-real-time-data) for a more concise version. +
Please choose your environment to get started: diff --git a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx index 2a9d7392d8..2e1e6b6744 100644 --- a/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx +++ b/apps/developer-hub/content/docs/pyth-core/create-your-first-pyth-app/evm/part-2.mdx @@ -19,8 +19,10 @@ This part of the tutorial will conver the following: - Update and fetch the price from the contract using [hermes-client](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). -
This tutorial is continuation of the [Part 1: Create a Contract](./part-1). If - you haven't completed that part yet, please do so before continuing.
+
+ This tutorial is continuation of the [Part 1: Create a Contract](./part-1). + If you haven't completed that part yet, please do so before continuing. +
## Deploy the contract diff --git a/apps/developer-hub/content/docs/pyth-core/current-fees.mdx b/apps/developer-hub/content/docs/pyth-core/current-fees.mdx index dc9ecb11e0..0c2e421801 100644 --- a/apps/developer-hub/content/docs/pyth-core/current-fees.mdx +++ b/apps/developer-hub/content/docs/pyth-core/current-fees.mdx @@ -11,10 +11,13 @@ index: false The following tables shows the total fees payable when updating a price feed. Please note the fees shown below is the amount paid in `msg.value` per price feed update. + -
**Note**: The default fee of all chains **not** mentioned below is **1(one)** - unit of the smallest denomination of the blockchain's native token (e.g., **1 - wei on Ethereum**).
+
+ **Note**: The default fee of all chains **not** mentioned below is + **1(one)** unit of the smallest denomination of the blockchain's native + token (e.g., **1 wei on Ethereum**). +
| **Network** | **Fees** | diff --git a/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx b/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx index b6c605350a..a71e14e94b 100644 --- a/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx +++ b/apps/developer-hub/content/docs/pyth-core/fetch-price-updates.mdx @@ -21,10 +21,12 @@ provides three different ways to fetch price updates: 1. [SDK](#sdk) -
Fetching a price from Hermes requires a price feed ID. This ID serves as a - unique identifier for each price feed (e.g., BTC/USD). The complete list of - Pyth price feed IDs is available at - https://pyth.network/developers/price-feed-ids
+
+ Fetching a price from Hermes requires a price feed ID. This ID serves as a + unique identifier for each price feed (e.g., BTC/USD). The complete list of + Pyth price feed IDs is available at + https://pyth.network/developers/price-feed-ids +
## REST API diff --git a/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx b/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx index d046f7db3d..21211b0c2a 100644 --- a/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx +++ b/apps/developer-hub/content/docs/pyth-core/sponsored-feeds.mdx @@ -23,11 +23,13 @@ The sponsored feeds can vary by network. Please see the relevant section below f - [Movement](sponsored-feeds/movement) -
DISCLAIMER: While the Pyth Data Association strives to deliver timely updates, - these sponsored feeds may occasionally experience delays in updates caused by - chain halts, gas estimations and other issues. Applications are advised to run - their own scheduler. Find out how you can run your own scheduler - [here](/price-feeds/schedule-price-updates/using-scheduler).
+
+ DISCLAIMER: While the Pyth Data Association strives to deliver timely + updates, these sponsored feeds may occasionally experience delays in updates + caused by chain halts, gas estimations and other issues. Applications are + advised to run their own scheduler. Find out how you can run your own + scheduler [here](/price-feeds/schedule-price-updates/using-scheduler). +
If you would like to see additional feeds on this list, please fill in this [form](https://tally.so/r/nGz2jj) to signal your interest. diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx index 886b3d5621..f2e55341a0 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/aptos.mdx @@ -63,11 +63,14 @@ module example::example { ``` -
The `pyth_price_update` argument contains verified prices from Pyth. Calling - `pyth::update_price_feeds` with this value updates the on-chain Pyth price and - ensures your application has recent price data. The pyth_price_update can be - fetched from Hermes; Consult [Fetch Price Updates](../fetch-price-updates) for - more information on how to fetch the `pyth_price_update`.
+
+ The `pyth_price_update` argument contains verified prices from Pyth. Calling + `pyth::update_price_feeds` with this value updates the on-chain Pyth price + and ensures your application has recent price data. The pyth_price_update + can be fetched from Hermes; Consult [Fetch Price + Updates](../fetch-price-updates) for more information on how to fetch the + `pyth_price_update`. +
The code snippet above does the following things: diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx index ed9e6052a6..0082297bad 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/fuel.mdx @@ -90,9 +90,11 @@ Calling `pyth_contract.update_price_feeds` with this value updates the on-chain The `update_data` can be fetched from Hermes; Consult [Fetch Price Updates](https://docs.pyth.network/price-feeds/fetch-price-updates) for more information on how to fetch the `update_data`. -
Regarding the Pyth contract on Fuel, the caller must pay the fee in the base - asset for functions like `update_price_feeds`. The fee is currently set to the - minimum possible value (1 wei).
+
+ Regarding the Pyth contract on Fuel, the caller must pay the fee in the base + asset for functions like `update_price_feeds`. The fee is currently set to + the minimum possible value (1 wei). +
The code snippet above does the following things: diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx index 1de775205e..bb67a44228 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/iota.mdx @@ -166,16 +166,43 @@ const result = await wallet.signAndExecuteTransaction(txBlock); ``` By calling the `updatePriceFeeds` function, the `IotaPythClient` adds the necessary transactions to the transaction block to update the price feeds. - - -
Your IOTA Move module **should NOT** have a hard-coded call to `pyth::update_single_price_feed.` In other words, a contract should **never call** the IOTA Pyth `pyth::update_single_price_feed` entry point. Instead, it should be called directly from client code (e.g., Typescript or Rust).
-
When IOTA contracts are [upgraded](https://docs.iota.org/developer/iota-101/move-overview/package-upgrades/introduction), the address changes, which makes the old address no longer valid. If your module has a hard-coded call to `pyth::update_single_price_feed` living at a fixed call-site, it may eventually get bricked due to how Pyth upgrades are implemented. (Pyth only allow users to interact with the most recent package version for security reasons).
- -
Therefore, you should build a [IOTA programmable transaction](https://docs.iota.org/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview) that first updates the price by calling `pyth::update_single_price_feed` at the latest call-site from the client-side and then call a function in your contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the recently updated price.
-
You can use `IOTAPythClient` to build such transactions and handle all the complexity of updating the price feeds.
+ -
Consult [Fetch Price Updates](../fetch-price-updates) for more information on how to fetch the `pyth_price_update`.
+
+ Your IOTA Move module **should NOT** have a hard-coded call to + `pyth::update_single_price_feed.` In other words, a contract should **never + call** the IOTA Pyth `pyth::update_single_price_feed` entry point. Instead, it + should be called directly from client code (e.g., Typescript or Rust). +
+ +
+ When IOTA contracts are + [upgraded](https://docs.iota.org/developer/iota-101/move-overview/package-upgrades/introduction), + the address changes, which makes the old address no longer valid. If your + module has a hard-coded call to `pyth::update_single_price_feed` living at a + fixed call-site, it may eventually get bricked due to how Pyth upgrades are + implemented. (Pyth only allow users to interact with the most recent package + version for security reasons). +
+ +
+ Therefore, you should build a [IOTA programmable + transaction](https://docs.iota.org/developer/iota-101/transactions/ptb/programmable-transaction-blocks-overview) + that first updates the price by calling `pyth::update_single_price_feed` at + the latest call-site from the client-side and then call a function in your + contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the + recently updated price. +
+
+ You can use `IOTAPythClient` to build such transactions and handle all the + complexity of updating the price feeds. +
+ +
+ Consult [Fetch Price Updates](../fetch-price-updates) for more information on + how to fetch the `pyth_price_update`. +
## Additional Resources diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx index c9353685b5..cba7d33b07 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/off-chain.mdx @@ -12,7 +12,6 @@ index: false This guide explains how to fetch the latest prices and subscribe to real-time price updates in off-chain applications. -
[`price-service-sdk`](https://github.com/pyth-network/pyth-crosschain/tree/main/price_service/client/js) was is deprecated and replaced by the [`hermes-client`](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js). It can be used for fetching prices for off-chain applications as well as fetching price updates.
diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx index c707a9c3dd..4b6e15fc27 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/solana.mdx @@ -31,7 +31,6 @@ pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.i If you are on `v0.30.0{:js}` or any other version, please move to `v0.30.1{:js}`.
- ### Typescript SDK Pyth provides two Typescript packages, [@pythnetwork/hermes-client](https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes/client/js) and [@pythnetwork/pyth-solana-receiver](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/sdk/js/pyth_solana_receiver), for fetching Pyth prices and submitting them to the blockchain respectively. @@ -60,14 +59,12 @@ pub struct Sample<'info> { } ``` -
Users must ensure that the account passed to their instruction is owned by the Pyth Pull Oracle program. Using Anchor with the `Account<'info, PriceUpdateV2>` type will automatically perform this check. However, it is the developer's responsibility to perform this check if they are not using Anchor.
- Next, update the instruction logic to read the price from the price update account: ```rust copy @@ -94,8 +91,10 @@ pub fn sample(ctx: Context) -> Result<()> { various methods on this struct (such as `get_price_no_older_than`) that users can use to implement the necessary checks. -
If you choose the price feed account integration (see below), you -can use an account address check to validate the price feed ID.
+
+ If you choose the price feed account integration (see below), you can use an + account address check to validate the price feed ID. +
@@ -237,14 +236,16 @@ await pythSolanaReceiver.provider.sendAll( The [SDK documentation](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/sdk/js/pyth_solana_receiver) contains more information about interacting with the Pyth solana receiver contract, including working examples. -
Posting and verifying price updates currently requires multiple transactions - on Solana. If your usecase requires a single transaction, you can reduce the - verification level of the posted price updates by replacing - `addPostPriceUpdates` by `addPostPartiallyVerifiedPriceUpdates` in the - transaction builder. Please read the - [VerificationLevel](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs#L20) - docs to understand more about the data integrity tradeoffs when using - partially verified price updates.
+
+ Posting and verifying price updates currently requires multiple transactions + on Solana. If your usecase requires a single transaction, you can reduce the + verification level of the posted price updates by replacing + `addPostPriceUpdates` by `addPostPartiallyVerifiedPriceUpdates` in the + transaction builder. Please read the + [VerificationLevel](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/pyth_solana_receiver_sdk/src/price_update.rs#L20) + docs to understand more about the data integrity tradeoffs when using + partially verified price updates. +
## Time-Weighted Average Price (TWAP) diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx index c035d04c14..944f1f364d 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/starknet.mdx @@ -116,14 +116,17 @@ Calling pyth.update_price_feeds with this value updates the on-chain Pyth price The pyth_price_update can be fetched from Hermes; Consult [Fetch Price Updates](https://docs.pyth.network/price-feeds/fetch-price-updates) for more information on how to fetch the pyth_price_update. -
Unlike Ethereum, there is no native token on Starknet. You cannot pass tokens - implicitly when calling functions. Moreover, there is no concept of a - designated payer account, unlike Solana. In Starknet, all token transfers must - be performed explicitly by calling functions on the token's ERC20 contract. - Regarding the Pyth contract on Starknet, the caller must approve the fee - transfer before calling `update_price_feeds` or using similar methods. You can - use **STRK** or **ETH** to pay the fee, but STRK is preferred. The fee is - currently set to the minimum possible value (1e-18 STRK, 1 WEI).
+
+ Unlike Ethereum, there is no native token on Starknet. You cannot pass + tokens implicitly when calling functions. Moreover, there is no concept of a + designated payer account, unlike Solana. In Starknet, all token transfers + must be performed explicitly by calling functions on the token's ERC20 + contract. Regarding the Pyth contract on Starknet, the caller must approve + the fee transfer before calling `update_price_feeds` or using similar + methods. You can use **STRK** or **ETH** to pay the fee, but STRK is + preferred. The fee is currently set to the minimum possible value (1e-18 + STRK, 1 WEI). +
The code snippet above does the following things: @@ -157,10 +160,13 @@ const currentPrices = await connection.getLatestPriceFeeds([priceId]); // Convert the price update to Starknet format. const pythUpdate = ByteBuffer.fromBase64(currentPrices[0].vaa); ``` + -
Price updates must be converted to `ByteBuffer` before being passed on to the - Pyth contract on Starknet. Use the `ByteBuffer` type from - `@pythnetwork/pyth-starknet-js` package as shown above.
+
+ Price updates must be converted to `ByteBuffer` before being passed on to + the Pyth contract on Starknet. Use the `ByteBuffer` type from + `@pythnetwork/pyth-starknet-js` package as shown above. +
## Additional Resources diff --git a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx index 225efd5a44..90963450f2 100644 --- a/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx +++ b/apps/developer-hub/content/docs/pyth-core/use-real-time-data/sui.mdx @@ -172,8 +172,15 @@ By calling the `updatePriceFeeds` function, the `SuiPythClient` adds the necessa
When Sui contracts are [upgraded](<(https://docs.sui.io/build/package-upgrades)>), the address changes, which makes the old address no longer valid. If your module has a hard-coded call to `pyth::update_single_price_feed` living at a fixed call-site, it may eventually get bricked due to how Pyth upgrades are implemented. (Pyth only allow users to interact with the most recent package version for security reasons).
-
Therefore, you should build a [Sui programmable transaction](https://docs.sui.io/build/prog-trans-ts-sdk) that first updates the price by calling `pyth::update_single_price_feed` at the latest call-site from the client-side and then call a function in your contract that invokes `pyth::get_price` on the `PriceInfoObject` to get the recently updated price. -You can use `SuiPythClient` to build such transactions and handle all the complexity of updating the price feeds.
+
+ Therefore, you should build a [Sui programmable + transaction](https://docs.sui.io/build/prog-trans-ts-sdk) that first updates + the price by calling `pyth::update_single_price_feed` at the latest call-site + from the client-side and then call a function in your contract that invokes + `pyth::get_price` on the `PriceInfoObject` to get the recently updated price. + You can use `SuiPythClient` to build such transactions and handle all the + complexity of updating the price feeds. +
Consult [Fetch Price Updates](../fetch-price-updates) for more information on how to fetch the `pyth_price_update`.
diff --git a/apps/developer-hub/src/components/EntropyTable/index.tsx b/apps/developer-hub/src/components/EntropyTable/index.tsx index 4adb3a3053..322b41ce3b 100644 --- a/apps/developer-hub/src/components/EntropyTable/index.tsx +++ b/apps/developer-hub/src/components/EntropyTable/index.tsx @@ -46,7 +46,7 @@ export const EntropyTable = ({ isMainnet }: { isMainnet: boolean }) => { case StateType.Error: { return ( -

Failed to fetch the list of entropy contracts.

+ Failed to fetch the list of entropy contracts.
); }