diff options
author | xianny <xianny@gmail.com> | 2018-12-08 01:48:26 +0800 |
---|---|---|
committer | xianny <xianny@gmail.com> | 2018-12-08 01:48:26 +0800 |
commit | 41f90c697b0870ae3c3727c866241b25545f88ba (patch) | |
tree | 0e41f121054240943dafc6111d73651e172b7a9b /packages/pipeline | |
parent | 7d2b5a28e323bcc2b2f8dde083c0032cb35d3211 (diff) | |
download | dexon-sol-tools-41f90c697b0870ae3c3727c866241b25545f88ba.tar.gz dexon-sol-tools-41f90c697b0870ae3c3727c866241b25545f88ba.tar.zst dexon-sol-tools-41f90c697b0870ae3c3727c866241b25545f88ba.zip |
cleanup: stray import, rename variable
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 5c95344b8..4fde906b8 100644 --- a/packages/pipeline/package.json +++ b/packages/pipeline/package.json @@ -57,7 +57,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); |