|
1 | 1 | syntax = "proto3"; |
2 | 2 |
|
| 3 | +import "google/protobuf/timestamp.proto"; |
| 4 | + |
3 | 5 | package pyth_lazer_transaction; |
4 | 6 |
|
| 7 | +// PublisherUpdate contains an array of individual updates and a timestamp |
5 | 8 | message PublisherUpdate { |
| 9 | + // Array of updates, each of which target a single feed |
6 | 10 | repeated FeedUpdate updates = 1; |
7 | | - uint64 batch_timestamp_us = 2; |
| 11 | + |
| 12 | + // Timestamp when this message was created |
| 13 | + optional google.protobuf.Timestamp publisher_timestamp = 2; |
8 | 14 | } |
9 | 15 |
|
| 16 | +// Update to a feed. May contain different types of data depending on what kind of update it is |
10 | 17 | message FeedUpdate { |
| 18 | + // Feed which the update should be applied to |
| 19 | + // Should match a feed id recognized by PythLazer |
| 20 | + optional uint32 feed_id = 1; |
| 21 | + |
| 22 | + // Timestamp when this data was first acquired or generated |
| 23 | + optional google.protobuf.Timestamp source_timestamp = 2; |
| 24 | + |
| 25 | + // one of the valid updates allowed by publishers for a lazer feed |
11 | 26 | oneof update { |
12 | | - PriceUpdateV1 price_update_v1 = 1; |
13 | | - FundingRateUpdateV1 funding_rate_update_v1 = 2; |
14 | | - } |
| 27 | + PriceUpdate price_update = 3; |
| 28 | + FundingRateUpdate funding_rate_update = 4; |
| 29 | + }; |
15 | 30 | } |
16 | 31 |
|
17 | | -message PriceUpdateV1 { |
18 | | - uint32 feed_id = 1; |
19 | | - uint64 source_timestamp_us = 2; |
20 | | - uint64 publisher_timestamp_us = 3; |
21 | | - optional int64 price = 4; |
22 | | - optional int64 best_bid_price = 5; |
23 | | - optional int64 best_ask_price = 6; |
| 32 | +message PriceUpdate { |
| 33 | + // Price for the symbol as an integer |
| 34 | + // Should be produced with a matching exponent to the configured exponent value in PythLazer |
| 35 | + // May be missing if no price data is available |
| 36 | + optional int64 price = 1; |
| 37 | + |
| 38 | + // Best Bid Price for the symbol as an integer |
| 39 | + // Should be produced with a matching exponent to the configured exponent value in PythLazer |
| 40 | + // May be missing if no data is available |
| 41 | + optional int64 best_bid_price = 2; |
| 42 | + |
| 43 | + // Best Ask Price for the symbol as an integer |
| 44 | + // Should be produced with a matching exponent to the configured exponent value in PythLazer |
| 45 | + // May be missing if no data is available |
| 46 | + optional int64 best_ask_price = 3; |
24 | 47 | } |
25 | 48 |
|
26 | | -message FundingRateUpdateV1 { |
27 | | - uint32 feed_id = 1; |
28 | | - uint64 source_timestamp_us = 2; |
29 | | - uint64 publisher_timestamp_us = 3; |
30 | | - optional int64 price = 4; |
31 | | - optional int64 rate = 5; |
| 49 | +message FundingRateUpdate { |
| 50 | + // Price for which the funding rate applies to |
| 51 | + optional int64 price = 1; |
| 52 | + |
| 53 | + // Perpetual Future funding rate |
| 54 | + optional int64 rate = 2; |
32 | 55 | } |
0 commit comments