This repository was archived by the owner on Jun 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ use pyth_client::{
7
7
Product ,
8
8
Price ,
9
9
PriceType ,
10
- DeriveType ,
11
10
PriceStatus ,
12
11
CorpAction ,
13
12
cast,
@@ -122,10 +121,8 @@ fn main() {
122
121
println ! ( " conf ......... {}" , pa. agg. conf ) ;
123
122
println ! ( " valid_slot ... {}" , pa. valid_slot ) ;
124
123
println ! ( " publish_slot . {}" , pa. agg. pub_slot ) ;
125
- println ! ( " twap ......... {}" ,
126
- pa. drv[ ( DeriveType :: TWAP as usize ) -1 ] ) ;
127
- println ! ( " volatility ... {}" ,
128
- pa. drv[ ( DeriveType :: Volatility as usize ) -1 ] ) ;
124
+ println ! ( " twap ......... {}" , pa. twap ) ;
125
+ println ! ( " volatility ... {}" , pa. avol ) ;
129
126
130
127
// go to next price account in list
131
128
if pa. next . is_valid ( ) {
Original file line number Diff line number Diff line change @@ -42,15 +42,6 @@ pub enum PriceType
42
42
Price
43
43
}
44
44
45
- // different types of calculations derived from aggregate price
46
- #[ repr( C ) ]
47
- pub enum DeriveType
48
- {
49
- Unknown ,
50
- TWAP ,
51
- Volatility
52
- }
53
-
54
45
// solana public key
55
46
#[ repr( C ) ]
56
47
pub struct AccKey
@@ -118,7 +109,14 @@ pub struct Price
118
109
pub unused : u32 ,
119
110
pub curr_slot : u64 , // currently accumulating price slot
120
111
pub valid_slot : u64 , // valid slot-time of agg. price
121
- pub drv : [ i64 ; 8 ] , // calculated values derived from agg. price
112
+ pub twap : i64 , // time-weighted average price
113
+ pub avol : u64 , // annualized price volatility
114
+ pub drv0 : i64 , // space for future derived values
115
+ pub drv1 : i64 , // space for future derived values
116
+ pub drv2 : i64 , // space for future derived values
117
+ pub drv3 : i64 , // space for future derived values
118
+ pub drv4 : i64 , // space for future derived values
119
+ pub drv5 : i64 , // space for future derived values
122
120
pub prod : AccKey , // product account key
123
121
pub next : AccKey , // next Price account in linked list
124
122
pub agg_pub : AccKey , // quoter who computed last aggregate price
You can’t perform that action at this time.
0 commit comments