aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pipeline/src')
-rw-r--r--packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts b/packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts
index 16f205629..0cfec4ef5 100644
--- a/packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts
+++ b/packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts
@@ -39,12 +39,12 @@ const ONE_SECOND = 1000;
const ONE_HOUR_AGO = new Date().getTime() - ONE_HOUR;
const HTTP_OK_STATUS = 200;
const CRYPTO_COMPARE_VALID_EMPTY_RESPONSE_TYPE = 96;
-const MAX_LIMIT = 2000;
+const MAX_PAGE_SIZE = 2000;
export class CryptoCompareOHLCVSource {
public readonly intervalBetweenRecords = ONE_HOUR;
public readonly default_exchange = 'CCCAGG';
- public readonly interval = ONE_HOUR * MAX_LIMIT; // the hourly API returns data for one interval at a time
+ public readonly interval = this.intervalBetweenRecords * MAX_PAGE_SIZE; // the hourly API returns data for one interval at a time
private readonly _url: string = 'https://min-api.cryptocompare.com/data/histohour?';
// rate-limit for all API calls through this class instance
@@ -56,7 +56,6 @@ export class CryptoCompareOHLCVSource {
reservoirRefreshAmount: 2000,
reservoirRefreshInterval: ONE_MINUTE,
});
- console.log('mintime', Math.ceil(ONE_SECOND / maxReqsPerSecond)); // tslint:disable-line:no-console
}
// gets OHLCV records starting from pair.latest
@@ -65,7 +64,7 @@ export class CryptoCompareOHLCVSource {
e: this.default_exchange,
fsym: pair.fromSymbol,
tsym: pair.toSymbol,
- limit: MAX_LIMIT,
+ limit: MAX_PAGE_SIZE,
toTs: Math.floor((pair.latestSavedTime + this.interval) / ONE_SECOND), // CryptoCompare uses timestamp in seconds. not ms
};
const url = this._url + stringify(params);