You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/price-feeds/use-real-time-data/evm.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ This guide explains how to use real-time Pyth data in EVM contracts. For an inte
9
9
## Install Pyth SDK
10
10
11
11
Pyth provides a [Solidity SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/solidity) to fetch prices from Pyth contracts.
12
-
The SDK exposes `IPyth` interface to interact with Pyth price feeds
12
+
The SDK exposes `IPyth` interface to interact with Pyth price feeds.
Typical usage of the Pyth SDK involves creating a `PriceServiceConnection` instance, by passing the URL of the [Hermes](https://hermes.pyth.network/docs/#/) service to the constructor.
24
-
You can then use the `getLatestPriceFeeds` method to fetch the latest prices of the specified price feeds.
24
+
You can then use the `getLatestPriceFeeds` method to fetch the latest prices of the specified price feeds:
25
25
26
26
```typescript copy
27
27
// Get the Stable Hermes service URL from https://docs.pyth.network/price-feeds/api-instances-and-providers/hermes
The `getLatestPriceFeeds` method returns an array of `PriceFeed` objects. Each `PriceFeed` object contains the latest price, the Exponential Moving Average (EMA) price, and other metadata.
40
+
The `getLatestPriceFeeds` method returns an array of `PriceFeed` objects. Each `PriceFeed` object contains the latest price, the Exponential Moving Average (EMA) price, and other metadata:
41
41
42
42
```bash
43
43
[
@@ -78,7 +78,7 @@ The `getLatestPriceFeeds` method returns an array of `PriceFeed` objects. Each `
78
78
]
79
79
```
80
80
81
-
You can also subscribe to real-time price updates over a WebSocket connection using the `subscribePriceFeedUpdates` method.
81
+
You can also subscribe to real-time price updates over a WebSocket connection using the `subscribePriceFeedUpdates` method:
82
82
83
83
```typescript copy
84
84
// priceIds here is the one declared in the above code snippet.
@@ -113,4 +113,4 @@ The [Hermes API](https://hermes.pyth.network/docs/#/) reference lets you interac
113
113
114
114
### Price Feed IDs
115
115
116
-
The [Price Feed Ids](https://pyth.network/developers/price-feed-ids) lists the price feeds available on the Pyth network.
116
+
The [Price Feed IDs](https://pyth.network/developers/price-feed-ids) lists the price feeds available on the Pyth network.
0 commit comments