Skip to content

Commit 819c193

Browse files
committed
Merge branch 'htx-dai-remove' into 'main'
fix: remove htx source from usds/usd feed See merge request flarenetwork/ftso/ftso-v2-example-value-provider!33
2 parents 489282e + c12f50a commit 819c193

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

src/data-feeds/ccxt-provider-service.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,24 @@ export class CcxtFeed implements BaseDataFeed {
367367
const market = exchange.markets[source.symbol];
368368
if (market == undefined) continue;
369369
this.logger.log(`Fetching last price for ${market.id} on ${source.exchange}`);
370-
const ticker = await exchange.fetchTicker(market.id);
371-
if (ticker === undefined) {
372-
this.logger.warn(`Ticker not found for ${market.id} on ${source.exchange}`);
373-
continue;
374-
}
375-
if (ticker.last === undefined) {
376-
this.logger.log(`No last price found for ${market.id} on ${source.exchange}`);
377-
continue;
378-
}
370+
try {
371+
const ticker = await exchange.fetchTicker(market.id);
372+
if (ticker === undefined) {
373+
this.logger.warn(`Ticker not found for ${market.id} on ${source.exchange}`);
374+
continue;
375+
}
376+
if (ticker.last === undefined) {
377+
this.logger.log(`No last price found for ${market.id} on ${source.exchange}`);
378+
continue;
379+
}
379380

380-
this.setPrice(source.exchange, ticker.symbol, ticker.last, ticker.timestamp);
381+
this.setPrice(source.exchange, ticker.symbol, ticker.last, ticker.timestamp);
382+
} catch (e) {
383+
const error = asError(e);
384+
this.logger.warn(
385+
`Failed to fetch last price for ${source.symbol} (${market.id}) on ${source.exchange}: ${error.message}`
386+
);
387+
}
381388
}
382389
}
383390

0 commit comments

Comments
 (0)