@@ -127,11 +127,17 @@ export const parsePriceData = (data: Buffer) => {
127
127
const currentSlot = readBigUInt64LE ( data , 32 )
128
128
// valid on-chain slot of aggregate price
129
129
const validSlot = readBigUInt64LE ( data , 40 )
130
- // calculated values derived from agg. price - up to 8
131
- const derived = [ ]
132
- for ( let d = 0 ; d < 8 ; d ++ ) {
133
- derived . push ( readBigInt64LE ( data , 48 + d * 8 ) )
134
- }
130
+ // time-weighted average price
131
+ const twap = readBigInt64LE ( data , 48 )
132
+ // annualized price volatility
133
+ const avol = readBigUInt64LE ( data , 56 )
134
+ // space for future derived values
135
+ const drv0 = readBigInt64LE ( data , 64 )
136
+ const drv1 = readBigInt64LE ( data , 72 )
137
+ const drv2 = readBigInt64LE ( data , 80 )
138
+ const drv3 = readBigInt64LE ( data , 88 )
139
+ const drv4 = readBigInt64LE ( data , 96 )
140
+ const drv5 = readBigInt64LE ( data , 104 )
135
141
// product id / reference account
136
142
const productAccountKey = new PublicKey ( data . slice ( 112 , 144 ) )
137
143
// next price account in list
@@ -166,7 +172,14 @@ export const parsePriceData = (data: Buffer) => {
166
172
numComponentPrices,
167
173
currentSlot,
168
174
validSlot,
169
- derived,
175
+ twap,
176
+ avol,
177
+ drv0,
178
+ drv1,
179
+ drv2,
180
+ drv3,
181
+ drv4,
182
+ drv5,
170
183
productAccountKey,
171
184
nextPriceAccountKey,
172
185
aggregatePriceUpdaterAccountKey,
0 commit comments