Skip to content

Commit

Permalink
ftx parseTrade OTC baseCurrency, quoteCurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jan 14, 2022
1 parent 266ec35 commit 440832f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/ftx.js
Expand Up @@ -990,10 +990,14 @@ module.exports = class ftx extends Exchange {
//
const id = this.safeString (trade, 'id');
const takerOrMaker = this.safeString (trade, 'liquidity');
// added handling for the OTC trades
// a workaround for the OTC trades, they don't have a symbol
const baseId = this.safeString (trade, 'baseCurrency');
const quoteId = this.safeString (trade, 'quoteCurrency');
const marketId = this.safeString (trade, 'market', baseId + '-' + quoteId);
let defaultMarketId = undefined;
if ((baseId !== undefined) && (quoteId !== undefined)) {
defaultMarketId = baseId + '-' + quoteId;
}
const marketId = this.safeString (trade, 'market', defaultMarketId);
market = this.safeMarket (marketId, market);
const symbol = market['symbol'];
const timestamp = this.parse8601 (this.safeString (trade, 'time'));
Expand Down

0 comments on commit 440832f

Please sign in to comment.