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/pro/integrate-as-consumer/evm.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ contract ExampleConsumer {
52
52
53
53
```
54
54
55
-
Add an argument of type `bytes calldata{:solidity}` to the method which will receive the price udpate:
55
+
Add an argument of type `bytes calldata{:solidity}` to the method which will receive the price update:
56
56
57
57
```solidity copy
58
58
function updatePrice(bytes calldata priceUpdate) public payable {
@@ -127,7 +127,7 @@ for (uint8 i = 0; i < feedsLen; i++) {
127
127
128
128
### Subscribe to Pyth Pro to receive Price Updates
129
129
130
-
Pyth Pro/Lazer provides a websocket endpoint to receive price updates. Moreover, Pyth Pro/Lazer also provides a [Typescript SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js) to subscribe to the websocket endpoint.
130
+
Pyth Pro provides a websocket endpoint to receive price updates. Moreover, Pyth Pro also provides a [Typescript SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js) to subscribe to the websocket endpoint.
131
131
132
132
Consult [How to subscribe to price updates](../subscribe-price-updates.mdx) for a complete step-by-step guide.
This guide explains how to subscribe to prices from Pyth Pro.
6
6
This guide will also explain various properties and configuration options to customize the prices.
7
-
**The return data also includes price updates that can be verified on the target chain.**
7
+
**The return data also includes verified payloads that can be verified on the target blockchain.**
8
8
9
9
Subscribing to prices is a three-step process:
10
10
11
11
1.**Acquire** an access token.
12
12
2.**Configure** subscription parameters.
13
-
3.**Subscribe** to the prices and price updates via [websocket API](https://pyth-lazer.dourolabs.app/docs).
13
+
3.**Subscribe** to the prices via [websocket API](https://pyth-lazer.dourolabs.app/docs).
14
14
15
15
The websocket server is available at `wss://pyth-lazer.dourolabs.app/v1/stream{:bash}`.
16
16
@@ -42,7 +42,7 @@ client.send({
42
42
The most significant parameters are:
43
43
44
44
-`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.
45
-
-`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.
45
+
-`priceFeedIds` is the list of price feeds to receive price data for. It will also include the verified payloads for the price feeds. Refer to the [Price Feed IDs list](./price-feed-ids.mdx) for the supported price feeds.
46
46
-`properties` is the list of properties to retrieve, such as **price**, **bestBidPrice**, **bestAskPrice**, etc.
47
47
-`chains` is the list of chains to receive a signed payload for, such as **evm**, **solana**, etc.
48
48
-`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.
@@ -51,11 +51,11 @@ There are also a few other configuration parameters -- see the [API documentatio
51
51
52
52
Determine the most suitable values for your application -- they will be used in the next step.
53
53
54
-
### 3. Subscribe to the prices and price updates
54
+
### 3. Subscribe to the prices
55
55
56
-
To subscribe to the prices, send a request to the websocket server. The server will respond with a signed price update.
56
+
To subscribe to the prices, send a request to the websocket server. The server will respond with a signed payload.
57
57
58
-
1. Pyth Lazer(Infrastructure behind Pyth Pro) provides an [SDK](https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js) to seamlessly integrate the websocket API into your application.
58
+
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.
3. After the client is created, subscribe to price and price updates (using the configuration parameters from step 2):
76
+
3. After the client is created, subscribe to prices (using the configuration parameters from step 2):
77
77
78
78
```js copy
79
79
client.subscribe({
@@ -86,15 +86,15 @@ client.subscribe({
86
86
});
87
87
```
88
88
89
-
4. Once the connection is established, the server will start sending the price and price updates to the client:
89
+
4. Once the connection is established, the server will start sending the price and verified payloads to the client:
90
90
91
91
```js copy
92
92
client.addMessageListener((message) => {
93
93
console.log(message);
94
94
});
95
95
```
96
96
97
-
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:
97
+
By default, verified payloads contain the `parsed` field that one can use to easily interpret the price data 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:
98
98
99
99
```json copy
100
100
{
@@ -124,7 +124,7 @@ By default, price updates contain the `parsed` field that one can use to easily
124
124
125
125
## Additional Resources
126
126
127
-
You may find these additional resources helpful for subscribing to prices and price updates from Pyth Pro.
127
+
You may find these additional resources helpful for subscribing to prices from Pyth Pro.
0 commit comments