|
1 | 1 | syntax = "proto3";
|
| 2 | +package pyth_lazer_transaction; |
2 | 3 |
|
3 | 4 | import "google/protobuf/timestamp.proto";
|
4 | 5 |
|
5 |
| -package pyth_lazer_transaction; |
| 6 | +// if any fields marked as [required] are missing, feed/publisher update will be rejected |
6 | 7 |
|
7 |
| -// PublisherUpdate contains an array of individual updates and a timestamp |
| 8 | +// Publisher update included in transaction |
| 9 | +// |
| 10 | +// Each publisher update contains a batch of feed updates from publisher. |
| 11 | +// The publisher uses Pyth Agent on their side that handles batching. |
| 12 | +// Each feed update specifies a single update type (price, funding rate, etc.) |
8 | 13 | message PublisherUpdate {
|
9 |
| - // Array of updates, each of which target a single feed |
10 |
| - repeated FeedUpdate updates = 1; |
11 |
| - |
12 |
| - // ID of the Publisher that is sending the update |
13 |
| - // Should match ID stored in Pyth Lazer |
14 |
| - optional uint32 publisher_id = 2; |
| 14 | + // [required] array of feed updates, each of which target a single feed |
| 15 | + // order of updates are preserved between encoding/decoding |
| 16 | + repeated FeedUpdate updates = 1; |
15 | 17 |
|
16 |
| - // Timestamp when this message was created |
17 |
| - optional google.protobuf.Timestamp publisher_timestamp = 3; |
| 18 | + // [required] timestamp when batch of feed updates was collected |
| 19 | + optional google.protobuf.Timestamp publisher_timestamp = 2; |
18 | 20 | }
|
19 | 21 |
|
20 |
| -// Update to a feed. May contain different types of data depending on what kind of update it is |
| 22 | +// A single feed update containing one type of update |
21 | 23 | message FeedUpdate {
|
22 |
| - // Feed which the update should be applied to |
23 |
| - // Should match a feed id recognized by PythLazer |
24 |
| - optional uint32 feed_id = 1; |
25 |
| - |
26 |
| - // Timestamp when this data was first acquired or generated |
27 |
| - optional google.protobuf.Timestamp source_timestamp = 2; |
28 |
| - |
29 |
| - // one of the valid updates allowed by publishers for a lazer feed |
30 |
| - oneof update { |
31 |
| - PriceUpdate price_update = 3; |
32 |
| - FundingRateUpdate funding_rate_update = 4; |
33 |
| - }; |
| 24 | + // [required] id of the lazer feed to be updated |
| 25 | + // should match the ids of feeds recognized by pyth lazer |
| 26 | + optional uint32 feed_id = 1; |
| 27 | + |
| 28 | + // [required] timestamp when this data was first acquired or generated |
| 29 | + optional google.protobuf.Timestamp source_timestamp = 2; |
| 30 | + |
| 31 | + // [required] one type of update containing specific data |
| 32 | + oneof update { |
| 33 | + PriceUpdate price_update = 3; |
| 34 | + FundingRateUpdate funding_rate_update = 4; |
| 35 | + }; |
34 | 36 | }
|
35 | 37 |
|
| 38 | +// feed update containing data for the core price, bid, and ask prices |
36 | 39 | message PriceUpdate {
|
37 |
| - // Price for the symbol as an integer |
38 |
| - // Should be produced with a matching exponent to the configured exponent value in PythLazer |
39 |
| - // May be missing if no price data is available |
40 |
| - optional int64 price = 1; |
41 |
| - |
42 |
| - // Best Bid Price for the symbol as an integer |
43 |
| - // Should be produced with a matching exponent to the configured exponent value in PythLazer |
44 |
| - // May be missing if no data is available |
45 |
| - optional int64 best_bid_price = 2; |
46 |
| - |
47 |
| - // Best Ask Price for the symbol as an integer |
48 |
| - // Should be produced with a matching exponent to the configured exponent value in PythLazer |
49 |
| - // May be missing if no data is available |
50 |
| - optional int64 best_ask_price = 3; |
| 40 | + // [optional] price for the feed as an integer |
| 41 | + // should be produced with a matching exponent to the configured exponent value in pyth lazer |
| 42 | + optional int64 price = 1; |
| 43 | + |
| 44 | + // [optional] best bid price for the feed as an integer |
| 45 | + // should be produced with a matching exponent to the configured exponent value in pyth lazer |
| 46 | + // may be missing if no data is available |
| 47 | + optional int64 best_bid_price = 2; |
| 48 | + |
| 49 | + // [optional] best ask price for the feed as an integer |
| 50 | + // should be produced with a matching exponent to the configured exponent value in pyth lazer |
| 51 | + // may be missing if no data is available |
| 52 | + optional int64 best_ask_price = 3; |
51 | 53 | }
|
52 | 54 |
|
| 55 | +// feed update containing data relating to funding rate |
53 | 56 | message FundingRateUpdate {
|
54 |
| - // Price for which the funding rate applies to |
55 |
| - optional int64 price = 1; |
| 57 | + // [optional] price for which the funding rate applies to |
| 58 | + optional int64 price = 1; |
56 | 59 |
|
57 |
| - // Perpetual Future funding rate |
58 |
| - optional int64 rate = 2; |
| 60 | + // [optional] perpetual future funding rate |
| 61 | + optional int64 rate = 2; |
59 | 62 | }
|
0 commit comments