diff --git a/packages/api/src/dataFeeds.json b/packages/api/src/dataFeeds.json index d76050c4..aa1eb5e5 100644 --- a/packages/api/src/dataFeeds.json +++ b/packages/api/src/dataFeeds.json @@ -6,7 +6,7 @@ "network": "ethereum-mainnet", "name": "btc/usd", "label": "$", - "pollingPeriod": 1500000, + "pollingPeriod": 15000, "color": "#8d5fd3", "blockExplorer": "https://etherscan.io/address/{address}", "deviation": 3.5, @@ -20,7 +20,7 @@ "network": "ethereum-mainnet", "name": "eth/usd", "label": "$", - "pollingPeriod": 1500000, + "pollingPeriod": 15000, "color": "#8d5fd3", "blockExplorer": "https://etherscan.io/address/{address}", "deviation": 3.5, @@ -34,7 +34,7 @@ "network": "ethereum-rinkeby", "name": "btc/usd", "label": "$", - "pollingPeriod": 1500000, + "pollingPeriod": 15000, "color": "#00d4aa", "blockExplorer": "https://rinkeby.etherscan.io/address/{address}", "deviation": 1, @@ -48,7 +48,7 @@ "network": "ethereum-rinkeby", "name": "eth/usd", "label": "$", - "pollingPeriod": 1500000, + "pollingPeriod": 15000, "color": "#00d4aa", "blockExplorer": "https://rinkeby.etherscan.io/address/{address}", "deviation": 1, @@ -62,7 +62,7 @@ "network": "ethereum-goerli", "name": "btc/usd", "label": "$", - "pollingPeriod": 1500000, + "pollingPeriod": 15000, "color": "#ff5599", "blockExplorer": "https://goerli.etherscan.io/address/{address}", "deviation": 1, @@ -76,7 +76,7 @@ "network": "ethereum-goerli", "name": "eth/usd", "label": "$", - "pollingPeriod": 1500000, + "pollingPeriod": 15000, "color": "#ff5599", "blockExplorer": "https://goerli.etherscan.io/address/{address}", "deviation": 1, @@ -86,11 +86,11 @@ { "feedFullName": "conflux-testnet_cfx-usdt_6", "abi": "./src/abi/PriceFeed.json", - "address": "0x81cc73426944cC15BE22a3d7c812282E66F2c689", + "address": "0x8D7933112524bE9c143252456ac85F2a89d73f9D", "network": "conflux-testnet", "name": "cfx/usdt", "label": "₮", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#6600ff", "blockExplorer": "https://testnet.confluxscan.io/address/{address}", "deviation": 1, @@ -104,7 +104,7 @@ "network": "conflux-testnet", "name": "btc/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#6600ff", "blockExplorer": "https://testnet.confluxscan.io/address/{address}", "deviation": 1, @@ -118,7 +118,7 @@ "network": "conflux-testnet", "name": "eth/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#6600ff", "blockExplorer": "https://testnet.confluxscan.io/address/{address}", "deviation": 1, @@ -128,11 +128,11 @@ { "feedFullName": "conflux-mainnet_cfx-usdt_6", "abi": "./src/abi/PriceFeed.json", - "address": "0x86e9A67C92455afa725CC01b2036e47cd4dd9929", + "address": "0x82E6b8E6e98132a39ec96398e68Ee7bfBa0245C2", "network": "conflux-mainnet", "name": "cfx/usdt", "label": "₮", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff0000", "blockExplorer": "https://confluxscan.io/address/{address}", "deviation": 1, @@ -146,7 +146,7 @@ "network": "conflux-mainnet", "name": "btc/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff0000", "blockExplorer": "https://confluxscan.io/address/{address}", "deviation": 1, @@ -160,7 +160,7 @@ "network": "conflux-mainnet", "name": "eth/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff0000", "blockExplorer": "https://confluxscan.io/address/{address}", "deviation": 1, @@ -174,7 +174,7 @@ "network": "celo-alfajores", "name": "btc/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd8d2", "blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}", "deviation": 1, @@ -188,7 +188,7 @@ "network": "celo-alfajores", "name": "eth/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd8d2", "blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}", "deviation": 1, @@ -202,7 +202,7 @@ "network": "celo-alfajores", "name": "celo/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd8d2", "blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}", "deviation": 1, @@ -216,7 +216,7 @@ "network": "celo-alfajores", "name": "celo/eur", "label": "€", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd8d2", "blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}", "deviation": 1, @@ -230,7 +230,7 @@ "network": "celo-mainnet", "name": "btc/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff8100", "blockExplorer": "https://explorer.celo.org/address/{address}", "deviation": 1, @@ -244,7 +244,7 @@ "network": "celo-mainnet", "name": "eth/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff8100", "blockExplorer": "https://explorer.celo.org/address/{address}", "deviation": 1, @@ -258,7 +258,7 @@ "network": "celo-mainnet", "name": "celo/eur", "label": "€", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff8100", "blockExplorer": "https://explorer.celo.org/address/{address}", "deviation": 1, @@ -272,7 +272,7 @@ "network": "celo-mainnet", "name": "celo/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#ff8100", "blockExplorer": "https://explorer.celo.org/address/{address}", "deviation": 1, @@ -286,7 +286,7 @@ "network": "boba-rinkeby", "name": "btc/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd83d", "blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}", "deviation": 1, @@ -300,7 +300,7 @@ "network": "boba-rinkeby", "name": "eth/usd", "label": "$", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd83d", "blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}", "deviation": 1, @@ -314,7 +314,7 @@ "network": "boba-rinkeby", "name": "omg/btc", "label": "₿", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd83d", "blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}", "deviation": 1, @@ -328,7 +328,7 @@ "network": "boba-rinkeby", "name": "omg/eth", "label": "Ξ", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd83d", "blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}", "deviation": 1, @@ -342,7 +342,7 @@ "network": "boba-rinkeby", "name": "omg/usdt", "label": "₮", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd83d", "blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}", "deviation": 1, @@ -356,7 +356,7 @@ "network": "boba-rinkeby", "name": "boba/usdt", "label": "₮", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#1cd83d", "blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}", "deviation": 1, @@ -366,11 +366,11 @@ { "feedFullName": "boba-mainnet_boba-usdt_6", "abi": "./src/abi/PriceFeed.json", - "address": "0x52Bf8Bf503c69A055e3f86BD7D7F6dCb6c1f1E13", + "address": "0x7BC25b36DfeB5102ACAE8f4E7600Dd963D2Eb95C", "network": "boba-mainnet", "name": "boba/usdt", "label": "₮", - "pollingPeriod": 300000, + "pollingPeriod": 3000, "color": "#007dff", "blockExplorer": "https://blockexplorer.boba.network/address/{address}", "deviation": 1, diff --git a/packages/api/src/repository/Feed.ts b/packages/api/src/repository/Feed.ts index 8ae33122..d7713af0 100644 --- a/packages/api/src/repository/Feed.ts +++ b/packages/api/src/repository/Feed.ts @@ -18,6 +18,7 @@ export class FeedRepository { constructor (db: Db, dataFeeds: Array) { this.collection = db.collection('feed') this.dataFeedsFullNames = dataFeeds.map(dataFeed => dataFeed.feedFullName) + this.collection.createIndex({ feedFullName: 1 }) } async getAll (): Promise> { diff --git a/packages/api/src/repository/ResultRequest.ts b/packages/api/src/repository/ResultRequest.ts index c0d9e913..fed58412 100644 --- a/packages/api/src/repository/ResultRequest.ts +++ b/packages/api/src/repository/ResultRequest.ts @@ -13,6 +13,7 @@ export class ResultRequestRepository { constructor (db: Db, _dataFeeds: Array) { this.collection = db.collection('result_request') + this.collection.createIndex({ feedFullName: 1, timestamp: -1 }) } async getFeedRequests ( @@ -44,6 +45,7 @@ export class ResultRequestRepository { page: number, size: number ): Promise> { + console.log('index information', await this.collection.indexInformation()) return ( await this.collection .find({