-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeeper.js
More file actions
23 lines (14 loc) · 835 Bytes
/
keeper.js
File metadata and controls
23 lines (14 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as dotenv from 'dotenv'
dotenv.config()
// fetches contract data and stores it, also listens to changes and updates store
// retrieves price data from polling and streaming and saves it to the store
// inits and keeps track of all stores, receives data from the data processes and saves to mongo. stores latest candles
// submits prices and candles to mongo, once per second. candles pushed to mongo for all products and intervals (update many) in one transaction every 1 minute (per clock)
// posts TXs to blockchain: execute, trigger, or liquidate, checked every 2s
// sends data from store to API app as requested
import pollContracts from './oracle/poll-contracts.js'
import streamPrices from './oracle/stream-prices.js'
import submitTXs from './oracle/submit-txs.js'
pollContracts();
streamPrices();
submitTXs();