@@ -155,8 +155,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
155
155
}
156
156
} ) ,
157
157
}
158
- // these fields are immutable and should not be updated
159
- delete symbolToData [ product . metadata . symbol ] . metadata . symbol
158
+ // this field is immutable and should not be updated
160
159
delete symbolToData [ product . metadata . symbol ] . metadata . price_account
161
160
} )
162
161
setExistingSymbols ( new Set ( Object . keys ( symbolToData ) ) )
@@ -211,8 +210,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
211
210
changes [ symbol ] = { new : { } }
212
211
changes [ symbol ] . new = { ...fileDataParsed [ symbol ] }
213
212
changes [ symbol ] . new . metadata = {
214
- ...changes [ symbol ] . new . metadata ,
215
213
symbol,
214
+ ...changes [ symbol ] . new . metadata ,
216
215
}
217
216
// these fields are generated deterministically and should not be updated
218
217
delete changes [ symbol ] . new . address
@@ -448,6 +447,25 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
448
447
. instruction ( )
449
448
)
450
449
}
450
+
451
+ // If maxLatency is set and is not 0, create update maxLatency instruction
452
+ if (
453
+ newChanges . priceAccounts [ 0 ] . maxLatency !== undefined &&
454
+ newChanges . priceAccounts [ 0 ] . maxLatency !== 0
455
+ ) {
456
+ instructions . push (
457
+ await pythProgramClient . methods
458
+ . setMaxLatency (
459
+ newChanges . priceAccounts [ 0 ] . maxLatency ,
460
+ [ 0 , 0 , 0 ]
461
+ )
462
+ . accounts ( {
463
+ priceAccount : priceAccountKey ,
464
+ fundingAccount,
465
+ } )
466
+ . instruction ( )
467
+ )
468
+ }
451
469
} else if ( ! newChanges ) {
452
470
const priceAccount = new PublicKey ( prev . priceAccounts [ 0 ] . address )
453
471
0 commit comments