Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add heartbeat #104

Merged
merged 12 commits into from
Nov 26, 2021
154 changes: 110 additions & 44 deletions packages/api/src/dataFeeds.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"network": "ethereum-mainnet",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 1500000,
"pollingPeriod": 15000,
"color": "#8d5fd3",
"blockExplorer": "https://etherscan.io/address/{address}"
"blockExplorer": "https://etherscan.io/address/{address}",
"deviation": 2,
"heartbeat": 86400000,
"minTimeToUpdate": 3600000
gabaldon marked this conversation as resolved.
Show resolved Hide resolved
},
{
"feedFullName": "ethereum-mainnet_eth-usd_6",
Expand All @@ -17,9 +20,12 @@
"network": "ethereum-mainnet",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 1500000,
"pollingPeriod": 15000,
"color": "#8d5fd3",
"blockExplorer": "https://etherscan.io/address/{address}"
"blockExplorer": "https://etherscan.io/address/{address}",
"deviation": 2,
"heartbeat": 86400000,
"minTimeToUpdate": 3600000
},
{
"feedFullName": "ethereum-rinkeby_btc-usd_6",
Expand All @@ -28,9 +34,12 @@
"network": "ethereum-rinkeby",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 1500000,
"pollingPeriod": 15000,
"color": "#00d4aa",
"blockExplorer": "https://rinkeby.etherscan.io/address/{address}"
"blockExplorer": "https://rinkeby.etherscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "ethereum-rinkeby_eth-usd_6",
Expand All @@ -39,9 +48,12 @@
"network": "ethereum-rinkeby",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 1500000,
"pollingPeriod": 15000,
"color": "#00d4aa",
"blockExplorer": "https://rinkeby.etherscan.io/address/{address}"
"blockExplorer": "https://rinkeby.etherscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "ethereum-goerli_btc-usd_6",
Expand All @@ -50,9 +62,12 @@
"network": "ethereum-goerli",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 1500000,
"pollingPeriod": 15000,
"color": "#ff5599",
"blockExplorer": "https://goerli.etherscan.io/address/{address}"
"blockExplorer": "https://goerli.etherscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "ethereum-goerli_eth-usd_6",
Expand All @@ -61,9 +76,12 @@
"network": "ethereum-goerli",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 1500000,
"pollingPeriod": 15000,
"color": "#ff5599",
"blockExplorer": "https://goerli.etherscan.io/address/{address}"
"blockExplorer": "https://goerli.etherscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "conflux-testnet_cfx-usdt_6",
Expand All @@ -72,9 +90,12 @@
"network": "conflux-testnet",
"name": "cfx/usdt",
"label": "₮",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://testnet.confluxscan.io/address/{address}"
"blockExplorer": "https://testnet.confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "conflux-testnet_btc-usd_6",
Expand All @@ -83,9 +104,12 @@
"network": "conflux-testnet",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://testnet.confluxscan.io/address/{address}"
"blockExplorer": "https://testnet.confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "conflux-testnet_btc-usd_6",
Expand All @@ -94,9 +118,12 @@
"network": "conflux-testnet",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://testnet.confluxscan.io/address/{address}"
"blockExplorer": "https://testnet.confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "conflux-testnet_eth-usd_6",
Expand All @@ -105,9 +132,12 @@
"network": "conflux-testnet",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://testnet.confluxscan.io/address/{address}"
"blockExplorer": "https://testnet.confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "conflux-mainnet_cfx-usdt_6",
Expand All @@ -116,9 +146,12 @@
"network": "conflux-mainnet",
"name": "cfx/usdt",
"label": "₮",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://confluxscan.io/address/{address}"
"blockExplorer": "https://confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 86400000,
"minTimeToUpdate": 900000
},
{
"feedFullName": "conflux-mainnet_btc-usd_6",
Expand All @@ -127,9 +160,12 @@
"network": "conflux-mainnet",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://confluxscan.io/address/{address}"
"blockExplorer": "https://confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 86400000,
"minTimeToUpdate": 900000
},
{
"feedFullName": "conflux-mainnet_eth-usd_6",
Expand All @@ -138,9 +174,12 @@
"network": "conflux-mainnet",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#6600ff",
"blockExplorer": "https://confluxscan.io/address/{address}"
"blockExplorer": "https://confluxscan.io/address/{address}",
"deviation": 1,
"heartbeat": 86400000,
"minTimeToUpdate": 900000
},
{
"feedFullName": "celo-alfajores_btc-usd_6",
Expand All @@ -149,9 +188,12 @@
"network": "celo-alfajores",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd8d2",
"blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}"
"blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "celo-alfajores_eth-usd_6",
Expand All @@ -160,9 +202,12 @@
"network": "celo-alfajores",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd8d2",
"blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}"
"blockExplorer": "https://alfajores-blockscout.celo-testnet.org/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "celo-alfajores_celo-usd_6",
Expand Down Expand Up @@ -193,9 +238,12 @@
"network": "celo-mainnet",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#ff8100",
"blockExplorer": "https://explorer.celo.org/address/{address}"
"blockExplorer": "https://explorer.celo.org/address/{address}",
"deviation": 1,
"heartbeat": 86400000,
"minTimeToUpdate": 900000
},
{
"feedFullName": "celo-mainnet_eth-usd_6",
Expand All @@ -204,9 +252,12 @@
"network": "celo-mainnet",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#ff8100",
"blockExplorer": "https://explorer.celo.org/address/{address}"
"blockExplorer": "https://explorer.celo.org/address/{address}",
"deviation": 1,
"heartbeat": 86400000,
"minTimeToUpdate": 900000
},
{
"feedFullName": "boba-rinkeby_btc-usd_6",
Expand All @@ -215,9 +266,12 @@
"network": "boba-rinkeby",
"name": "btc/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd83d",
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}"
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "boba-rinkeby_eth-usd_6",
Expand All @@ -226,9 +280,12 @@
"network": "boba-rinkeby",
"name": "eth/usd",
"label": "$",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd83d",
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}"
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "boba-rinkeby_omg-btc_9",
Expand All @@ -237,9 +294,12 @@
"network": "boba-rinkeby",
"name": "omg/btc",
"label": "₿",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd83d",
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}"
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "boba-rinkeby_omg-eth_9",
Expand All @@ -248,9 +308,12 @@
"network": "boba-rinkeby",
"name": "omg/eth",
"label": "ETH",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd83d",
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}"
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
},
{
"feedFullName": "boba-rinkeby_omg-usdt_6",
Expand All @@ -259,8 +322,11 @@
"network": "boba-rinkeby",
"name": "omg/usdt",
"label": "₮",
"pollingPeriod": 300000,
"pollingPeriod": 3000,
"color": "#1cd83d",
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}"
"blockExplorer": "https://blockexplorer.rinkeby.boba.network/address/{address}",
"deviation": 1,
"heartbeat": 3600000,
"minTimeToUpdate": 300000
}
]
5 changes: 4 additions & 1 deletion packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ function validateDataFeeds (dataFeeds: Array<FeedInfoConfig>) {
'name',
'pollingPeriod',
'color',
'blockExplorer'
'blockExplorer',
'deviation',
'heartbeat',
'minTimeToUpdate'
]

