Skip to content

Commit

Permalink
fix: get ticker data feed id from chain
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Aug 10, 2024
1 parent 0630e8a commit bd57f96
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/services/OracleServiceV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ export default class OracleServiceV3 {
return !!this.#feeds[token.toLowerCase() as Address];
}

// TODO: exposed for hotfix only
public getFeed(token: string): OracleEntry {
return this.#feeds[token.toLowerCase() as Address]!;
}

/**
* Returns false if account has tokens without reserve price feeds for some tokens
* @param ca
Expand Down
8 changes: 7 additions & 1 deletion src/services/RedstoneServiceV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,14 @@ export class RedstoneServiceV3 {
{ ticker },
`will update redstone ticker ${ticker.symbol} for ${symb}`,
);
// TODO:
// HOTFIX: sometimes ticker.dataId in sdk-gov is incorrect, prefer data from chain
const tickerFeedId =
this.oracle.getFeed(ticker.address)?.main?.dataFeedId ??
ticker.dataId;

redstoneUpdates.push({
dataFeedId: ticker.dataId,
dataFeedId: tickerFeedId,
token: ticker.address,
reserve: false, // tickers are always added as main feed
});
Expand Down
2 changes: 1 addition & 1 deletion src/services/scan/ScanServiceV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class ScanServiceV3 extends AbstractScanService {
`filtering liquidatable credit accounts from selection of ${accs.length}...`,
);
// @ts-ignore
const mc = await this.publicClient.multicall({
const mc = await this.client.pub.multicall({
blockNumber,
allowFailure: true,
contracts: accs.map(({ addr, creditManager }) => ({
Expand Down

0 comments on commit bd57f96

Please sign in to comment.