Skip to content

Commit

Permalink
Revert "sb crank: also consider fallback oracles"
Browse files Browse the repository at this point in the history
This reverts commit a3a9d44.
  • Loading branch information
mschneider committed Aug 7, 2024
1 parent 0487c42 commit ea51581
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions ts/client/scripts/sb-on-demand-crank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ async function preparePullIx(
gateway: oracle.gatewayUrl,
};
// TODO use fetchUpdateMany
const [pullIx] = await pullFeed.fetchUpdateIx(conf, recentSlothashes);
const [pullIx] = await pullFeed.fetchUpdateIx(
conf,
recentSlothashes,
);

return pullIx;
}
Expand Down Expand Up @@ -566,22 +569,6 @@ function getOraclesForMangoGroup(
};
});

const oraclesFb = Array.from(group.banksMapByName.values())
.filter(
(b) =>
!(
b[0].nativeDeposits().eq(ZERO_I80F48()) &&
b[0].nativeBorrows().eq(ZERO_I80F48()) &&
b[0].reduceOnly == 1
),
)
.map((b) => {
return {
oraclePk: b[0].fallbackOracle,
name: b[0].name,
};
});

// oracles for perp markets
const oracles2 = Array.from(group.perpMarketsMapByName.values()).map((pM) => {
return {
Expand Down Expand Up @@ -609,7 +596,7 @@ function getOraclesForMangoGroup(
};
})
.filter((item) => !item.oraclePk.equals(PublicKey.default));
const oracles = oracles1.concat(oraclesFb).concat(oracles2).concat(oracles3);
const oracles = oracles1.concat(oracles2).concat(oracles3);
return oracles;
}

Expand Down

0 comments on commit ea51581

Please sign in to comment.