Skip to content

Commit 7ae8c24

Browse files
committed
chore(price-feeds) improvements
1 parent fc813e8 commit 7ae8c24

File tree

7 files changed

+37
-52
lines changed

7 files changed

+37
-52
lines changed

pages/price-feeds/use-real-time-data.mdx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,29 @@ Pyth price feeds are available on 100+ blockchain ecosystems.
1010
Check out the complete list of chains and implementation contract addresses at [Contract Addresses](contract-addresses).
1111

1212
If your blockchain is not supported, please [ask in the dev-forum](https://dev-forum.pyth.network/latest).
13-
Then, consult the relevant ecosystem guide to get started using Pyth **pull** real-time price data:
1413

15-
- [EVM](use-real-time-data/evm)
16-
- [Solana](use-real-time-data/solana)
17-
- [Aptos](use-real-time-data/aptos.md)
18-
- [CosmWasm](use-real-time-data/cosmwasm.md)
19-
- [Sui](use-real-time-data/sui.md)
20-
- [IOTA](use-real-time-data/iota.md)
21-
- [Near](use-real-time-data/sui.md)
14+
## Pull Integration
15+
16+
Consult the relevant ecosystem guide to get started using Pyth **Pull Integration:**
17+
18+
- [EVM](use-real-time-data/pull-integration/evm)
19+
- [Solana](use-real-time-data/pull-integration/solana)
20+
- [Aptos](use-real-time-data/pull-integration/aptos.md)
21+
- [CosmWasm](use-real-time-data/pull-integration/cosmwasm.md)
22+
- [Sui](use-real-time-data/pull-integration/sui.md)
23+
- [IOTA](use-real-time-data/pull-integration/iota.md)
24+
- [Near](use-real-time-data/pull-integration/near.md)
25+
26+
## Push Integration
2227

2328
To consume real-time price data using **push** integration, check out the following guides:
2429

2530
- [Using Push Integration](use-real-time-data/push-integration)
2631

2732
This guide will walk you through the steps to use real-time price data using Push Integration in every ecosystem.
2833

34+
## Off-Chain Applications
35+
2936
Pyth price feeds can also be used in off-chain applications.
3037
For example, an application may need to show real-time asset prices on a website.
3138
Developers building such applications can consult the following guide:
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"pull-integration": "using Pull Integration",
3-
"push-integration": "using Push Integration",
4-
"off-chain": "in Off-Chain Applications"
3+
"push-integration": "using Push Integration"
54
}

pages/price-feeds/use-real-time-data/off-chain.mdx

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
2-
"evm": "in EVM Contracts",
3-
"solana": "in Solana and SVM Programs",
4-
"starknet": "in Starknet Contracts",
5-
"fuel": "in Fuel Contracts",
6-
"stacks": "in Stacks Contracts",
7-
"aptos": "in Aptos Contracts",
8-
"sui": "in Sui Contracts",
9-
"iota": "in IOTA Contracts",
10-
"ton": "in TON Contracts",
11-
"cosmwasm": "in CosmWasm Contracts",
12-
"near": "in Near Contracts",
13-
"off-chain": "in Off-Chain Applications"
14-
}
2+
"evm": "in EVM Contracts",
3+
"solana": "in Solana and SVM Programs",
4+
"starknet": "in Starknet Contracts",
5+
"fuel": "in Fuel Contracts",
6+
"stacks": "in Stacks Contracts",
7+
"aptos": "in Aptos Contracts",
8+
"sui": "in Sui Contracts",
9+
"iota": "in IOTA Contracts",
10+
"ton": "in TON Contracts",
11+
"cosmwasm": "in CosmWasm Contracts",
12+
"near": "in Near Contracts"
13+
}

pages/price-feeds/use-real-time-data/pull-integration/evm.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { Callout } from "nextra/components";
55
This guide explains how to Use real-time Pyth data in EVM contracts. For an interactive playground to explore the methods supported by the Pyth contract, see the [EVM API reference](../api-reference/evm/).
66

77
<Callout type="info" emoji="ℹ️">
8-
If you want to use real-time Price data using Push Integration, jump straight to Point 5 below and use the
8+
If you want to use real-time Price data using Push Integration instead, you can use the following code snippet:
99
```solidity copy
1010
PythStructs.Price memory price = pyth.getPriceNoOlderThan(priceFeedId, 60);
1111
```
12-
1312
Developers only need to pass the price feed ID to the above method from the [Push Feeds list](../pushed-feeds).
1413

14+
For complete example, refer to the [Push Integration guide](../push-integration).
15+
1516
</Callout>
1617

1718
## Install Pyth SDK

pages/price-feeds/use-real-time-data/pull-integration/starknet.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ Pyth also provides a javascript SDK to interact with the Pyth contract on Starkn
2121

2222
<Tabs items={["npm", "yarn"]}>
2323
<Tabs.Tab>
24-
```sh copy
25-
npm install --save @pythnetwork/pyth-starknet-js
26-
```
27-
</Tabs.Tab>
28-
<Tabs.Tab>
29-
```sh copy
30-
yarn add @pythnetwork/pyth-starknet-js
31-
```
24+
```sh copy npm install --save @pythnetwork/pyth-starknet-js ```
3225
</Tabs.Tab>
26+
<Tabs.Tab>```sh copy yarn add @pythnetwork/pyth-starknet-js ```</Tabs.Tab>
3327
</Tabs>
3428

3529
## Write Contract Code

pages/price-feeds/use-real-time-data/push-integration.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
This guide will walk you through the steps to use real-time price data using Push Integration in various ecosystems.
44

5-
6-
Pyth is a decentralized oracle network that provides real-time price data to blockchain applications.
5+
Pyth is a decentralized oracle network that provides real-time price data to blockchain applications.
76
It follows a design where price updates are pulled from pythnet, but it can be integrated into applications using push integration as well.
87
[What is a Pull Oracle](/price-feeds/pull-updates) explains this difference in detail.
98

@@ -20,6 +19,7 @@ Developers building on EVM chains can use Push Feeds to consume real-time price
2019
```solidity copy
2120
PythStructs.Price memory price = pyth.getPriceNoOlderThan(priceFeedId, 60);
2221
```
22+
2323
Developers only need to pass the price feed ID to the above method from the [Push Feeds list](../pushed-feeds).
2424

2525
Sample code snippet:
@@ -43,10 +43,9 @@ contract SomeContract {
4343
}
4444
4545
/**
46-
* This method is an example of how to interact with the Pyth contract using Push Integration.
47-
*/
46+
* This method is an example of how to interact with the Pyth contract using Push Integration.
47+
*/
4848
function exampleMethod() public {
49-
5049
// Read the current price from a price feed if it is less than 60 seconds old.
5150
// Each price feed (e.g., ETH/USD) is identified by a price feed ID.
5251
// The complete list of feed IDs is available at https://docs.pyth.network/price-feeds/price-feeds
@@ -71,4 +70,3 @@ let btc_price_identifier = x"e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658af
7170
let btc_usd_price_id = price_identifier::from_byte_vec(btc_price_identifier);
7271
pyth::get_price(btc_usd_price_id)
7372
```
74-

0 commit comments

Comments
 (0)