) {
- let pyth_contract = abi(PythCore, PYTH_MAINNET_CONTRACT_ID);
- pyth_contract
- .update_price_feeds {
- asset_id: FUEL_ETH_BASE_ASSET_ID,
- coins: update_fee,
- }(update_data);
- }
-}
-```
-
-The `update_data` argument contains verified prices from Pyth.
-Calling `pyth_contract.update_price_feeds` with this value updates the on-chain Pyth price and ensures your application has recent price data.
-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).
-
-
-
-The code snippet above does the following things:
-
-1. Defines an `UpdatePrice` ABI with functions to interact with the Pyth contract.
-2. Implements the `UpdatePrice` ABI for the contract, providing the following functionality:
-
- - `valid_time_period()`: Retrieves the valid time period from the Pyth contract.
- - `get_price(price_feed_id)`: Gets the price for a given price feed ID.
- - `get_price_unsafe(price_feed_id)`: Gets the price for a given price feed ID without staleness checks.
- - `update_fee(update_data)`: Calculates the fee required to update the price feeds.
- - `update_price_feeds(update_fee, update_data)`: Updates the price feeds with the provided data and fee.
-
-3. Uses the `PYTH_MAINNET_CONTRACT_ID` constant to interact with the Pyth contract on testnet.
-4. Uses the `FUEL_ETH_BASE_ASSET_ID` constant as the asset ID for paying update fees.
-
-To use this contract, you would typically:
-
-1. Call `update_fee()` to get the required fee for updating price feeds.
-2. Call `update_price_feeds()` with the fee and update data to refresh the price feeds.
-3. Use `get_price()` or `get_price_unsafe()` to read the updated prices.
-
-### Write Client Code
-
-The code snippet below provides an example of how to fetch price updates using NextJS, a full example can be found [here](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/fuel/fetch-and-update-btc-price).
-
-```ts copy
-import { TestContractAbi__factory } from "@/sway-api";
-import PYTH_CONTRACT_ABI from "../abi/pyth-contract-abi.json";
-import { arrayify, Contract, hexlify } from "fuels";
-import { HermesClient } from "@pythnetwork/hermes-client";
-
-const HERMES_ENDPOINT = "https://hermes.pyth.network/";
-const FUEL_ETH_BASE_ASSET_ID =
- "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07";
-const ETH_USD_PRICE_FEED_ID =
- "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace"; // ETH/USD
-
-const contractId =
- CURRENT_ENVIRONMENT === "local"
- ? contractIds.testContract
- : (process.env.NEXT_PUBLIC_TESTNET_CONTRACT_ID as string); // Testnet Contract ID
-const pythContractId = process.env
- .NEXT_PUBLIC_PYTH_TESTNET_CONTRACT_ID as string; // Testnet Contract ID
-
-async function updateAndGetPrice() {
- const fetchPriceUpdateData = async () => {
- const connection = new HermesClient(HERMES_ENDPOINT);
-
- // Latest price updates
- const priceUpdates = await connection.getLatestPriceUpdates([
- ETH_USD_PRICE_FEED_ID,
- ]);
-
- const buffer = Buffer.from(priceUpdates.binary.data[0], "hex");
- return buffer;
- };
-
- const updateData = await fetchPriceUpdateData();
-
- const { waitForResult: waitForResultFee } = await contract.functions
- .update_fee([arrayify(updateData)])
- .addContracts([pythContract])
- .call();
- const { value: fee } = await waitForResultFee();
-
- await contract.functions
- .update_price_feeds(fee, [arrayify(updateData)])
- .addContracts([pythContract])
- .callParams({
- forward: [fee, hexlify(FUEL_ETH_BASE_ASSET_ID)],
- })
- .call();
-
- const { value: price } = await contract.functions
- .get_price(hexlify(PRICE_FEED_ID))
- .addContracts([pythContract])
- .get();
-
- console.log("Latest ETH/USD price after update:", price);
- return price;
-}
-
-updateAndGetPrice().catch(console.error);
-```
-
-## Additional Resources
-
-You may find these additional resources helpful for developing your Fuel application.
-
-### Interface
-
-The [Fuel Interface](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/fuel/contracts/pyth-interface/src) directory contains multiple files that define the functions and structures for interacting with the Pyth contract deployed on Fuel.
-
-### Example Applications
-
-- [fetch-and-update-btc-price](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/fuel/fetch-and-update-btc-price), which fetches the latest price update from Hermes and updates the Pyth price feeds on Fuel.
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/iota.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/iota.mdx
deleted file mode 100644
index bb67a44228..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/iota.mdx
+++ /dev/null
@@ -1,236 +0,0 @@
----
-title: Integrating Real-Time Pyth Data into IOTA Contracts
-description: >-
- This SDK includes code samples and best practices for integrating live Pyth
- price feeds into IOTA smart contracts.
-full: false
-index: false
----
-
-# How to Use Real-Time Data in IOTA Contracts
-
-This guide explains how to use real-time Pyth data in IOTA applications.
-
-## Install Pyth SDK
-
-Use the following dependency in your `Move.toml` file to use the latest Pyth IOTA package and its dependencies:
-
-
-
-
-```sh copy
-[dependencies.Pyth]
-git = "https://github.com/pyth-network/pyth-crosschain.git"
-subdir = "target_chains/sui/contracts"
-rev = "iota-contract-testnet"
-
-[dependencies.Wormhole]
-git = "https://github.com/pyth-network/pyth-crosschain.git"
-subdir = "target_chains/sui/contracts/vendor/wormhole_iota_testnet/wormhole"
-rev = "iota-contract-testnet"
-
-[dependencies.Iota]
-git = "https://github.com/iotaledger/iota.git"
-subdir = "crates/iota-framework/packages/iota-framework"
-rev = "751c23caf24efd071463b9ffd07eabcb15f44f31"
-```
-
-
-
-
-```sh copy
-[dependencies.Pyth]
-git = "https://github.com/pyth-network/pyth-crosschain.git"
-subdir = "target_chains/sui/contracts"
-rev = "iota-contract-mainnet"
-
-[dependencies.Wormhole]
-git = "https://github.com/pyth-network/pyth-crosschain.git"
-subdir = "target_chains/sui/contracts/vendor/wormhole_iota_mainnet/wormhole"
-rev = "iota-contract-mainnet"
-
-[dependencies.Iota]
-git = "https://github.com/iotaledger/iota.git"
-subdir = "crates/iota-framework/packages/iota-framework"
-rev = "751c23caf24efd071463b9ffd07eabcb15f44f31"
-```
-
-
-
-
-Pyth also provides a javascript SDK to construct transaction blocks that update price feeds:
-
-
-
- ```sh
- # NPM
- npm install --save @pythnetwork/pyth-iota-js
-
- # Yarn
- yarn add @pythnetwork/pyth-iota-js
- ```
-
-
-
-
-## Write Contract Code
-
-The code snippet below provides a general template for what your contract code should look like:
-
-```rust {18} copy
-module pyth_example::main {
- use iota::clock::Clock;
- use pyth::price_info;
- use pyth::price_identifier;
- use pyth::price;
- use pyth::pyth;
- use pyth::price_info::PriceInfoObject;
-
- const E_INVALID_ID: u64 = 1;
-
- public fun use_pyth_price(
- // Other arguments
- clock: &Clock,
- price_info_object: &PriceInfoObject,
- ){
- let max_age = 60;
- // Make sure the price is not older than max_age seconds
- let price_struct = pyth::get_price_no_older_than(price_info_object,clock, max_age);
-
- // Check the price feed ID
- let price_info = price_info::get_price_info_from_price_info_object(price_info_object);
- let price_id = price_identifier::get_bytes(&price_info::get_price_identifier(&price_info));
-
- // ETH/USD price feed ID
- // The complete list of feed IDs is available at https://pyth.network/developers/price-feed-ids
- // Note: IOTA uses the Pyth price feed ID without the `0x` prefix.
- assert!(price_id!=x"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", E_INVALID_ID);
-
- // Extract the price, decimal, and timestamp from the price struct and use them
- let decimal_i64 = price::get_expo(&price_struct);
- let price_i64 = price::get_price(&price_struct);
- let timestamp_sec = price::get_timestamp(&price_struct);
- }
-}
-```
-
-One can consume the price by calling `pyth::get_price` abovementioned or other utility functions on the `PriceInfoObject` in the Move module
-
-The code snippet below provides an example of how to update the Pyth price feeds:
-
-```ts copy
-import { IotaPriceServiceConnection, IotaPythClient } from "@pythnetwork/pyth-iota-js";
-import { Transaction } from "@iota/iota-sdk/transactions";
-
-// Get the Stable Hermes service URL from https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
-const connection = new IotaPriceServiceConnection("https://hermes-beta.pyth.network");
-
-const priceIDs = [
- // You can find the IDs of prices at https://pyth.network/developers/price-feed-ids
- "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
- "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
-];
-
-const priceUpdateData = await connection.getPriceFeedsUpdateData(priceIDs);
-
-// It is either injected from the browser (https://www.npmjs.com/package/@iota/dapp-kit)
-// or instantiated in the backend via some private key (https://www.npmjs.com/package/@iota/iota-sdk)
-const wallet: SignerWithProvider = getWallet();
-// Get the state IDs of the Pyth and Wormhole contracts from
-// https://docs.pyth.network/price-feeds/contract-addresses/iota
-const wormholeStateId = "0x8bc490f69520a97ca1b3de864c96aa2265a0cf5d90f5f3f016b2eddf0cf2af2b";
-const pythStateId = "0x68dda579251917b3db28e35c4df495c6e664ccc085ede867a9b773c8ebedc2c1";
-
-const client = new IotaPythClient(wallet.provider, pythStateId, wormholeStateId);
-const tx = new Transaction();
-const priceInfoObjectIds = await client.updatePriceFeeds(tx, priceFeedUpdateData, priceIDs);
-
-tx.moveCall({
- target: `pyth_example::main::use_pyth_price`,
- arguments: [
- ..., // other arguments needed for your contract
- tx.object(priceInfoObjectIds[0]),
- ],
-});
-
-const txBlock = {
- transaction: tx,
- wallet,
- options: {
- showEffects: true,
- showEvents: true,
- },
-};
-
-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`.
-
-
-
-## Additional Resources
-
-You may find these additional resources helpful for developing your IOTA application.
-
-### CLI Example
-
-[This example](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/iota/cli) shows how to update prices on a IOTA network. It does the following:
-
-1. Fetches update data from Hermes for the given price feeds.
-1. Call the Pyth IOTA contract with a price update.
-
-You can run this example with `npm run example-relay`. A full command that updates prices on the IOTA testnet looks like this:
-
-```bash
-export IOTA_KEY=YOUR_PRIV_KEY;
-npm run example-relay -- --feed-id "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace" \
---hermes "https://hermes.pyth.network" \
---full-node "https://api.testnet.iota.cafe" \
---pyth-state-id "0x68dda579251917b3db28e35c4df495c6e664ccc085ede867a9b773c8ebedc2c1" \
---wormhole-state-id "0x8bc490f69520a97ca1b3de864c96aa2265a0cf5d90f5f3f016b2eddf0cf2af2b"
-```
-
-### Contract Addresses
-
-Consult [IOTA Contract Addresses](../contract-addresses/iota) to find the package IDs.
-
-### Pyth Price Feed IDs
-
-Consult [Pyth Price Feed IDs](https://pyth.network/developers/price-feed-ids) to find Pyth price feed IDs for various assets.
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/near.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/near.mdx
deleted file mode 100644
index 369b254789..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/near.mdx
+++ /dev/null
@@ -1,347 +0,0 @@
----
-title: "Pyth on NEAR: Integrating Price Feeds & Real-Time Data"
-description: >-
- Integrate Pyth price feeds on NEAR with our step-by-step guide. Learn to use
- the Pyth API, fetch off-chain data, and update on-chain seamlessly.
-full: false
-index: false
----
-
-# Pyth on NEAR
-
-Pyth price feeds on NEAR are managed through the main NEAR Pyth smart
-contract, enabling seamless interaction with on-chain data. In NEAR,
-these interactions are facilitated by specific functions within the
-Pyth receiver contract. This contract acts as an interface to Pyth
-price feeds, handling the retrieval and updating of price data.
-
-The two Key functions in the Pyth receiver contract to get started
-are as follows:
-
-1. [`update_price_feeds`](#update_price_feeds)
- _(updates Pyth smart contract with the price feed you provide)_
-
- - args: `data`
- - type: `object`
- - example: `{ "data": "504e41...' }`
-
-2. [`get_price`](#get_price) (fetches the most recent price stored in the contract)\_
- - args: `price_identifier`
- - type: `object`
- - example: `{ price_identifier: 'f9c0172ba10dfa8...' }`
-
-These functions are core for interacting with Pyth price feeds in
-NEAR-based applications, providing a reliable and up-to-date source of
-price information.
-
-For a full overview of methods provided by the NEAR
-contract, see [the interface](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/near/receiver/src/ext.rs)] exposed by the receiver contract.
-
-## Getting Started
-
-To get started with Pyth oracle you will need to gather the following information which differ between networks:
-
-- Price ID(s)
-- HermesAPI Endpoint
-- Smart contract address
-
-| Network | Price Feed IDs | Hermes API Address | Contract Address |
-| --------- | ------------------------------------------------------------------------------------------------ | -------------------------- | -------------------------------------------------------------------------------- |
-| `testnet` | [NEAR `testnet` Price Feed IDs](https://www.pyth.network/developers/price-feed-ids#near-testnet) | `hermes-beta.pyth.network` | [pyth-oracle.testnet](https://testnet.nearblocks.io/address/pyth-oracle.testnet) |
-| `mainnet` | [NEAR `mainnet` Price Feed IDs](https://www.pyth.network/developers/price-feed-ids#near-mainnet) | `hermes.pyth.network` | [pyth-oracle.near](https://nearblocks.io/address/pyth-oracle.near) |
-
-Note: When using Price Feed IDs, you will need to remove the `0x` prefix.
-
----
-
-### `update_price_feeds`
-
-> Updates the Pyth Oracle contract data with the price feed you provide.
-
-- args: `data` _(off-chain hex-encoded price feed)_
-- type: `object`
-- example: `{ "data": "504e41...' }`
-
-Update the Pyth Oracle contract with new price feed data in two main steps:
-
-1. [Fetch off-chain price feed](#1-fetch-off-chain-price-feed)
-2. [Update Pyth Oracle contract with off-chain price feed](#2-update-pyth-oracle-contract-price-feed)
-
-#### 1) Fetch off-chain price feed
-
-You can obtain an off-chain price feed using Pyth's [Hermes API](https://hermes-beta.pyth.network/docs/).
-
-To use these endpoints, you will need to provide a Price Feed ID and ensure you are targeting the correct network. See [Getting Started](#getting-started) for more information.
-
-Here is a node.js example of fetching the latest price feed using `/v2/updates/price/latest` endpoint:
-
-`Example:`
-
-```js
-const axios = require("axios");
-
-// There are separate endpoints for testnet and mainnet
-const HERMES_TESTNET_URL = "https://hermes-beta.pyth.network";
-const HERMES_MAINNET_URL = "https://hermes.pyth.network";
-
-async function getHermesPriceData(priceId, network) {
- try {
- let url;
- network === "testnet"
- ? (url = HERMES_TESTNET_URL)
- : (url = HERMES_MAINNET_URL);
-
- // Fetch the price data from the Hermes API
- const response = await axios.get(
- `${url}/v2/updates/price/latest?ids[]=${priceId}`,
- );
-
- return response.data.binary.data[0];
- } catch (error) {
- console.error(
- "Error:",
- error.response ? error.response.data : error.message,
- );
- }
-}
-
-module.exports = { getHermesPriceData };
-```
-
-
- z [See full example on
- GitHub](https://github.com/near-examples/near-js/blob/main/node-js/utils/fetch-hermes-price-data.js)
-
-
----
-
-### 2) Update Pyth Oracle Contract Price Feed
-
-After [fetching an off-chain price feed](#1-fetch-off-chain-price-feed), you can now perform a contract call to the Pyth Oracle contract to update.
-Call `update_price_feeds` on the Pyth Oracle contract deployed on NEAR with `data` as your arguments.
-
-`example args:`
-
-```json
-{
- "data": "504e41550100000000a00100000000010070b0ee3a00d1a3c07ee440887eb34a5a35860e6f4b9230fd62f0593fe35c8a3561735a6a37d269c5f166b84ead8918f710dc1be2ee6b51db5b22340ea2c173fc01673d544b00000000001ae101faedac5851e32b9b23b5f9411a8c2bac4aae3ed4dd7b811dd1a72ea4aa7100000000061bc18c014155575600000000000ab0f04600002710f41bc8c224ed983c68dbf5dab7dd34c9129fecfa03005500ca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a600000047e2eb4ef0000000000692480ffffffff800000000673d544b00000000673d544b00000048200e66a00000000005e495a60bb9370c458dd50558b34699b5b179f45e56be22f0a1a0feb1db8469adc8c5efeb53988495bac07bf9efed07f5eee43818150c55055882f6872a228e8e9bc78459ed3ea7fe0b86f3048f6bf0aad34befc46063ab7d200beb8bc9fe5839844d2233546f0742bb665f1e610370fcf8ce5be83d0f47e584b685af87cf3ebcb79e714827dcb99dba579e1a03785052ab3c7c7147d3f7bba822b04dbda159670e9a8d29e7ccf68474b2ca85e00224d29bf65b06b09f95e91703313e053b697b48ac1e4d1c57605a71ab77e7ef276bfe8a369c268333b9a37461bf2b7cb7fd4c005500ecf553770d9b10965f8fb64771e93f5690a182edc32be4a3236e0caaa6e0581a0000000e2ba8cd280000000001b40517fffffff800000000673d544b00000000673d544b0000000e3ea44c6800000000016aee120b47b853f55949284cb8ba0b63824ff9b48cd1da8417f45421b79ee3195fc8d107540a0bbb95c2445b66065754f135cb842db09a7e7ab33f79c546a48db872bd7197b04e3d7b52fbb55b3b9f51707c5a55fac3707cb563dbcde4aadeecc3649c237454cecf519dc567c0da03d81808523aa4fa71815eab25ce7da61b48647bac645d403208135002aab5fde2d7ab3c7c7147d3f7bba822b04dbda159670e9a8d29e7ccf68474b2ca85e00224d29bf65b06b09f95e91703313e053b697b48ac1e4d1c57605a71ab77e7ef276bfe8a369c268333b9a37461bf2b7cb7fd4c"
-}
-```
-
-To perform this contract call you must first create a NEAR account which can be done using `near-cli`.
-
-Fist, install `near-cli`:
-
-```bash
-
-npm install -g near-cli-rs@latest
-
-```
-
-This CLI allows you to simply run `near` and let the prompts guide you through the process.
-
-To quickly create a NEAR account, run the following command (replacing `your-new-account.testnet` with your desired account name):
-
-```bash
-near account \
-create-account sponsor-by-faucet-service \
-your-new-account.testnet \
-autogenerate-new-keypair save-to-legacy-keychain \
-network-config testnet \
-create
-```
-
-To perform a contract call to the Pyth Oracle contract, run the following command:
-
-Replace:
-
-- `your-account.testnet` with your account name
-- `'{"data": "504e41550100..."}'` with your off-chain price feed
-
-```
-near contract \
- call-function \
- as-transaction pyth-oracle.testnet update_price_feeds \
- json-args '{"data": "504e41550100..."}' \
- prepaid-gas '300.0 Tgas' \
- attached-deposit '0.01 NEAR' \
- sign-as your-account.testnet \
- network-config testnet \
- sign-with-legacy-keychain \
- send
-```
-
-**Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/integrations/pyth/real-time-price-data/update-price-feed.json)**
-
-Alternatively, you can use `near-js` libraries to perform the contract call. For this example we will create a simple node.js project.
-
-First, install the `near-js` libraries we will use:
-
-```bash
-npm install @near-js/client @near-js/keystores-node
-```
-
-To setup a NEAR connection, we'll create a `connect.js` file that will initialize an RPC provider and signer. This will look for your NEAR credentials in your `.near-credentials` directory.
-
-```js
-// node.js imports
-const { join } = require("node:path");
-const { homedir } = require("node:os");
-
-// near-js imports
-const {
- getTestnetRpcProvider,
- getSignerFromKeystore,
-} = require("@near-js/client");
-const { UnencryptedFileSystemKeyStore } = require("@near-js/keystores-node");
-
-// initialize RPC provider and signer
-const nearConnect = (sender, network) => ({
- rpcProvider: getTestnetRpcProvider(),
- signer: getSignerFromKeystore(
- sender,
- network,
- new UnencryptedFileSystemKeyStore(join(homedir(), ".near-credentials")),
- ),
-});
-
-module.exports = { nearConnect };
-```
-
-Next we can create a `update-oracle.js` file that will perform the contract call to update the Pyth Oracle contract's price feed.
-
-```js
-// near-js imports
-// https://www.npmjs.com/package/@near-js/client
-const { nearConnect } = require("../utils/connect");
-const { functionCall } = require("@near-js/client");
-
-const sender = "your-account.testnet";
-const receiver = "pyth-oracle.testnet";
-const network = "testnet";
-
-const PRICE_IDS = [
- // Price ids can be found at https://www.pyth.network/developers/price-feed-ids#near-testnet
- // NOTE: Ensure you are using NEAR specific price ids & remove the '0x' prefix before using them
- "f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b", // BTC/USD price id
- "ca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6", // ETH/USD price id
-];
-
-async function updatePythContractPriceFeeds(network) {
- // Connect to the NEAR network
- const { rpcProvider, signer } = nearConnect(sender, network);
-
- // Update the Pyth Oracle contract with the price data
- // Performs a NEAR function call to the Pyth Oracle contract
- // Deposit for transaction fee (balance will be refunded)
- const result = await functionCall({
- sender,
- receiver,
- method: "update_price_feeds",
- args: { data: "504e4155010..." },
- deposit: 10000000000000000000000,
- deps: { rpcProvider, signer },
- });
-
- console.log(
- `Transaction 👉 https://testnet.nearblocks.io/txns/${result.outcome.transaction.hash}`,
- );
- return result;
-}
-
-updatePythOracle();
-```
-
-
- [See full example on
- GitHub](https://github.com/near-examples/near-js/blob/main/node-js/oracle-example/pyth-oracle-update.js)
-
-
-Although unused deposit will be refunded, you can calculate an estimate by calling the `get_update_fee_estimate` method against the Pyth contract.
-
----
-
-### `get_price`
-
-> Fetches the most recent price feed stored in the Pyth Oracle contract. Is a view method, so does not require a signature or payment.
-
-- args: `price_identifier` _(unique [price feed identifier](#environment-variables))_
-- type: `object`
-- example: `{ price_identifier: 'f9c0172ba10dfa8...' }`
-
-After [updating the price feed](#update_price_feeds), you can view the feed on-chain by calling `get_price` on the Pyth Oracle contract. Note that this is a view method and does not require a signature or deposit.
-
-#### NEAR CLI example
-
-```bash
-near contract \
- call-function \
- as-read-only pyth-oracle.testnet get_price \
- json-args '{"price_identifier": "f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b"}' \
- network-config testnet \
- now
-
-```
-
-**Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/integrations/pyth/real-time-price-data/get-price.json)**
-
-#### NEAR-JS Example
-
-For this example we will create a simple node.js project. First, install the [`near-js\client`](https://www.npmjs.com/package/@near-js/client) library:
-
-```bash
-npm install @near-js/client
-```
-
-Create a `get-price.js` file that will perform the view call from the Pyth Oracle contract. Note that this does not require a signature or deposit.
-
-```js
-// near-js import
-// https://www.npmjs.com/package/@near-js/client
-const { getTestnetRpcProvider, view } = require("@near-js/client");
-
-const PRICE_IDS = [
- // Price ids can be found at https://www.pyth.network/developers/price-feed-ids#near-testnet
- // NOTE: Ensure you are using NEAR specific price ids & remove the '0x' prefix before using them
- "f9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b", // BTC/USD price id
- "ca80ba6dc32e08d06f1aa886011eed1d77c77be9eb761cc10d72b7d0a2fd57a6", // ETH/USD price id
-];
-
-async function getPrice(price_ID, symbol) {
- try {
- const rpcProvider = getTestnetRpcProvider();
- const result = await view({
- account: "pyth-oracle.testnet",
- method: "get_price",
- args: { price_identifier: price_ID },
- deps: { rpcProvider },
- });
- console.log(symbol, result);
- } catch (error) {
- console.error(`Error fetching ${symbol} price:`, error.message);
- }
-}
-
-getPrice(PRICE_IDS[0], "BTC/USD:");
-```
-
-
- [See full example on
- GitHub](https://github.com/near-examples/near-js/blob/main/node-js/oracle-example/pyth-oracle-view.js)
-
-
----
-
-## On-Chain Prices
-
-For on-chain price interactions, see the [example contract][] in the
-Pyth Github repo for an example of how to update and use prices
-within a NEAR contract.
-
-[example contract]: https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/near/example
-
-A CLI-based approach can also be taken for interacting with Pyth prices,
-see the [update.sh][] example script in the repository to see how to
-pull prices with the official NEAR cli.
-
-[update.sh]: https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/near/scripts/update.sh
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/off-chain.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/off-chain.mdx
deleted file mode 100644
index cba7d33b07..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/off-chain.mdx
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: Real-Time Price Updates in Off-Chain Apps with Hermes-Client
-description: >-
- Harness hermes-client to retrieve real-time prices and subscribe to live
- updates in your off-chain applications. (Note: price-service-sdk is
- deprecated.)
-full: false
-index: false
----
-
-# How to Use Real-Time Data in Off-Chain Applications
-
-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.
-
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/solana.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/solana.mdx
deleted file mode 100644
index 4b6e15fc27..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/solana.mdx
+++ /dev/null
@@ -1,384 +0,0 @@
----
-title: Using Pyth Network for Real-Time Data in Solana & SVM Programs
-description: >-
- Fetch real-time Pyth price feeds in Solana programs: configure the SDK, read
- on-chain data, integrate with your frontend, and use TWAP for reliable
- pricing.
-full: false
-index: false
----
-
-# How to Use Real-Time Data in Solana Programs
-
-This guide explains how to use real-time Pyth data in Solana applications.
-
-## Install Pyth SDKs
-
-Pyth provides two SDKs for Solana applications to cover the on- and off-chain portions of the integration:
-
-### Rust SDK
-
-The [pyth-solana-receiver-sdk](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/solana/pyth_solana_receiver_sdk) crate can be used to consume Pyth prices inside Solana programs written in Rust.
-Add this crate to the dependencies section of your `Cargo.toml` file:
-
-```toml copy
-[dependencies]
-pyth-solana-receiver-sdk ="x.y.z" # get the latest version from https://crates.io/crates/pyth-solana-receiver-sdk
-```
-
-
-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.
-Add these packages to your off-chain dependencies:
-
-```bash copy
-npm install --save @pythnetwork/hermes-client @pythnetwork/pyth-solana-receiver
-```
-
-## Write Contract Code
-
-Add the following code to your Solana program to read Pyth prices.
-Pyth prices are posted to price update accounts that can be passed to any instruction that needs price data.
-For developers using Anchor, simply add an `Account<'info, PriceUpdateV2>` field to the `Context` struct:
-
-```rust {9} copy
-use pyth_solana_receiver_sdk::price_update::{PriceUpdateV2};
-
-#[derive(Accounts)]
-#[instruction()]
-pub struct Sample<'info> {
- #[account(mut)]
- pub payer: Signer<'info>,
- // Add this account to any instruction Context that needs price data.
- pub price_update: Account<'info, PriceUpdateV2>,
-}
-```
-
-
-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
-pub fn sample(ctx: Context) -> Result<()> {
- let price_update = &mut ctx.accounts.price_update;
- // get_price_no_older_than will fail if the price update is more than 30 seconds old
- let maximum_age: u64 = 30;
- // get_price_no_older_than will fail if the price update is for a different price feed.
- // This string is the id of the BTC/USD feed. See https://pyth.network/developers/price-feed-ids for all available IDs.
- let feed_id: [u8; 32] = get_feed_id_from_hex("0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43")?;
- let price = price_update.get_price_no_older_than(&Clock::get()?, maximum_age, &feed_id)?;
- // Sample output:
- // The price is (7160106530699 ± 5129162301) * 10^-8
- msg!("The price is ({} ± {}) * 10^{}", price.price, price.conf, price.exponent);
-
- Ok(())
-}
-```
-
-
-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.
-
-
- If you choose the price feed account integration (see below), you can use an
- account address check to validate the price feed ID.
-
-
-
-
-## Write Frontend Code
-
-There are two different paths to the frontend integration of Pyth prices on Solana.
-Developers can choose to use two different types of accounts:
-
-- **Price feed accounts** hold a sequence of prices for a specific price feed ID that always moves forward in time.
- These accounts have a fixed address that your program can depend on.
- The Pyth Data Association maintains a set of price feed accounts that are continuously updated.
- Such accounts are a good fit for applications that always want to consume the most recent price.
-- **Price update accounts** are ephemeral accounts that anyone can create, overwrite, and close.
- These accounts are a good fit for applications that want to consume prices for a specific timestamp.
-
-Both price feed accounts and price update accounts work identically from the perspective of the on-chain program.
-However, the frontend integration differs slightly between the two.
-Both options are explained in the sections below, and developers should pick the one that is best suited for their use case.
-
-### Price Feed Accounts
-
-For developers using price feed accounts, the frontend code needs to pass the relevant price feed **account address** to the transaction.
-Price feed accounts are program-derived addresses and thus the account ID for any price feed can be derived automatically.
-The `PythSolanaReceiver` class provides a method for deriving this information:
-
-```typescript copy
-import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
-
-// You will need a Connection from @solana/web3.js and a Wallet from @coral-xyz/anchor to create
-// the receiver.
-const connection: Connection;
-const wallet: Wallet;
-const pythSolanaReceiver = new PythSolanaReceiver({ connection, wallet });
-
-// There are up to 2^16 different accounts for any given price feed id.
-// The 0 value below is the shard id that indicates which of these accounts you would like to use.
-// However, you may choose to use a different shard to prevent Solana congestion on another app from affecting your app.
-const solUsdPriceFeedAccount = pythSolanaReceiver
- .getPriceFeedAccountAddress(0, SOL_PRICE_FEED_ID)
- .toBase58();
-```
-
-
-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.
-
-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.
-
-
-### Price Update Accounts
-
-To use price update accounts, the frontend code needs to perform two different tasks:
-
-1. Fetch price updates from Hermes
-2. Post the price updates to Solana and invoke your application logic
-
-#### Fetch price updates
-
-Use `PriceServiceConnection` from `@pythnetwork/hermes-client` to fetch Pyth price updates from Hermes:
-
-```typescript copy
-import { HermesClient } from "@pythnetwork/hermes-client";
-
-// The URL below is a public Hermes instance operated by the Pyth Data Association.
-// Hermes is also available from several third-party providers listed here:
-// https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
-const priceServiceConnection = new HermesClient(
- "https://hermes.pyth.network/",
- {},
-);
-
-// Hermes provides other methods for retrieving price updates. See
-// https://hermes.pyth.network/docs for more information.
-const priceUpdateData = (
- await priceServiceConnection.getLatestPriceUpdates(
- ["0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43"],
- { encoding: "base64" },
- )
-).binary.data;
-
-// Price updates are strings of base64-encoded binary data. Example:
-// ["UE5BVQEAAAADuAEAAAADDQJoIZzihVp30/71MXDexqiJDjGpEUEcHj/D06pRiYTPPlRPZKKiVFaZdqiGZ7vvGBj1kK69fKRncCKHXlGyS0LcAQPREzVlm7AcY+X0/hCupv8M5KMhEgOCxq5LxCCKQjL/xwm4jTCJrwkHn/PBaoirnlbHMjxAlwJaFF4RGeE1KRDeAASQIFjfbbobiq2OcSRnK3Ny1NY2Zd012ahIhoWpqxbv4UqDZXLh+bPm4Q14SfO/llRTOmqG6O4v+nfjZa7WNjgxAAZFANqAEooKvijK+476YBITKono+vJ4bSQHUiXOaiGs/zcI6WYGRM0xc6ov2mfCaTuH7mx3ElaLyPGvRX4D9DyHAAf+dPg+NEepwMJI1qPLRcTy0xoz2Yq0k2MuL87gCBsYVlS31atGsQcrXfHr4xcTKKyEUh1tIaOfRbPdX1cvs4D6AAj2/vuKpAgYWhd2gtqHsQLV1vMgq8SKH8wiOmhaMZ06GAQSM1pYLpHZRhYaUQbrUJAeqEeX+qMMqQFMPSSUnEKNAAmCE98NUYbHuEoxJGMDybTGCyDEXCmaNM0q6GT0qrbSmT6NF50yz9CE30WWHNOZzFtK2rCyBYFH2aAp6lQ1JKfmAQpW/wUaOhSdwGiEPWvpY3FWL077i0c4auXQjSQNaDD0cBnmvJTS5R3KxK5aunuUvVAT1mHTnpKHIzNKyu7ICM2zAQvrIFfWRFjVE0zRCvoAcvMpmpS7atWu8VgvklpZh9Qt9xYSO2Yq/asgNsMSQaowXiU0MfjggS+UJ8yWaOpUg18vAAxAMuUlOjNzFj6oPES850YNu2k7PM7AGL8Gb/8+HshkfjG0GsNR8H8/vB8v/iEcaScxQFXwtLT0OSgjWMa0ByknAA7PScKUEP8N7iJKYv6lmEs26DZnxzdpGVZRGqbbC0mxyjY0HqsT0rv2wNvy3MbAtABDMsLumII00cRCKBsZXGlKARCC0NzsKnduLsgGfqxYL4yuf910DKrRp5j+fKLmF2QiB2yVT90ja0782/u6BZZUGRMoA/AWl1qvswBtnlSkHcWEABIp74UFLiiA+MBBvBzhLBxSTKXldiLJ75+U/eqK/ej6qT+I+6S1pzT/ntXdpD25jmQhjtsYEqs/rmgs5U2p4AVRAGYULPcAAAAAABrhAfrtrFhR4yubI7X5QRqMK6xKrj7U3XuBHdGnLqSqcQAAAAAC8IR2AUFVV1YAAAAAAAf6dUkAACcQMZv+5jfvAe6sflX1cL7xu9WWQ9UBAFUA5i32yLSoX+GmfbRNwS3l2zMPesZrctxliv7fD0pBW0MAAAaBiqrXwAAAAADYu55y////+AAAAABmFCz3AAAAAGYULPYAAAaFH6MbAAAAAADcBIdMCre0t06ngCnw+N4IkFpZVqOz9YuwKL+UFdt13ZBtay0YZnkw7QGoaTDCLlsNK1tk1F/qgMyOcYozjOTj41XriIpEPeG2HPYl+u0CKolGlCsz1IDu4w2lyh6LWVaMkEybGz7ih4H2RqCj6BVu182ZqsZgJx9ghzKImAo4cIlWzRTwpm4daAqHa4JEyimFDpFt6UeqvS5TNu2F8W+X+edeiph20EulTI7sx38jwhq5Yc0Mf2ElvFgToGQ806Vs2HynuLwh9OIuTTZh"]
-console.log(priceUpdateData);
-```
-
-Consult [Fetch Price Updates](/price-feeds/fetch-price-updates) for more information on fetching price updates from Hermes.
-
-#### Post price updates
-
-Finally, post the price update to the Pyth program on Solana.
-This step will create the price update account that your application reads from.
-Applications typically combine posting the price update and invoking their application into a sequence of transactions.
-The `PythSolanaReceiver` class in `@pythnetwork/pyth-solana-receiver` provides a convenient transaction builder to help with this process:
-
-```typescript copy
-import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
-
-// You will need a Connection from @solana/web3.js and a Wallet from @coral-xyz/anchor to create
-// the receiver.
-const connection: Connection;
-const wallet: Wallet;
-const pythSolanaReceiver = new PythSolanaReceiver({ connection, wallet });
-
-// Set closeUpdateAccounts: true if you want to delete the price update account at
-// the end of the transaction to reclaim rent.
-const transactionBuilder = pythSolanaReceiver.newTransactionBuilder({
- closeUpdateAccounts: false,
-});
-await transactionBuilder.addPostPriceUpdates(priceUpdateData);
-
-// Use this function to add your application-specific instructions to the builder
-await transactionBuilder.addPriceConsumerInstructions(
- async (
- getPriceUpdateAccount: (priceFeedId: string) => PublicKey,
- ): Promise => {
- // Generate instructions here that use the price updates posted above.
- // getPriceUpdateAccount() will give you the account for each price update.
- return [];
- },
-);
-
-// Send the instructions in the builder in 1 or more transactions.
-// The builder will pack the instructions into transactions automatically.
-await pythSolanaReceiver.provider.sendAll(
- await transactionBuilder.buildVersionedTransactions({
- computeUnitPriceMicroLamports: 50000,
- }),
- { skipPreflight: true },
-);
-```
-
-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.
-
-
-
-## Time-Weighted Average Price (TWAP)
-
-Pyth also provides Time-Weighted Average Price (TWAP) for Solana applications. TWAP represents the average price over a specified time window, which can be useful for reducing the impact of short-term price volatility. The TWAP window is currently limited to a maximum of 10 minutes (600 seconds).
-
-### Using TWAP in Solana Programs
-
-To use TWAP in your Solana program, import the `TwapUpdate` struct from the Pyth Solana receiver SDK. The process for fetching and posting TWAP updates is similar to regular price updates from Hermes.
-
-```rust copy
-use pyth_solana_receiver_sdk::price_update::{TwapUpdate};
-
-#[derive(Accounts)]
-#[instruction(twap_window_seconds: u64)]
-pub struct SampleWithTwap<'info> {
- #[account(mut)]
- pub payer: Signer<'info>,
- // Add this account to any instruction Context that needs TWAP data
- pub twap_update: Account<'info, TwapUpdate>,
-}
-```
-
-Update your instruction logic to read the TWAP from the update account:
-
-```rust copy
-pub fn sample_with_twap(
- ctx: Context,
- twap_window_seconds: u64,
-) -> Result<()> {
- let twap_update = &mut ctx.accounts.twap_update;
- // get_twap_no_older_than will fail if the price update is more than 30 seconds old
- let maximum_age: u64 = 30;
- // Specify the price feed ID and the window in seconds for the TWAP
- let feed_id: [u8; 32] = get_feed_id_from_hex("0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43")?;
- let price = twap_update.get_twap_no_older_than(
- &Clock::get()?,
- maximum_age,
- twap_window_seconds,
- &feed_id,
- )?;
-
- // Sample output:
- // The TWAP price is (7160106530699 ± 5129162301) * 10^-8
- msg!("The TWAP price is ({} ± {}) * 10^{}", price.price, price.conf, price.exponent);
-
- Ok(())
-}
-```
-
-### Fetching and Posting TWAP Updates
-
-To use TWAP updates in your application, you need to fetch them from Hermes and post them to Solana:
-
-#### Fetch TWAP updates from Hermes
-
-Use `HermesClient` from `@pythnetwork/hermes-client` to fetch TWAP updates:
-
-```typescript copy
-import { HermesClient } from "@pythnetwork/hermes-client";
-
-// The URL below is a public Hermes instance operated by the Pyth Data Association.
-// Hermes is also available from several third-party providers listed here:
-// https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
-const hermesClient = new HermesClient("https://hermes.pyth.network/", {});
-
-// Specify the price feed ID and the TWAP window in seconds (maximum 600 seconds)
-const twapWindowSeconds = 300; // 5 minutes
-const twapUpdateData = await hermesClient.getLatestTwaps(
- ["0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43"], // BTC/USD feed ID
- twapWindowSeconds,
- { encoding: "base64" },
-);
-
-// TWAP updates are strings of base64-encoded binary data
-console.log(twapUpdateData.binary.data);
-```
-
-For a complete example of fetching TWAP updates from Hermes, see the [HermesClient example script](https://github.com/pyth-network/pyth-crosschain/blob/main/apps/hermes/client/js/src/examples/HermesClient.ts) in the Pyth crosschain repository.
-
-#### Post TWAP updates to Solana
-
-Use `PythSolanaReceiver` to post the TWAP updates and consume them in your application:
-
-```typescript copy
-import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
-
-// You will need a Connection from @solana/web3.js and a Wallet from @coral-xyz/anchor
-const connection: Connection;
-const wallet: Wallet;
-const pythSolanaReceiver = new PythSolanaReceiver({ connection, wallet });
-
-// Create a transaction builder
-const transactionBuilder = pythSolanaReceiver.newTransactionBuilder({
- closeUpdateAccounts: false,
-});
-
-// Add the TWAP update to the transaction
-await transactionBuilder.addPostTwapUpdates(twapUpdateData.binary.data);
-
-// Add your application's instructions that use the TWAP update
-await transactionBuilder.addTwapConsumerInstructions(
- async (
- getTwapUpdateAccount: (priceFeedId: string) => PublicKey,
- ): Promise => {
- // Generate instructions here that use the TWAP updates posted above
- // getTwapUpdateAccount() will give you the account for each TWAP update
- return []; // Replace with your actual instructions
- },
-);
-
-// Send the instructions
-await pythSolanaReceiver.provider.sendAll(
- await transactionBuilder.buildVersionedTransactions({
- computeUnitPriceMicroLamports: 50000,
- }),
- { skipPreflight: true },
-);
-```
-
-For a complete example of posting TWAP updates to Solana, see the [post_twap_update.ts example script](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/solana/sdk/js/pyth_solana_receiver/examples/post_twap_update.ts) in the Pyth crosschain repository.
-
-## Additional Resources
-
-You may find these additional resources helpful for developing your Solana application.
-
-### Example Application
-
-See an end-to-end example of using Pyth Network prices in the [SendUSD Solana Demo App](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/solana/send_usd). The app allows users to send a USD-denominated amount of SOL using either spot prices or TWAP prices.
-It demonstrates how to fetch price data from Hermes from a frontend, post it to the Solana blockchain, and consume it from a smart contract.
-
-The example includes:
-
-- A React frontend for interacting with the contract
-- Solana programs that consumes spot price updates (Price Update Accounts) and time-averaged price updates (TWAP Accounts)
-- Complete transaction building for posting and consuming price data
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/starknet.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/starknet.mdx
deleted file mode 100644
index 944f1f364d..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/starknet.mdx
+++ /dev/null
@@ -1,182 +0,0 @@
----
-title: Using Real-Time Pyth Data in Starknet Contracts
-description: >-
- The SDK offers code examples for integrating live Pyth price feeds into
- Starknet smart contracts, enabling automated real-time on-chain data updates.
-full: false
-index: false
----
-
-# How to Use Real-Time Data in Starknet Contracts
-
-This guide explains how to use real-time Pyth data in Starknet contracts.
-
-## Install the Pyth SDK
-
-Use the following dependency in your `Scarb.toml` file to use the latest Pyth Starknet package:
-
-```toml copy
-[dependencies]
-pyth = { git = "https://github.com/pyth-network/pyth-crosschain.git", tag = "pyth-starknet-contract-v0.1.0"}
-```
-
-Pyth also provides a javascript SDK to interact with the Pyth contract on Starknet. You can install it using the following command:
-
-
- ```sh copy npm install --save @pythnetwork/pyth-starknet-js ```
- ```sh copy yarn add @pythnetwork/pyth-starknet-js ```
-
-
-## Write Contract Code
-
-The code snippet below provides an example module fetching the STRK/USD price from Pyth price feeds:
-
-```cairo {2,17,47,55,64,71-73} copy
-use starknet::ContractAddress;
-use pyth::ByteBuffer;
-
-#[starknet::interface]
-pub trait IExampleContract {
- // pyth_price_update is the price update data from Pyth to update the price feeds.
- // It should be passed as a ByteBuffer.
- fn example_method(
- ref self: T, pyth_price_update: ByteBuffer
- );
-}
-
-#[starknet::contract]
-mod example_contract {
- use core::panic_with_felt252;
- use starknet::{ContractAddress, get_caller_address, get_contract_address};
- use pyth::{ByteBuffer, IPythDispatcher, IPythDispatcherTrait, UnwrapWithFelt252};
- use openzeppelin::token::erc20::interface::{IERC20CamelDispatcherTrait, IERC20CamelDispatcher};
-
- const MAX_PRICE_AGE: u64 = 3600; // 1 hour
- // Storage to store the Pyth contract address, the ERC20 contract address representing ETH, and the ETH/USD price feed ID.
- #[storage]
- struct Storage {
- pyth_address: ContractAddress,
- strk_erc20_address: ContractAddress,
- }
-
- // Constructor to initialize the contract storage.
- // * @param pyth_address: The address of the Pyth contract on Starknet.
- // * @param strk_erc20_address: The address of the ERC20 contract representing STRK on Starknet.
- #[constructor]
- fn constructor(
- ref self: ContractState,
- pyth_address: ContractAddress,
- strk_erc20_address: ContractAddress,
- ) {
- self.pyth_address.write(pyth_address);
- self.strk_erc20_address.write(strk_erc20_address);
- }
-
- #[abi(embed_v0)]
- impl ExampleContract of super::IExampleContract {
- fn example_method(
- ref self: ContractState,
- pyth_price_update: ByteBuffer
- ) {
- let pyth = IPythDispatcher { contract_address: self.pyth_address.read() };
- let strk_erc20 = IERC20CamelDispatcher {
- contract_address: self.strk_erc20_address.read()
- };
- let caller = get_caller_address();
- let contract = get_contract_address();
-
- // Get the fee required to update the Pyth price feeds.
- let pyth_fee = pyth.get_update_fee(pyth_price_update.clone(), strk_erc20.contract_address);
- if !strk_erc20.transferFrom(caller, contract, pyth_fee) {
- panic_with_felt252('insufficient allowance for fee');
- }
- if !strk_erc20.approve(pyth.contract_address, pyth_fee) {
- panic_with_felt252('approve failed');
- }
-
- // Submit a pyth_price_update to the Pyth contract to update the on-chain price.
- pyth.update_price_feeds(pyth_price_update);
-
- // Read the current price from a price feed.
- // STRK/USD price feed ID
- // The complete list of feed IDs is available at https://pyth.network/developers/price-feed-ids
- let strk_usd_price_id =
- 0x6a182399ff70ccf3e06024898942028204125a819e519a335ffa4579e66cd870;
- let price = pyth
- .get_price_no_older_than(strk_usd_price_id, MAX_PRICE_AGE)
- .unwrap_with_felt252();
- let _: u64 = price.price.try_into().unwrap(); // Price in u64
- }
- }
-}
-```
-
-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](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).
-
-
-
-The code snippet above does the following things:
-
-1. Call `pyth.get_update_fee` to get the fee required to update the Pyth price feeds.
-1. Call `pyth.update_price_feeds` and pass `pyth_price_update` to update the Pyth price feeds.
-1. Call `pyth.get_price_no_older_than` to read the price, providing the [price feed ID](https://pyth.network/developers/price-feed-ids) you wish to read.
-
-### Write Client Code
-
-The code snippet below provides an example of how to fetch price updates and convert to `ByteBuffer` for Starknet using the `pyth-starknet-js` in JavaScript:
-
-```ts {16} copy
-import { PriceServiceConnection } from "@pythnetwork/price-service-client";
-import { ByteBuffer } from "@pythnetwork/pyth-starknet-js";
-// The URL below is a public Hermes instance operated by the Pyth Data Association.
-// Hermes is also available from several third-party providers listed here:
-// https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
-const connection = new PriceServiceConnection("https://hermes.pyth.network", {
- priceFeedRequestConfig: {
- binary: true,
- },
-});
-
-const priceId =
- "0x6a182399ff70ccf3e06024898942028204125a819e519a335ffa4579e66cd870"; // STRK/USD
-
-// Get the latest values of the price feeds as json objects.
-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.
-
-
-
-## Additional Resources
-
-You may find these additional resources helpful for developing your Starknet application.
-
-### Interface
-
-The [Starknet Interface](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/starknet/contracts/src/pyth/interface.cairo#L9) provides a list of functions that can be called on the Pyth contract deployed on Starknet.
-
-### Example Applications
-
-- [Send-USD](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/starknet), which updates and consumes STRK/USD price feeds on Starknet to send USD to a recipient.
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/sui.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/sui.mdx
deleted file mode 100644
index 90963450f2..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/sui.mdx
+++ /dev/null
@@ -1,216 +0,0 @@
----
-title: Using Real-Time Pyth Data in Sui Contracts
-description: >-
- Pyth provides SDKs, sample contracts, and tutorials for integrating real-time
- price feeds into Sui applications. You can fetch current price data and update
- on-chain feeds using these tools.
-full: false
-index: false
----
-
-# How to Use Real-Time Data in Sui Contracts
-
-This guide explains how to use real-time Pyth data in Sui applications.
-
-## Install Pyth SDK
-
-Use the following dependency in your `Move.toml` file to use the latest Pyth Sui package and its dependencies:
-
-
-
-```sh copy
-[dependencies.Pyth]
-git = "https://github.com/pyth-network/pyth-crosschain.git"
-subdir = "target_chains/sui/contracts"
-rev = "sui-contract-mainnet"
-
-[dependencies.Wormhole]
-git = "https://github.com/wormhole-foundation/wormhole.git"
-subdir = "sui/wormhole"
-rev = "sui/mainnet"
-
-# Pyth is locked into this specific `rev` because the package depends on Wormhole and is pinned to this version.
-
-[dependencies.Sui]
-git = "https://github.com/MystenLabs/sui.git"
-subdir = "crates/sui-framework/packages/sui-framework"
-rev = "041c5f2bae2fe52079e44b70514333532d69f4e6"
-
-````
-
-
-```sh copy
-[dependencies.Pyth]
-git = "https://github.com/pyth-network/pyth-crosschain.git"
-subdir = "target_chains/sui/contracts"
-rev = "sui-contract-testnet"
-
-[dependencies.Wormhole]
-git = "https://github.com/wormhole-foundation/wormhole.git"
-subdir = "sui/wormhole"
-rev = "sui/testnet"
-
-# Pyth is locked into this specific `rev` because the package depends on Wormhole and is pinned to this version.
-[dependencies.Sui]
-git = "https://github.com/MystenLabs/sui.git"
-subdir = "crates/sui-framework/packages/sui-framework"
-rev = "041c5f2bae2fe52079e44b70514333532d69f4e6"
-````
-
-
-
-
-Pyth also provides a javascript SDK to construct transaction blocks that update price feeds:
-
-
-
- ```sh
- # NPM
- npm install --save @pythnetwork/pyth-sui-js
-
- # Yarn
- yarn add @pythnetwork/pyth-sui-js
- ```
-
-
-
-
-## Write Contract Code
-
-The code snippet below provides a general template for what your contract code should look like:
-
-```rust {18} copy
-module pyth_example::main {
- use sui::clock::Clock;
- use pyth::price_info;
- use pyth::price_identifier;
- use pyth::price;
- use pyth::pyth;
- use pyth::price_info::PriceInfoObject;
-
- const E_INVALID_ID: u64 = 1;
-
- public fun use_pyth_price(
- // Other arguments
- clock: &Clock,
- price_info_object: &PriceInfoObject,
- ){
- let max_age = 60;
- // Make sure the price is not older than max_age seconds
- let price_struct = pyth::get_price_no_older_than(price_info_object,clock, max_age);
-
- // Check the price feed ID
- let price_info = price_info::get_price_info_from_price_info_object(price_info_object);
- let price_id = price_identifier::get_bytes(&price_info::get_price_identifier(&price_info));
-
- // ETH/USD price feed ID
- // The complete list of feed IDs is available at https://pyth.network/developers/price-feed-ids
- // Note: Sui uses the Pyth price feed ID without the `0x` prefix.
- assert!(price_id!=x"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", E_INVALID_ID);
-
- // Extract the price, decimal, and timestamp from the price struct and use them
- let decimal_i64 = price::get_expo(&price_struct);
- let price_i64 = price::get_price(&price_struct);
- let timestamp_sec = price::get_timestamp(&price_struct);
- }
-}
-```
-
-One can consume the price by calling `pyth::get_price` abovementioned or other utility functions on the `PriceInfoObject` in the Move module
-
-The code snippet below provides an example of how to update the Pyth price feeds:
-
-```ts copy
-import { SuiPriceServiceConnection, SuiPythClient } from "@pythnetwork/pyth-sui-js";
-import { TransactionBlock } from "@mysten/sui.js";
-
-// Get the Stable Hermes service URL from https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
-const connection = new SuiPriceServiceConnection("https://hermes-beta.pyth.network");
-
-const priceIDs = [
- // You can find the IDs of prices at https://pyth.network/developers/price-feed-ids
- "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // BTC/USD price ID
- "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", // ETH/USD price ID
-];
-
-const priceUpdateData = await connection.getPriceFeedsUpdateData(priceIDs);
-
-// It is either injected from the browser or instantiated in the backend via some private key
-const wallet: SignerWithProvider = getWallet();
-// Get the state IDs of the Pyth and Wormhole contracts from
-// https://docs.pyth.network/price-feeds/contract-addresses/sui
-const wormholeStateId = "0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a";
-const pythStateId = "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8";
-
-const client = new SuiPythClient(wallet.provider, pythStateId, wormholeStateId);
-const tx = new TransactionBlock();
-const priceInfoObjectIds = await client.updatePriceFeeds(tx, priceFeedUpdateData, priceIDs);
-
-tx.moveCall({
- target: `pyth_example::main::use_pyth_price`,
- arguments: [
- ..., // other arguments needed for your contract
- tx.object(priceInfoObjectIds[0]),
- ],
-});
-
-const txBlock = {
- transactionBlock: tx,
- options: {
- showEffects: true,
- showEvents: true,
- },
-};
-
-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).
-
-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`.
-
-
-## Additional Resources
-
-You may find these additional resources helpful for developing your Sui application.
-
-### CLI Example
-
-[This example](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/sui/cli) shows how to update prices on a Sui network. It does the following:
-
-1. Fetches update data from Hermes for the given price feeds.
-1. Call the Pyth Sui contract with a price update.
-
-You can run this example with `npm run example-relay`. A full command that updates prices on the Sui testnet looks like this:
-
-```bash
-export SUI_KEY=YOUR_PRIV_KEY;
-npm run example-relay -- --feed-id "5a035d5440f5c163069af66062bac6c79377bf88396fa27e6067bfca8096d280" \
---hermes "https://hermes-beta.pyth.network" \
---full-node "https://fullnode.testnet.sui.io:443" \
---pyth-state-id "0xd3e79c2c083b934e78b3bd58a490ec6b092561954da6e7322e1e2b3c8abfddc0" \
---wormhole-state-id "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790"
-```
-
-### Contract Addresses
-
-Consult [Sui Contract Addresses](../contract-addresses/sui) to find the package IDs.
-
-### Pyth Price Feed IDs
-
-Consult [Pyth Price Feed IDs](https://pyth.network/developers/price-feed-ids) to find Pyth price feed IDs for various assets.
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/ton.mdx b/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/ton.mdx
deleted file mode 100644
index 16be590fd7..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v1/use-real-time-data/ton.mdx
+++ /dev/null
@@ -1,148 +0,0 @@
----
-title: "Pyth Network TON Integration: Real-Time Data Usage"
-description: >-
- Easily integrate Pyth Network’s live price feeds into your TON apps. Use our
- SDK, handle smart contract interactions, and automate data updates for
- precise, on-chain pricing.
-full: false
-index: false
----
-
-# How to Use Real-Time Data in TON Contracts
-
-This guide explains how to use real-time Pyth data in TON applications.
-
-## Install the Pyth SDK
-
-Install the Pyth TON SDK and other necessary dependencies using npm:
-
-
-
- {/* prettier-ignore-start */}
-
- ```sh copy
- npm install @pythnetwork/pyth-ton-js @pythnetwork/hermes-client @ton/core @ton/ton @ton/crypto
- ```
-
- {/* prettier-ignore-end */}
-
-
-
- {/* prettier-ignore-start */}
-
- ```sh copy
- yarn add @pythnetwork/pyth-ton-js @pythnetwork/hermes-client @ton/core @ton/ton @ton/crypto
- ```
-
- {/* prettier-ignore-end */}
-
-
-
-
-## Write Contract Code
-
-The code snippet below provides an example sending a message to the Pyth price feed contract and call the `parse_price_feed_updates` method:
-
-```lisp copy
- ;; Create message to Pyth contract according to schema
- cell msg = begin_cell()
- .store_uint(0x18, 6) ;; nobounce
- .store_slice(ctx_pyth_address) ;; pyth contract address
- .store_coins(forward_amount) ;; forward amount minus fees
- .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1) ;; default message headers
- .store_uint(PYTH_OP_PARSE_PRICE_FEED_UPDATES, 32) ;; pyth opcode
- .store_ref(price_update_data) ;; update data
- .store_ref(price_ids) ;; price feed IDs
- .store_uint(now() - 100, 64) ;; min_publish_time
- .store_uint(now() + 100, 64) ;; max_publish_time
- .store_slice(my_address()) ;; target address (this contract)
- .store_ref(custom_payload) ;; custom payload with recipient and amount
- .end_cell();
-
- send_raw_message(msg, 0);
-```
-
-## Write Client Code
-
-The following code snippet demonstrates how to fetch price updates, interact with the Pyth contract on TON, and update price feeds:
-
-```typescript copy
-import { TonClient, Address, WalletContractV4 } from "@ton/ton";
-import { toNano } from "@ton/core";
-import { mnemonicToPrivateKey } from "@ton/crypto";
-import { HermesClient } from "@pythnetwork/hermes-client";
-import {
- PythContract,
- PYTH_CONTRACT_ADDRESS_TESTNET,
- calculateUpdatePriceFeedsFee,
-} from "@pythnetwork/pyth-ton-js";
-const BTC_PRICE_FEED_ID =
- "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43";
-async function main() {
- // Initialize TonClient
- const client = new TonClient({
- endpoint: "https://testnet.toncenter.com/api/v2/jsonRPC",
- apiKey: "your-api-key-here", // Optional
- });
- // Create PythContract instance
- const contractAddress = Address.parse(PYTH_CONTRACT_ADDRESS_TESTNET);
- const contract = client.open(PythContract.createFromAddress(contractAddress));
- // Get current guardian set index
- const guardianSetIndex = await contract.getCurrentGuardianSetIndex();
- console.log("Guardian Set Index:", guardianSetIndex);
- // Get BTC price from TON contract
- const price = await contract.getPriceUnsafe(BTC_PRICE_FEED_ID);
- console.log("BTC Price from TON contract:", price);
- // Fetch latest price updates from Hermes
- const hermesEndpoint = "https://hermes.pyth.network";
- const hermesClient = new HermesClient(hermesEndpoint);
- const priceIds = [BTC_PRICE_FEED_ID];
- const latestPriceUpdates = await hermesClient.getLatestPriceUpdates(
- priceIds,
- { encoding: "hex" },
- );
- console.log("Hermes BTC price:", latestPriceUpdates.parsed?.[0].price);
- // Prepare update data
- const updateData = Buffer.from(latestPriceUpdates.binary.data[0], "hex");
- console.log("Update data:", updateData);
- // Get update fee
- const updateFee = await contract.getUpdateFee(updateData);
- console.log("Update fee:", updateFee);
- const totalFee =
- calculateUpdatePriceFeedsFee(BigInt(updateFee)) + BigInt(updateFee);
- // Update price feeds
- const mnemonic = "your mnemonic here";
- const key = await mnemonicToPrivateKey(mnemonic.split(" "));
- const wallet = WalletContractV4.create({
- publicKey: key.publicKey,
- workchain: 0,
- });
- const provider = client.open(wallet);
- await contract.sendUpdatePriceFeeds(
- provider.sender(key.secretKey),
- updateData,
- totalFee,
- );
- console.log("Price feeds updated successfully.");
-}
-main().catch(console.error);
-```
-
-This code snippet does the following:
-
-1. Initializes a `TonClient` and creates a `PythContract` instance.
-2. Retrieves the current guardian set index and BTC price from the TON contract.
-3. Fetches the latest price updates from Hermes.
-4. Prepares the update data and calculates the update fee.
-5. Updates the price feeds on the TON contract.
-
-## Additional Resources
-
-You may find these additional resources helpful for developing your TON application:
-
-- [TON Documentation](https://ton.org/docs/)
-- [Pyth Price Feed IDs](https://pyth.network/developers/price-feed-ids)
-- [Pyth TON Contract](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ton/contracts)
-- [Pyth TON SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ton/sdk)
-- [Pyth TON SDK Example](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/ton/sdk_js_usage)
-- [Pyth TON Send USD Example](https://github.com/pyth-network/pyth-examples/tree/main/price_feeds/ton/send_usd)
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/acquire-an-access-token.mdx b/apps/developer-hub/content/docs/price-feeds/v2/acquire-an-access-token.mdx
deleted file mode 100644
index 9370d279f9..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/acquire-an-access-token.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: "Acquire an Access Token"
-description: "This guide explains how to acquire an access token for Pyth Lazer, which is required to authenticate websocket connections and subscribe to price updates."
-full: false
-index: false
----
-
-This guide explains how to acquire an access token for Pyth Lazer, which is required to authenticate websocket connections and subscribe to price updates.
-
-## Request Access Token
-
-Please fill out [this form](https://tally.so/r/nP2lG5) to contact the Pyth team and get the access token.
-
-
- Access tokens are required for all Pyth Lazer websocket connections. Make sure
- to keep your token secure and do not share it publicly.
-
-
-## Using the Access Token
-
-Once you receive your access token, use it to authenticate the websocket connection by passing it as an `Authorization` header with the value `Bearer {token}`.
-
-### Example Usage
-
-```js copy
-import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk";
-
-const client = await PythLazerClient.create(
- ["wss://pyth-lazer.dourolabs.app/v1/stream"],
- "YOUR_ACCESS_TOKEN",
-);
-```
-
-## Next Steps
-
-After acquiring your access token, you can proceed to [subscribe to price updates](./subscribe-price-updates.mdx) using the Pyth Lazer websocket API.
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/getting-started.mdx b/apps/developer-hub/content/docs/price-feeds/v2/getting-started.mdx
deleted file mode 100644
index c5b3adda18..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/getting-started.mdx
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: "Getting Started with Pyth Lazer"
-description: "Please refer to the how-to guides to get started."
-full: false
-index: false
----
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/index.mdx b/apps/developer-hub/content/docs/price-feeds/v2/index.mdx
deleted file mode 100644
index e27c477362..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/index.mdx
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: "Pyth Lazer"
-description: >-
- Pyth Lazer is a low latency, highly customizable price oracle.
-full: false
-index: true
----
-
-Pyth Lazer is a low latency, highly customizable price oracle.
-It offers a customizable set of price feeds, target chains (EVM or Solana) and channels (real time or fixed rate):
-
-- Real time channels send updates as frequently as they become available;
-- Fixed rate channels send updates at fixed time intervals (you can choose between 50 ms or 200 ms).
-
-The table below shows the difference between Pyth Core and Pyth Lazer:
-
-| | **Pyth Core** | **Pyth Lazer** |
-| ----------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
-| **Solution Type** | Stable, secure, and decentralized price data source for a broad spectrum of DeFi or TradFi applications. | **Permissioned** service focused on **ultra-low-latency** price and market data for highly latency-sensitive users. |
-| **Frequency** | 400ms on Pythnet appchain with support for risk mitigation via Benchmarks and confidence intervals. | **1ms** (**real-time**), 50ms, and 200ms channels, **customizable** frequencies, and throttling support to address different needs. |
-| **Data Types** | Aggregate price and confidence intervals. | Aggregate price, bid/ask price, and **customizable** market data (market depth and more). |
-| **Fees** | On-chain fee per signed cross-chain price update. | On-chain fee per signed cross-chain price update. |
-| **Update Costs** | >1,000-byte proofs and complex signature verification. | **100-byte proofs** and simple signature verification. |
-| **Integration Process** | Open and permissionless integration for any Web3 or Web2 protocol. | **Specialized** and **permissioned** solution for protocols prioritizing performance over some elements of decentralization. |
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/meta.json b/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/meta.json
deleted file mode 100644
index 7407cf49fd..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/meta.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "title": "Integrate as a Consumer",
- "description": "Real-time data from financial institutions",
- "icon": "ChartLine",
- "pages": ["on-solana-and-fogo", "on-evm-chains"]
-}
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/on-evm-chains.mdx b/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/on-evm-chains.mdx
deleted file mode 100644
index fc1253adc9..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/on-evm-chains.mdx
+++ /dev/null
@@ -1,155 +0,0 @@
----
-title: "On EVM chains"
-description: "This guide explains how to integrate Pyth Lazer into your EVM smart contracts."
-full: false
-index: false
----
-
-This guide is intended to serve users who wants to consume prices from the Pyth Lazer on **EVM chains**.
-
-Integrating with Pyth Lazer in smart contracts as a consumer is a three-step process:
-
-1. **Use** Pyth Lazer SDK in EVM smart contracts to parse the price updates.
-2. **Subscribe** to Pyth Lazer websocket to receive price updates on backend or frontend.
-3. **Include** the price updates into the smart contract transactions.
-
-
-
-### Use Pyth Lazer SDK in smart contracts
-
-Pyth Lazer provides a [Solidity SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/contracts/evm), which allows consumers to parse the price updates.
-
-```bash copy
-forge install pyth-network/pyth-crosschain
-```
-
-Add the following to `requirements.txt{:js}` file:
-
-```bash copy
-pyth-lazer-sdk/=lib/pyth-network/pyth-crosschain/lazer/contracts/evm
-```
-
-Once the SDK is installed, one can import the sdk into smart contracts:
-
-```solidity copy
-import { PythLazer } from "pyth-lazer-sdk/PythLazer.sol";
-import { PythLazerLib } from "pyth-lazer-sdk/PythLazerLib.sol";
-
-```
-
-After importing the SDK, initialize the [`PythLazer`](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/contracts/evm/src/PythLazer.sol#L7) contract and set up state varables to store prices and timestamps:
-
-```solidity copy
-contract ExampleConsumer {
- // Example state.
- PythLazer pythLazer;
- uint64 public price;
- uint64 public timestamp;
-
- //...
-
- constructor(address pythLazerAddress) {
- pythLazer = PythLazer(pythLazerAddress);
- }
-}
-
-```
-
-Add an argument of type `bytes calldata{:solidity}` to the method which will receive the Pyth Lazer price udpate:
-
-```solidity copy
-function updatePrice(bytes calldata priceUpdate) public payable {
- uint256 verification_fee = pythLazer.verification_fee();
- (bytes calldata payload, ) = verifyUpdate{ value: verification_fee }(update);
- //...
-}
-
-```
-
-The `verifyUpdate` function will verify the price update and return the payload and the verification fee. This call takes a fee which can be queried from [`verification_fee(){:solidity}`](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/contracts/evm/src/PythLazer.sol#L9) function and passed to the `verifyUpdate` call. This fee is used to cover the cost of verifying the price update.
-
-This SDK provides [`parsePayloadHeader`](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/contracts/evm/src/PythLazerLib.sol#L21) method to retrieve the values from the payload header.
-
-```solidity copy
-(uint64 _timestamp, Channel channel, uint8 feedsLen, uint16 pos) = parsePayloadHeader(payload);
-```
-
-This method returns:
-
-- `_timestamp`: The timestamp of the price update.
-- `channel`: The channel of the price update.
-- `feedsLen`: The number of feeds in the price update.
-- `pos`: The cursor position of the payload.
-
-One can iterate over all the feeds and properties present within the price update, modifying the state variables as necessary.
-
-Here is an example of how to iterate over the feeds and properties:
-
-```solidity copy
-for (uint8 i = 0; i < feedsLen; i++) {
- uint32 feedId;
- uint8 num_properties;
- (feedId, num_properties, pos) = parseFeedHeader(payload, pos);
- for (uint8 j = 0; j < num_properties; j++) {
- PriceFeedProperty property;
- (property, pos) = parseFeedProperty(payload, pos);
- if (property == PriceFeedProperty.Price) {
- uint64 _price;
- (_price, pos) = parseFeedValueUint64(payload, pos);
- if (feedId == 2 && _timestamp > timestamp) {
- price = _price;
- timestamp = _timestamp;
- }
- } else if (property == PriceFeedProperty.BestBidPrice) {
- uint64 _price;
- (_price, pos) = parseFeedValueUint64(payload, pos);
- } else if (property == PriceFeedProperty.BestAskPrice) {
- uint64 _price;
- (_price, pos) = parseFeedValueUint64(payload, pos);
- } else {
- revert("unknown property");
- }
- }
-}
-```
-
-
- Make sure to pass the `pos` variable to every parsing call and assign the
- returned `pos` value to the same variable. Failure to do so will cause
- incorrect parsing results.
-
-
-
- When calling these parse functions, you must not skip price feeds or
- properties. Every parsing function will modify your `pos` variable, so
- skipping a call of `parseFeedHeader`, `parseFeedProperty`, or
- `parseFeedValueUint64` will lead to incorrect parsing results. Keep in mind
- that you can customize the set of price feeds and properties when requesting
- price updates via WebSocket. This will be explained in the next step.
-
-
-### Subscribe to Pyth Lazer to receive Price Updates
-
-Pyth Lazer provides a websocket endpoint to receive price updates. Moreover, Pyth Lazer also provides a [Typescript SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js) to subscribe to the websocket endpoint.
-
-Consult [How to subscribe to price updates from Pyth Lazer](../subscribe-price-updates.mdx) for a complete step-by-step guide.
-
-### Include the price updates into smart contract transactions
-
-Now that you have the price updates, and your smart contract is able to parse the price updates, you can include the price updates into the smart contract transactions by passing the price updates received from the previous step as an argument to the `updatePrice` method of your smart contract.
-
-
-
-## Additional Resources
-
-You may find these additional resources helpful for integrating Pyth Lazer into your EVM smart contracts.
-
-### Price Feed IDs
-
-Pyth Lazer supports a wide range of price feeds. Consult the [Price Feed IDs](../price-feed-ids.mdx) page for a complete list of supported price feeds.
-
-### Examples
-
-[Pyth-lazer-example-evm](https://github.com/pyth-network/pyth-examples/tree/main/lazer/evm) is a simple example contract that parses and consumes price updates from Pyth Lazer.
-
-[pyth-lazer-example-js](https://github.com/pyth-network/pyth-examples/tree/main/lazer/js) is a simple example for subscribing to the Pyth Lazer websocket.
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/on-solana-and-fogo.mdx b/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/on-solana-and-fogo.mdx
deleted file mode 100644
index 25ca7feb06..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-consumer/on-solana-and-fogo.mdx
+++ /dev/null
@@ -1,284 +0,0 @@
----
-title: "On Solana and FOGO"
-description: "This guide explains how to integrate Pyth Lazer into your Solana and FOGO smart contracts."
-full: false
-index: false
----
-
-This guide is intended to serve users who wants to consume prices from the Pyth Lazer on **Solana and Fogo**.
-
-Integrating with Pyth Lazer in smart contracts as a consumer is a three-step process:
-
-1. **Use** Pyth Lazer SDK into SVM smart contracts to parse the price updates.
-2. **Subscribe** to Pyth Lazer websocket to receive price updates on backend or frontend.
-3. **Include** the price updates into the smart contract transactions.
-
-
-
-### Use Pyth Lazer SDK in smart contracts
-
-Pyth Lazer provides a [Solana SDK](https://docs.rs/pyth-lazer-solana-contract/latest/pyth_lazer_solana_contract/),
-which allows consumers to parse and verify the price updates on Solana-compatible chains (such as Fogo).
-
-To start, add the following to your `Cargo.toml` file (please check the current latest version at [crates.io](https://crates.io/crates/pyth-lazer-solana-contract)):
-
-```toml copy
-[dependencies]
-pyth-lazer-solana-contract = { version = "x.y.z", features = ["no-entrypoint"] }
-```
-
-Now you can create an instruction or multiple instructions that will receive Pyth Lazer messages.
-The instruction data sent to your program should include a byte array containing the Pyth Lazer message. The instruction data can also contain any other parameters your contracts may need.
-
-In order to successfully validate the Pyth Lazer message, the instruction needs to receive the following accounts:
-
-- Fee payer account
-- Pyth Lazer program ([`pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt`](https://solscan.io/account/pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt))
-- Pyth Lazer storage account (`3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL`)
-- Pyth Lazer treasury account (`Gx4MBPb1vqZLJajZmsKLg8fGw9ErhoKsR8LeKcCKFyak`)
-- The standard Solana system program account
-- The standard Solana instructions sysvar account
-
-You may also add any other accounts your contract needs.
-
-
- The code snippets below are part of the full consumer contract example
- [available on
- Github](https://github.com/pyth-network/pyth-examples/tree/main/lazer/solana).
-
-
-The following code can be used to set up a new instruction within a SVM contract:
-
-```rust copy
-use num_derive::FromPrimitive;
-use num_traits::FromPrimitive;
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, FromPrimitive)]
-pub enum Instruction {
- //...
- /// Update price.
- /// Data: `UpdateArgs` followed by a signed Pyth Lazer update.
- /// Accounts:
- /// 1. payer account
- /// 2. example data account [writable]
- /// 3. pyth program account [readonly]
- /// 4. pyth storage account [readonly]
- /// 5. pyth treasury account [writable]
- /// 6. system program [readonly]
- /// 7. instructions sysvar sysvar account [readonly]
- Update = 1,
-}
-
-/// Inputs to the `Update` instruction. `UpdateArgs` must be followed by a signed Pyth Lazer message.
-#[derive(Debug, Clone, Copy, Zeroable, Pod)]
-#[repr(C, packed)]
-pub struct UpdateArgs {
- /// Example argument
- pub hello: u64,
-}
-
-/// Program entrypoint's implementation.
-pub fn process_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- instruction_data: &[u8],
-) -> ProgramResult {
- // In our example contract, the first byte is the ID of the instruction.
- let instruction = *instruction_data
- .first()
- .ok_or(ProgramError::InvalidInstructionData)?;
- let instruction =
- Instruction::from_u8(instruction).ok_or(ProgramError::InvalidInstructionData)?;
- let instruction_args = &instruction_data[1..];
-
- match instruction {
- Instruction::Initialize => {
- process_initialize_instruction(program_id, accounts, instruction_args)
- }
- Instruction::Update => process_update_instruction(program_id, accounts, instruction_args),
- }
-}
-
-pub fn process_update_instruction(
- program_id: &Pubkey,
- accounts: &[AccountInfo],
- instruction_args: &[u8],
-) -> ProgramResult {
- // Verify accounts passed to the instruction.
- if accounts.len() != 7 {
- return Err(ProgramError::NotEnoughAccountKeys);
- }
- let payer_account = &accounts[0];
- let data_account = &accounts[1];
- let _pyth_program_account = &accounts[2];
- let pyth_storage_account = &accounts[3];
- let pyth_treasury_account = &accounts[4];
- let system_program_account = &accounts[5];
- let instructions_sysvar_account = &accounts[6];
- // See below for next steps...
-}
-```
-
-Invoke the Pyth Lazer on-chain program with appropriate arguments to validate the Pyth Lazer signature of the message.
-
-```rust copy
-// We expect the instruction to the built-in ed25519 program to be
-// the first instruction within the transaction.
-let ed25519_instruction_index = 0;
-// We expect our signature to be the first (and only) signature to be checked
-// by the built-in ed25519 program within the transaction.
-let signature_index = 0;
-// Verify Lazer signature.
-invoke(
- &ProgramInstruction::new_with_bytes(
- pyth_lazer_solana_contract::ID,
- &VerifyMessage {
- message_data: pyth_message.to_vec(),
- ed25519_instruction_index,
- signature_index,
- }
- .data(),
- vec![
- AccountMeta::new(*payer_account.key, true),
- AccountMeta::new_readonly(*pyth_storage_account.key, false),
- AccountMeta::new(*pyth_treasury_account.key, false),
- AccountMeta::new_readonly(*system_program_account.key, false),
- AccountMeta::new_readonly(*instructions_sysvar_account.key, false),
- ],
- ),
- &[
- payer_account.clone(),
- pyth_storage_account.clone(),
- pyth_treasury_account.clone(),
- system_program_account.clone(),
- instructions_sysvar_account.clone(),
- ],
-)?;
-```
-
-
- Note: When using native ed25519 signatures on SVM, we must use the built-in
- ed25519 program provided by the SVM runtime. This program can't be invoked
- from another contract. Instead, it must be called in an explicit instruction
- within the submitted transaction. This means that the sender of the
- transaction must include that instruction in the transaction. Our SDK
- leverages SVM runtime capabilities to ensure the ed25519 program has been
- correctly called in the transaction.
-
-
-Now parse the Pyth Lazer message.
-
-```rust copy
-// Deserialize and use the payload.
-let data = PayloadData::deserialize_slice_le(verified.payload)
- .map_err(|_| ProgramError::InvalidInstructionData)?;
-
-if data.feeds.is_empty() || data.feeds[0].properties.is_empty() {
- return Err(ProgramError::InvalidInstructionData);
-}
-```
-
-Now you can update the state according to the contract's logic:
-
-```rust copy
-// Read the data PDA of our example contract.
-let mut state_data = data_account.data.borrow_mut();
-let state =
- try_from_bytes_mut::(*state_data).map_err(|_| ProgramError::InvalidAccountData)?;
-
-if state.price_feed != data.feeds[0].feed_id.0 {
- return Err(ProgramError::InvalidInstructionData);
-}
-if data.channel_id != Channel::RealTime.id() {
- return Err(ProgramError::InvalidInstructionData);
-}
-if data.timestamp_us.0 <= state.latest_timestamp {
- return Err(ProgramError::AccountAlreadyInitialized);
-}
-let PayloadPropertyValue::Price(Some(price)) = data.feeds[0].properties[0] else {
- return Err(ProgramError::InvalidInstructionData);
-};
-state.latest_price = price.into_inner().into();
-state.latest_timestamp = data.timestamp_us.0;
-```
-
-
- Pyth Lazer also provides
- [pyth_lazer_protocol](https://docs.rs/pyth-lazer-protocol/latest/pyth_lazer_protocol/)
- Rust crate, which allows consumers to parse the price updates off-chain.
-
-
-### Subscribe to Pyth Lazer to receive Price Updates
-
-Pyth Lazer provides a websocket endpoint to receive price updates. Moreover, Pyth Lazer also provides a [typescript SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js) to subscribe to the websocket endpoint.
-
-Consult [How to subscribe to price updates from Pyth Lazer](../subscribe-price-updates.mdx) for a complete step-by-step guide.
-
-### Include the price updates into smart contract transactions
-
-Now that you have the price updates, and your smart contract is able to parse the price updates, you can include the price updates into the smart contract transactions by passing the price updates received from the previous step as an argument to the `update_price` method of your smart contract.
-
-In order to execute signature verification, you need to include an instruction for the built-in Solana ed25519 program in your transaction.
-
-
-
- In Rust, you can leverage helpers provided in the `pyth_lazer_solana_contract` crate:
-
-```rust copy
-// Instruction #0 will be ed25519 instruction;
-// Instruction #1 will be our contract instruction.
-let instruction_index = 1;
-// Total offset of Pyth Lazer update within the instruction data;
-// 1 byte is the instruction type.
-let message_offset = (size_of::() + 1).try_into().unwrap();
-let ed25519_args = pyth_lazer_solana_contract::Ed25519SignatureOffsets::new(
- &message,
- instruction_index,
- message_offset,
-);
-let mut tx = Transaction::new_with_payer(
- &[
- Instruction::new_with_bytes(
- solana_program::ed25519_program::ID,
- &pyth_lazer_solana_contract::ed25519_program_args(&[ed25519_args]),
- vec![],
- ),
- Instruction::new_with_bytes(
- pyth_lazer_solana_example::ID,
- &update_data,
- vec![
- AccountMeta::new(payer.pubkey(), true),
- AccountMeta::new(data_pda_key, false),
- AccountMeta::new(pyth_lazer_solana_contract::ID, false),
- AccountMeta::new_readonly(pyth_lazer_solana_contract::STORAGE_ID, false),
- AccountMeta::new(treasury, false),
- AccountMeta::new_readonly(system_program::ID, false),
- AccountMeta::new_readonly(sysvar::instructions::ID, false),
- ],
- ),
- ],
- Some(&payer.pubkey()),
-);
-```
-
-
-
- In TypeScript and JavaScript, you can leverage helpers provided in the `@pythnetwork/pyth-lazer-sdk` NPM package.
- {/* TODO: add example code */}
-
-
-
-
-## Additional Resources
-
-You may find these additional resources helpful for integrating Pyth Lazer into your SVM smart contracts.
-
-### Price Feed IDs
-
-Pyth Lazer supports a wide range of price feeds. Consult the [Price Feed IDs](../price-feeds.mdx) page for a complete list of supported price feeds.
-
-### Examples
-
-[pyth-lazer-example-solana](https://github.com/pyth-network/pyth-examples/tree/main/lazer/solana) is a simple example contract that parses and consumes price updates from Pyth Lazer.
-
-[pyth-lazer-example-js](https://github.com/pyth-network/pyth-examples/tree/main/lazer/js) is a simple example for subscribing to the Pyth Lazer websocket.
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-publisher.mdx b/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-publisher.mdx
deleted file mode 100644
index a8fe80a29a..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/integrate-as-a-publisher.mdx
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: "How to Integrate Pyth Lazer as a Publisher"
-description: "This guide explains how to integrate Pyth Lazer as a publisher."
-full: false
-index: false
----
-
-We are working on this guide. Please check back later or contact us here if you wish to publish data on Pyth Lazer.
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/meta.json b/apps/developer-hub/content/docs/price-feeds/v2/meta.json
deleted file mode 100644
index 904e0f9bea..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/meta.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "root": true,
- "title": "Price Feeds V2",
- "description": "Real-time data from financial institutions",
- "icon": "ChartLine",
- "pages": [
- "index",
- "getting-started",
- "---How-To Guides---",
- "acquire-an-access-token",
- "subscribe-to-prices",
- "...integrate-as-a-consumer",
- "integrate-as-a-publisher",
- "---Reference Material---",
- "price-feed-ids",
- "api-reference",
- "examples"
- ]
-}
diff --git a/apps/developer-hub/content/docs/price-feeds/v2/subscribe-to-prices.mdx b/apps/developer-hub/content/docs/price-feeds/v2/subscribe-to-prices.mdx
deleted file mode 100644
index cdd080dcd6..0000000000
--- a/apps/developer-hub/content/docs/price-feeds/v2/subscribe-to-prices.mdx
+++ /dev/null
@@ -1,136 +0,0 @@
----
-title: "Subscribe to Price Updates"
-description: "This guide explains how to subscribe to price updates from Pyth Lazer."
-full: false
-index: false
----
-
-This guide explains how to subscribe to price updates from Pyth Lazer. This guide will also explain various properties and configuration options to customize the price updates.
-
-Subscribing to price updates is a three-step process:
-
-1. **Acquire** an access token.
-2. **Configure** subscription parameters.
-3. **Subscribe** to the price updates via [websocket API](https://pyth-lazer.dourolabs.app/docs).
-
-The websocket server is available at `wss://pyth-lazer.dourolabs.app/v1/stream{:bash}`.
-
-
-
-### 1. Acquire an access token
-
-Please fill out [this form](https://tally.so/r/nP2lG5) to contact the Pyth team and get the access token.
-
-Use the access token to authenticate the websocket connection by passing it as an `Authorization{:bash}` header with the value `Bearer {token}{:bash}`.
-
-### 2. Configure subscription parameters
-
-Lazer supports several request/subscription parameters to customize the received price updates.
-These parameters are configured by sending a subscription message to the webservice.
-A sample request (using the Lazer SDK client -- see step 3) is shown below:
-
-```js copy
-client.send({
- type: "subscribe",
- subscriptionId: 1,
- priceFeedIds: [1, 2],
- properties: ["price"],
- chains: ["solana"],
- channel: "fixed_rate@200ms",
-});
-```
-
-The most significant parameters are:
-
-- `subscriptionId` is an arbitrary numeric identifier for a subscription. It will be returned back in response by the server. It does not affect the signed payload.
-- `priceFeedIds` is the list of price feeds to receive updates for. Data for all price feeds will be present in the signed price updates generated. Refer to the [Price Feed IDs list](./price-feed-ids.mdx) for the supported price feeds.
-- `properties` is the list of properties to retrieve, such as **price**, **bestBidPrice**, **bestAskPrice**, etc.
-- `chains` is the list of chains to receive a signed payload for, such as **evm**, **solana**, etc.
-- `channel` determines the update rate: updates in the **real_time** channel are sent as frequently as possible, while **fixed_rate@200ms** and **fixed_rate@50ms** channels are updated at fixed rates.
-
-There are also a few other configuration parameters -- see the [API documentation](https://pyth-lazer.dourolabs.app/docs) for more details.
-
-Determine the most suitable values for your application -- they will be used in the next step.
-
-### 3. Subscribe to the price updates
-
-To subscribe to the price updates, send a request to the websocket server. The server will respond with a signed price update.
-
-1. Pyth Lazer provides an [SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js) to seamlessly integrate the websocket API into your application.
- Install it using the following command:
-
-```bash copy
-npm install --save @pythnetwork/pyth-lazer-sdk
-```
-
-2. Then create a [`PythLazerClient`](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/sdk/js/src/client.ts#L32) object using the URL and the access token requested from the Pyth team in the first step:
-
-```js copy
-import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk";
-
-const client = await PythLazerClient.create(
- ["wss://pyth-lazer.dourolabs.app/v1/stream"],
- "YOUR_ACCESS_TOKEN",
-);
-```
-
-3. After the client is created, subscribe to updates (using the configuration parameters from step 2):
-
-```js copy
-client.subscribe({
- type: "subscribe",
- subscriptionId: 1,
- priceFeedIds: [1, 2],
- properties: ["price"],
- chains: ["solana"],
- channel: "fixed_rate@200ms",
-});
-```
-
-4. Once the connection is established, the server will start sending the price updates to the client:
-
-```js copy
-client.addMessageListener((message) => {
- console.log(message);
-});
-```
-
-By default, price updates contain the `parsed` field that one can use to easily interpret the price update in their backend or frontend, as well as `evm` and/or `solana` fields that contain data that one should include in the on-chain transaction:
-
-```json copy
-{
- "type": "streamUpdated",
- "subscriptionId": 1,
- "parsed": {
- "timestampUs": "1730986152400000",
- "priceFeeds": [
- {
- "priceFeedId": 1,
- "price": "1006900000000"
- },
- {
- "priceFeedId": 2,
- "price": "2006900000000"
- }
- ]
- },
- "solana": {
- "encoding": "hex",
- "data": "b9011a82d239c094c52016990d6ca2b261dbb1157ad503cbd3ea0679493316150cf3457624d19ec3f6e0a0e94373ab0971e39d939beda15cc02eb3c5454eb700f1f7310df65210bee4fcf5b1cee1e537fabcfd95010297653b94af04d454fc473e94834f2a0075d3c7938094b99e52260600030201000000010000b5ea6fea00000002000000010000c58f44d3010000"
- }
-}
-```
-
-
-
-## Additional Resources
-
-You may find these additional resources helpful for subscribing to price updates from Pyth Lazer.
-
-### Price Feed IDs
-
-Pyth Lazer supports a wide range of price feeds. Consult the [Price Feed IDs](./price-feed-ids.mdx) page for a complete list of supported price feeds.
-
-### Examples
-
-[pyth-lazer-example-js](https://github.com/pyth-network/pyth-examples/tree/main/lazer/js) is a simple example for subscribing to the Pyth Lazer websocket.
diff --git a/apps/developer-hub/migration-report.json b/apps/developer-hub/migration-report.json
new file mode 100644
index 0000000000..fc21c8fd33
--- /dev/null
+++ b/apps/developer-hub/migration-report.json
@@ -0,0 +1,6 @@
+[
+ {
+ "source": "pages/price-feeds/core/use-real-time-data/pull-integration/cosmwasm.mdx",
+ "target": "content/docs/price-feeds/core/use-real-time-data/pull-integration/cosmwasm.mdx"
+ }
+]
diff --git a/apps/developer-hub/migration-report.md b/apps/developer-hub/migration-report.md
new file mode 100644
index 0000000000..d81796d37a
--- /dev/null
+++ b/apps/developer-hub/migration-report.md
@@ -0,0 +1 @@
+pages/price-feeds/core/use-real-time-data/pull-integration/cosmwasm.mdx -> content/docs/price-feeds/core/use-real-time-data/pull-integration/cosmwasm.mdx
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/publish-data/assets/Confidence_Interval_and_Crypto_Exchange_Fees_Table_1.png b/apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_1.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/publish-data/assets/Confidence_Interval_and_Crypto_Exchange_Fees_Table_1.png
rename to apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_1.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/publish-data/assets/Confidence_Interval_and_Crypto_Exchange_Fees_Table_2.png b/apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_2.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/publish-data/assets/Confidence_Interval_and_Crypto_Exchange_Fees_Table_2.png
rename to apps/developer-hub/public/images/Confidence_Interval_and_Crypto_Exchange_Fees_Table_2.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/EMA_Price_Aggregation_1.png b/apps/developer-hub/public/images/EMA_Price_Aggregation_1.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/EMA_Price_Aggregation_1.png
rename to apps/developer-hub/public/images/EMA_Price_Aggregation_1.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/EMA_Price_Aggregation_2.png b/apps/developer-hub/public/images/EMA_Price_Aggregation_2.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/EMA_Price_Aggregation_2.png
rename to apps/developer-hub/public/images/EMA_Price_Aggregation_2.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_1.png b/apps/developer-hub/public/images/Price_Aggregation_1.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_1.png
rename to apps/developer-hub/public/images/Price_Aggregation_1.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_2.png b/apps/developer-hub/public/images/Price_Aggregation_2.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_2.png
rename to apps/developer-hub/public/images/Price_Aggregation_2.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_3.png b/apps/developer-hub/public/images/Price_Aggregation_3.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_3.png
rename to apps/developer-hub/public/images/Price_Aggregation_3.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_4.png b/apps/developer-hub/public/images/Price_Aggregation_4.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_4.png
rename to apps/developer-hub/public/images/Price_Aggregation_4.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_5.png b/apps/developer-hub/public/images/Price_Aggregation_5.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_5.png
rename to apps/developer-hub/public/images/Price_Aggregation_5.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_6.png b/apps/developer-hub/public/images/Price_Aggregation_6.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_6.png
rename to apps/developer-hub/public/images/Price_Aggregation_6.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_7.png b/apps/developer-hub/public/images/Price_Aggregation_7.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Price_Aggregation_7.png
rename to apps/developer-hub/public/images/Price_Aggregation_7.png
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Pull-Architecture-Hermes.png b/apps/developer-hub/public/images/Pull-Architecture-Hermes.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/how-pyth-works/assets/Pull-Architecture-Hermes.png
rename to apps/developer-hub/public/images/Pull-Architecture-Hermes.png
diff --git a/apps/developer-hub/public/images/guides/gelato/dedicated-msg-sender.png b/apps/developer-hub/public/images/guides/gelato/dedicated-msg-sender.png
new file mode 100644
index 0000000000..9aea6f467d
Binary files /dev/null and b/apps/developer-hub/public/images/guides/gelato/dedicated-msg-sender.png differ
diff --git a/apps/developer-hub/content/docs/price-feeds/v1/schedule-price-updates/assets/guides/gelato/deposit-usdc.png b/apps/developer-hub/public/images/guides/gelato/deposit-usdc.png
similarity index 100%
rename from apps/developer-hub/content/docs/price-feeds/v1/schedule-price-updates/assets/guides/gelato/deposit-usdc.png
rename to apps/developer-hub/public/images/guides/gelato/deposit-usdc.png
diff --git a/apps/developer-hub/public/images/guides/gelato/storage-pyth-config.png b/apps/developer-hub/public/images/guides/gelato/storage-pyth-config.png
new file mode 100644
index 0000000000..96c39e2416
Binary files /dev/null and b/apps/developer-hub/public/images/guides/gelato/storage-pyth-config.png differ
diff --git a/apps/developer-hub/public/images/guides/gelato/task-creation-gist-id.png b/apps/developer-hub/public/images/guides/gelato/task-creation-gist-id.png
new file mode 100644
index 0000000000..661d0ea560
Binary files /dev/null and b/apps/developer-hub/public/images/guides/gelato/task-creation-gist-id.png differ
diff --git a/apps/developer-hub/public/images/guides/gelato/task-execution.png b/apps/developer-hub/public/images/guides/gelato/task-execution.png
new file mode 100644
index 0000000000..0d3dd9780e
Binary files /dev/null and b/apps/developer-hub/public/images/guides/gelato/task-execution.png differ