diff options
Diffstat (limited to 'packages/pipeline')
-rw-r--r-- | packages/pipeline/package.json | 1 | ||||
-rw-r--r-- | packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/packages/pipeline/package.json b/packages/pipeline/package.json index 4b4d38cd3..06482eaaa 100644 --- a/packages/pipeline/package.json +++ b/packages/pipeline/package.json @@ -63,7 +63,6 @@ "ethereum-types": "^1.0.6", "pg": "^7.5.0", "prettier": "^1.15.3", - "pw-app-sdk": "^0.3.4", "ramda": "^0.25.0", "reflect-metadata": "^0.1.12", "sqlite3": "^4.0.2", 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); |