Skip to content

Commit 2900d17

Browse files
authored
feat: gobal exposure add net and gross positions (#31)
1 parent 64daec3 commit 2900d17

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

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.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pragma-common"
3-
version = "0.6.3"
3+
version = "0.6.4"
44
edition = "2021"
55
rust-version = "1.81"
66
categories = ["finance", "api-bindings"]

schema/entries.proto

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ message PositionEntry {
144144

145145
message GlobalExposureEntry {
146146
string source = 1;
147-
int64 timestampMs = 2;
147+
int64 timestamp_ms= 2;
148148
string asset = 3;
149-
double size = 4;
149+
double gross_position_size = 4;
150+
double net_position_size = 5;
150151
}

src/entries/global_exposure.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ pub struct GlobalExposureEntry {
1515
pub source: String,
1616
pub timestamp_ms: i64,
1717
pub asset: String,
18-
pub size: f64,
18+
pub gross_position_size: f64,
19+
pub net_position_size: f64,
1920
}
2021

2122
#[cfg(feature = "proto")]
@@ -25,7 +26,8 @@ impl GlobalExposureEntry {
2526
source: self.source.clone(),
2627
timestamp_ms: self.timestamp_ms,
2728
asset: self.asset.clone(),
28-
size: self.size,
29+
gross_position_size: self.gross_position_size,
30+
net_position_size: self.net_position_size,
2931
}
3032
}
3133

@@ -34,7 +36,8 @@ impl GlobalExposureEntry {
3436
source: proto.source,
3537
timestamp_ms: proto.timestamp_ms,
3638
asset: proto.asset,
37-
size: proto.size,
39+
gross_position_size: proto.gross_position_size,
40+
net_position_size: proto.net_position_size,
3841
})
3942
}
4043
}

0 commit comments

Comments
 (0)