aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorxianny <xianny@gmail.com>2018-12-08 01:48:26 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-13 01:19:31 +0800
commit5c4a2461b87526994845f590e13650e83c68c504 (patch)
treead9d11a44c8ef53ffae02617dfc4a3994f8dc1b2 /packages
parent183edee4ac8e405425bffb1f4c5d5113222b2809 (diff)
downloaddexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.tar
dexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.tar.gz
dexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.tar.bz2
dexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.tar.lz
dexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.tar.xz
dexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.tar.zst
dexon-sol-tools-5c4a2461b87526994845f590e13650e83c68c504.zip
cleanup: stray import, rename variable
Diffstat (limited to 'packages')
-rw-r--r--packages/pipeline/package.json1
-rw-r--r--packages/pipeline/src/data_sources/ohlcv_external/crypto_compare.ts7
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);