diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-09-18 02:27:38 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 19:01:16 +0800 |
commit | dda44500c52a4b72f6a27fb2384a3f43100a1b26 (patch) | |
tree | 49de937e27a2e0bfbc925493c881f411366df513 /packages/pipeline/src/scrape_prices.ts | |
parent | 7b81bd831fb4b43380ba4bc256d154ab0b5f8fca (diff) | |
download | dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.tar dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.tar.gz dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.tar.bz2 dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.tar.lz dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.tar.xz dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.tar.zst dexon-sol-tools-dda44500c52a4b72f6a27fb2384a3f43100a1b26.zip |
Rebase pipeline branch off development
Diffstat (limited to 'packages/pipeline/src/scrape_prices.ts')
-rw-r--r-- | packages/pipeline/src/scrape_prices.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/pipeline/src/scrape_prices.ts b/packages/pipeline/src/scrape_prices.ts new file mode 100644 index 000000000..c26062fac --- /dev/null +++ b/packages/pipeline/src/scrape_prices.ts @@ -0,0 +1,10 @@ +import { postgresClient } from './postgres.js'; +import { dataFetchingQueries } from './scripts/query_data.js'; +import { scrapeDataScripts } from './scripts/scrape_data.js'; +import { web3, zrx } from './zrx.js'; +const CUR_BLOCK_OFFSET = 20; +postgresClient.query(dataFetchingQueries.get_most_recent_pricing_date, []).then((data: any) => { + const curMaxScrapedDate = new Date(data.rows[0].max); + const curDate = new Date(); + scrapeDataScripts.scrapeAllPricesToDB(curMaxScrapedDate.getTime(), curDate.getTime()); +}); |