Skip to content

Commit d242c12

Browse files
committed
test adding proto files to repo
1 parent a0428fc commit d242c12

File tree

3 files changed

+90
-1
lines changed

3 files changed

+90
-1
lines changed

lazer/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/timestamp.proto";
4+
5+
package pyth_lazer_transaction;
6+
7+
// PublisherUpdate contains an array of individual updates and a timestamp
8+
message PublisherUpdate {
9+
// Array of updates, each of which target a single feed
10+
repeated FeedUpdate updates = 1;
11+
12+
// Timestamp when this message was created
13+
optional google.protobuf.Timestamp publisher_timestamp = 2;
14+
}
15+
16+
// Update to a feed. May contain different types of data depending on what kind of update it is
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
26+
oneof update {
27+
PriceUpdate price_update = 3;
28+
FundingRateUpdate funding_rate_update = 4;
29+
};
30+
}
31+
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;
47+
}
48+
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;
55+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
syntax = "proto3";
2+
3+
package pyth_lazer_transaction;
4+
5+
import "publisher_update.proto";
6+
7+
// Types of Signatures allowed for signing Lazer Transactions
8+
enum TransactionSignatureType {
9+
// signature is 64 bytes long
10+
ed25519 = 0;
11+
}
12+
13+
// Signed lazer transaction payload
14+
// This is what Pyth Lazer expects as input to the system
15+
message SignedLazerTransaction {
16+
// Type and signature should match
17+
optional TransactionSignatureType signature_type = 1;
18+
19+
// Signature derived by signing payload with private key
20+
optional bytes signature = 2;
21+
22+
// a LazerTransaction message which is already encoded with protobuf as bytes
23+
// The encoded bytes are what should be signed
24+
optional bytes payload = 3;
25+
}
26+
27+
// Transaction contianing one of the valid Lazer Transactions
28+
message LazerTransaction {
29+
oneof payload {
30+
// Expected transaction sent by Publishers
31+
// May contain many individual updates to various feeds
32+
PublisherUpdate publisher_update = 1;
33+
}
34+
}

0 commit comments

Comments
 (0)