Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 0d2689f

Browse files
added num_qt field representing number of quoters that make up the aggregate price
1 parent 05954af commit 0d2689f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-client"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
authors = ["Richard Brooks"]
55
edition = "2018"
66
license = "Apache-2.0"

examples/get_accounts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ fn main() {
119119
println!( " corp_act ..... {}", get_corp_act(&pa.agg.corp_act));
120120
println!( " price ........ {}", pa.agg.price );
121121
println!( " conf ......... {}", pa.agg.conf );
122+
println!( " num_qt ....... {}", pa.num_qt );
122123
println!( " valid_slot ... {}", pa.valid_slot );
123124
println!( " publish_slot . {}", pa.agg.pub_slot );
124125
println!( " twap ......... {}", pa.twap.val );

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ pub struct PriceInfo
9090
#[repr(C)]
9191
pub struct PriceComp
9292
{
93-
publisher : AccKey, // key of contributing quoter
94-
agg : PriceInfo, // contributing price to last aggregate
95-
latest : PriceInfo // latest contributing price (not in agg.)
93+
pub publisher : AccKey, // key of contributing quoter
94+
pub agg : PriceInfo, // contributing price to last aggregate
95+
pub latest : PriceInfo // latest contributing price (not in agg.)
9696
}
9797

9898
#[repr(C)]
9999
pub struct Ema
100100
{
101-
pub val : i64, // current value of ema
102-
numer : i64, // numerator state for next update
103-
denom : i64 // denominator state for next update
101+
pub val : i64, // current value of ema
102+
numer : i64, // numerator state for next update
103+
denom : i64 // denominator state for next update
104104
}
105105

106106
// Price account structure
@@ -114,7 +114,7 @@ pub struct Price
114114
pub ptype : PriceType, // price or calculation type
115115
pub expo : i32, // price exponent
116116
pub num : u32, // number of component prices
117-
pub unused : u32,
117+
pub num_qt : u32, // number of quoters that make up aggregate
118118
pub last_slot : u64, // slot of last valid (not unknown) aggregate price
119119
pub valid_slot : u64, // valid slot-time of agg. price
120120
pub twap : Ema, // time-weighted average price

0 commit comments

Comments
 (0)