Skip to content

Commit

Permalink
improvement: handle invalid ascendex depth messages gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
thaaddeus committed Aug 5, 2024
1 parent ce40795 commit 5ac74e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mappers/ascendex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export class AscendexBookChangeMapper implements Mapper<'ascendex', BookChange>
}

*map(message: AscendexDepthRealTime | AscendexDepthRealTimeSnapshot, localTimestamp: Date): IterableIterator<BookChange> {
if (!message.symbol || !message.data.bids || !message.data.asks) {
return
}

yield {
type: 'book_change',
symbol: message.symbol,
Expand Down

0 comments on commit 5ac74e2

Please sign in to comment.