Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
}
}),
}
// these fields are immutable and should not be updated
delete symbolToData[product.metadata.symbol].metadata.symbol
// this field is immutable and should not be updated
delete symbolToData[product.metadata.symbol].metadata.price_account
})
setExistingSymbols(new Set(Object.keys(symbolToData)))
Expand Down Expand Up @@ -211,8 +210,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
changes[symbol] = { new: {} }
changes[symbol].new = { ...fileDataParsed[symbol] }
changes[symbol].new.metadata = {
...changes[symbol].new.metadata,
symbol,
...changes[symbol].new.metadata,
}
// these fields are generated deterministically and should not be updated
delete changes[symbol].new.address
Expand Down Expand Up @@ -448,6 +447,25 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
.instruction()
)
}

// If maxLatency is set and is not 0, create update maxLatency instruction
if (
newChanges.priceAccounts[0].maxLatency !== undefined &&
newChanges.priceAccounts[0].maxLatency !== 0
) {
instructions.push(
await pythProgramClient.methods
.setMaxLatency(
newChanges.priceAccounts[0].maxLatency,
[0, 0, 0]
)
.accounts({
priceAccount: priceAccountKey,
fundingAccount,
})
.instruction()
)
}
} else if (!newChanges) {
const priceAccount = new PublicKey(prev.priceAccounts[0].address)

Expand Down
Loading