dataFeeds.forEach((feedInfoConfig, index) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/api/src/typeDefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const typeDefs = gql`
name: String! @column
network: String! @column
lastResult: String
deviation: String! @column
heartbeat: String! @column
minTimeToUpdate: String! @column
requests(timestamp: Int!): [ResultRequest]!
}

Expand Down
3 changes: 3 additions & 0 deletions packages/api/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export type FeedInfoGeneric<ABI> = {
label: string
color: string
blockExplorer: string
deviation: string
heartbeat: string
minTimeToUpdate: string
}
export type FeedInfo = FeedInfoGeneric<Array<AbiItem>>
export type FeedInfoConfig = FeedInfoGeneric<string>
Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/web3Middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export class Web3Middleware {
name: feedInfo.name,
network: feedInfo.network,
label: feedInfo.label,
blockExplorer: feedInfo.blockExplorer
blockExplorer: feedInfo.blockExplorer,
deviation: feedInfo.deviation,
heartbeat: feedInfo.heartbeat,
minTimeToUpdate: feedInfo.minTimeToUpdate
})
}
return feed
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/apollo/queries/feed.gql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ query feed($feedFullName: String!, $timestamp: Int!) {
lastResult
network
label
deviation
heartbeat
minTimeToUpdate
requests(timestamp: $timestamp) {
feedFullName
result
Expand Down
Loading