Skip to content

Commit

Permalink
Merge branch 'ohlcv-index-ftx' of https://github.com/samgermain/ccxt
Browse files Browse the repository at this point in the history
…into ohlcv-index-ftx
  • Loading branch information
samgermain committed Sep 28, 2021
2 parents af056fa + 1f1eb17 commit 0481ecc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/ftx.js
Expand Up @@ -712,15 +712,14 @@ module.exports = class ftx extends Exchange {
request['limit'] = limit;
request['end_time'] = this.sum (request['start_time'], limit * this.parseTimeframe (timeframe));
}
let response = {};
let method = 'publicGetMarketsMarketNameCandles';
if (price === 'index') {
if (symbol in this.markets) {
request['market_name'] = market['baseId'];
}
method = 'publicGetIndexesMarketNameCandles';
}
response = await this[method] (this.extend (request, params));
const response = await this[method] (this.extend (request, params));
//
// {
// "success": true,
Expand Down Expand Up @@ -752,7 +751,7 @@ module.exports = class ftx extends Exchange {

async fetchIndexOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
const request = {
'index': true,
'price': 'index',
};
return await this.fetchOHLCV (symbol, timeframe, since, limit, this.extend (request, params));
}
Expand Down

0 comments on commit 0481ecc

Please sign in to comment.