Skip to content

Commit

Permalink
fix fallback oracle assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mschneider committed Jun 27, 2024
1 parent 7843aaa commit 6b8b125
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ts/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5312,10 +5312,11 @@ export class MangoClient {
// fixed
if (typeof this.fallbackOracleConfig !== 'string') {
if (this.fixedFallbacks.size === 0) {
const oracles: PublicKey[] = this.fallbackOracleConfig;
const oracles: PublicKey[] = [];
const fallbacks: PublicKey[] = [];
Array.from(group.banksMapByTokenIndex.values()).forEach((b) => {
if (oracles.find((o) => o.toBase58() === b[0].oracle.toBase58())) {
if ((this.fallbackOracleConfig as PublicKey[]).find((o) => o.toBase58() === b[0].oracle.toBase58())) {
oracles.push(b[0].oracle);
fallbacks.push(b[0].fallbackOracle);
}
});
Expand Down

0 comments on commit 6b8b125

Please sign in to comment.