From 462933fe16543ba392745222aeb220db88cfe403 Mon Sep 17 00:00:00 2001 From: yohanelly95 Date: Wed, 2 Aug 2023 10:30:54 +0530 Subject: [PATCH 1/6] chore: contribution guidelines --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f03c154 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,12 @@ + +# Contributing to Razor Network Datasources +If you wish to propose a new price feed to be added to the datasources used by the protocol, please follow the steps below: + +1. Start by forking the repository and creating your branch from master. +2. Add the new job to `jobs.json` and update `collections.json` as needed with the correct jobIDs. +3. Execute the test suite using the command `npm run test`. It's crucial to ensure all tests pass. Additionally, please confirm that your code is properly formatted and aligns with the existing style guide. +4. Issue a pull request (PR) to the upstream master branch. +5. The proposed changes will be available for community discussion and review in GitHub discussions. Community members are welcome to provide feedback and votes on the proposal. + + + From bf30ccaec401a1348c216ac9a216c7a9251b2e08 Mon Sep 17 00:00:00 2001 From: yohanelly95 Date: Wed, 18 Sep 2024 16:55:25 +0530 Subject: [PATCH 2/6] chore: v2 datasources refresh --- mainnet/collections.json | 8 ++--- mainnet/jobs.json | 66 +++++++++++++++++++++++++--------------- testnet/collections.json | 2 +- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/mainnet/collections.json b/mainnet/collections.json index d46dfae..2adc15d 100644 --- a/mainnet/collections.json +++ b/mainnet/collections.json @@ -1,27 +1,27 @@ [ { - "jobIDs": [1, 2, 3, 6, 7, 9, 10], + "jobIDs": [1, 2, 3, 4, 5, 6, 7, 8], "aggregationMethod": 2, "power": 2, "name": "ETHUSD", "tolerance": 500000 }, { - "jobIDs": [11, 12, 13, 14, 15, 16], + "jobIDs": [9, 10, 11, 12, 13, 14, 15], "aggregationMethod": 2, "power": 2, "name": "BTCUSD", "tolerance": 500000 }, { - "jobIDs": [17, 18, 19, 20, 21], + "jobIDs": [16, 17, 18, 19, 20, 21], "aggregationMethod": 2, "power": 5, "name": "USDCUSD", "tolerance": 500000 }, { - "jobIDs": [22, 23, 24, 25], + "jobIDs": [22, 23, 24, 25, 26, 27], "aggregationMethod": 2, "power": 5, "name": "USDTUSD", diff --git a/mainnet/jobs.json b/mainnet/jobs.json index 8db3fa1..90f60bb 100644 --- a/mainnet/jobs.json +++ b/mainnet/jobs.json @@ -23,22 +23,6 @@ "selector": "result.XETHZUSD.c[0]", "url": "https://api.kraken.com/0/public/Ticker?pair=ETHUSD" }, - { - "weight": 1, - "power": 2, - "selectorType": 1, - "name": "ethusd_coingecko", - "selector": "/html/body/div[5]/div[5]/div[1]/div/div[1]/div[3]/div/div[1]/span[1]/span", - "url": "https://www.coingecko.com/en/coins/ethereum" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=ETHBUSD" - }, { "weight": 1, "power": 2, @@ -55,14 +39,6 @@ "selector": "ethereum.usd", "url": "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd" }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_ftx", - "selector": "result.price", - "url": "https://ftx.com/api/markets/ETH/USD" - }, { "weight": 1, "power": 2, @@ -79,6 +55,14 @@ "selector": "[USD]", "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_razor", + "selector": "ETHUSD", + "url": "https://datafeeds.razorscan.io/prices" +}, { "weight": 1, "power": 2, @@ -127,6 +111,14 @@ "selector": "[USD]", "url": "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_razor", + "selector": "BTCUSD", + "url": "https://datafeeds.razorscan.io/prices" +}, { "weight": 1, "power": 5, @@ -167,6 +159,14 @@ "selector": "last", "url": "https://www.bitstamp.net/api/v2/ticker/usdcusd/" }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_razor", + "selector": "USDCUSD", + "url": "https://datafeeds.razorscan.io/prices" +}, { "weight": 1, "power": 5, @@ -198,5 +198,21 @@ "name": "usdtusd_stablecoin_stats", "selector": "USDT.kraken.USDT_USD.price", "url": "https://stablecoinstats.com/api/tickers" - } + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_bitstamp", + "selector": "last", + "url": "https://www.bitstamp.net/api/v2/ticker/usdtusd/" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_razor", + "selector": "USDTUSD", + "url": "https://datafeeds.razorscan.io/prices" +} ] diff --git a/testnet/collections.json b/testnet/collections.json index 66a4564..33515b5 100644 --- a/testnet/collections.json +++ b/testnet/collections.json @@ -42,7 +42,7 @@ "tolerance": 500000 }, { - "jobIDs": [31, 32, 33, 34, 35, 36], + "jobIDs": [31, 32, 34, 35, 36], "aggregationMethod": 2, "power": 4, "name": "MATICUSD", From 70b4f829c96e1079b41af1aecb12ef803e2b03b5 Mon Sep 17 00:00:00 2001 From: yohanelly95 Date: Thu, 19 Sep 2024 12:04:55 +0530 Subject: [PATCH 3/6] chore: v2 staging and mainnet parity --- mainnet/jobs.json | 4 +- testnet/collections.json | 62 +------ testnet/jobs.json | 357 ++++++--------------------------------- 3 files changed, 60 insertions(+), 363 deletions(-) diff --git a/mainnet/jobs.json b/mainnet/jobs.json index 90f60bb..9d224b3 100644 --- a/mainnet/jobs.json +++ b/mainnet/jobs.json @@ -44,8 +44,8 @@ "power": 2, "selectorType": 0, "name": "ethusd_bitfinex", - "selector": "[0]", - "url": "https://api-pub.bitfinex.com/v2/ticker/tETHUSD" + "selector": "last_price", + "url": "https://api.bitfinex.com/v1/pubticker/ethusd" }, { "weight": 1, diff --git a/testnet/collections.json b/testnet/collections.json index 33515b5..1a206e2 100644 --- a/testnet/collections.json +++ b/testnet/collections.json @@ -1,79 +1,31 @@ [ { - "jobIDs": [1, 2, 3, 5, 6, 8, 9, 24], + "jobIDs": [1, 2, 3, 4, 5, 6, 7, 8], "aggregationMethod": 2, "power": 2, - "name": "ethCollectionMedian", + "name": "ETHUSD", "tolerance": 500000 }, { - "jobIDs": [10, 11, 58], - "aggregationMethod": 2, - "power": 8, - "name": "RAZORUSD", - "tolerance": 500000 - }, - { - "jobIDs": [13, 15, 16], - "aggregationMethod": 2, - "power": 2, - "name": "UFTUSD", - "tolerance": 500000 - }, - { - "jobIDs": [18, 19, 20, 21, 23], + "jobIDs": [9, 10, 11, 12, 13, 14, 15], "aggregationMethod": 2, "power": 2, "name": "BTCUSD", "tolerance": 500000 }, { - "jobIDs": [25, 26, 27], + "jobIDs": [16, 17, 18, 19, 20, 21], "aggregationMethod": 2, "power": 5, "name": "USDCUSD", "tolerance": 500000 }, { - "jobIDs": [28, 29, 30], + "jobIDs": [22, 23, 24, 25, 26, 27], "aggregationMethod": 2, "power": 5, "name": "USDTUSD", "tolerance": 500000 - }, - { - "jobIDs": [31, 32, 34, 35, 36], - "aggregationMethod": 2, - "power": 4, - "name": "MATICUSD", - "tolerance": 500000 - }, - { - "jobIDs": [38, 39, 40, 41, 42], - "aggregationMethod": 2, - "power": 4, - "name": "GRTUSD", - "tolerance": 500000 - }, - { - "jobIDs": [44, 45, 46], - "aggregationMethod": 2, - "power": 4, - "name": "ARBUSD", - "tolerance": 500000 - }, - { - "jobIDs": [48, 49, 50, 51], - "aggregationMethod": 2, - "power": 4, - "name": "SOLUSD", - "tolerance": 500000 - }, - { - "jobIDs": [52, 53, 54, 57], - "aggregationMethod": 2, - "power": 6, - "name": "SKALEUSD", - "tolerance": 500000 } - ] \ No newline at end of file + ] + \ No newline at end of file diff --git a/testnet/jobs.json b/testnet/jobs.json index 55560f4..bc12b5d 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -23,22 +23,6 @@ "selector": "result.XETHZUSD.c[0]", "url": "https://api.kraken.com/0/public/Ticker?pair=ETHUSD" }, - { - "weight": 1, - "power": 2, - "selectorType": 1, - "name": "ethusd_coingecko", - "selector": "/html/body/div[5]/div[5]/div[1]/div/div[1]/div[3]/div/div[1]/span[1]/span", - "url": "https://www.coingecko.com/en/coins/ethereum" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=ETHBUSD" - }, { "weight": 1, "power": 2, @@ -60,8 +44,8 @@ "power": 2, "selectorType": 0, "name": "ethusd_bitfinex", - "selector": "[0]", - "url": "https://api-pub.bitfinex.com/v2/ticker/tETHUSD" + "selector": "last_price", + "url": "https://api.bitfinex.com/v1/pubticker/ethusd" }, { "weight": 1, @@ -75,66 +59,10 @@ "weight": 1, "power": 2, "selectorType": 0, - "name": "razorusd_cryptocompare", - "selector": "[USD]", - "url": "https://min-api.cryptocompare.com/data/price?fsym=RAZOR&tsyms=USD" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "razorusd_mexc", - "selector": "data[0][last]", - "url": "https://www.mexc.com/open/api/v2/market/ticker?symbol=RAZOR_USDT" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "razorusd_gateio", - "selector": "[0].last", - "url": "https://api.gateio.ws/api/v4/spot/tickers?currency_pair=RAZOR_USDT" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "uftusd_mexc", - "selector": "data[0][last]", - "url": "https://www.mexc.com/open/api/v2/market/ticker?symbol=UFT_USDT" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "uftusd_gateio", - "selector": "[0].last", - "url": "https://api.gateio.ws/api/v4/spot/tickers?currency_pair=UFT_USDT" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "uftusd_cryptocompare", - "selector": "[USD]", - "url": "https://min-api.cryptocompare.com/data/price?fsym=UFT&tsyms=USD" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "uftusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=UFTBUSD" - }, - { - "weight": 1, - "power": -4, - "selectorType": 0, - "name": "ethusd_postJob", - "selector": "result", - "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6\",\"data\":\"0xf7729d43000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb80000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000\"}],\"id\":5},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hex\"}" - }, + "name": "ethusd_razor", + "selector": "ETHUSD", + "url": "https://datafeeds.razorscan.io/prices" + }, { "weight": 1, "power": 2, @@ -179,17 +107,25 @@ "weight": 1, "power": 2, "selectorType": 0, - "name": "btc_kucoin_common_api", - "selector": "data.BTC", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=ETH,BTC" + "name": "btcusd_cryptocompare", + "selector": "[USD]", + "url": "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" }, { "weight": 1, "power": 2, "selectorType": 0, - "name": "eth_kucoin_common_api", - "selector": "data.ETH", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=ETH,BTC" + "name": "btcusd_razor", + "selector": "BTCUSD", + "url": "https://datafeeds.razorscan.io/prices" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_stablecoin_stats", + "selector": "USDC.kraken.USDC_USD.price", + "url": "https://stablecoinstats.com/api/tickers" }, { "weight": 1, @@ -219,256 +155,65 @@ "weight": 1, "power": 5, "selectorType": 0, - "name": "usdtusd_gemini", + "name": "usdcusd_bitstamp", "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/usdtusd" + "url": "https://www.bitstamp.net/api/v2/ticker/usdcusd/" }, { "weight": 1, "power": 5, "selectorType": 0, - "name": "usdtusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/USDT-USD/spot" - }, + "name": "usdcusd_razor", + "selector": "USDCUSD", + "url": "https://datafeeds.razorscan.io/prices" + }, { "weight": 1, "power": 5, "selectorType": 0, - "name": "usdtusd_kraken", - "selector": "result.USDTZUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=USDTZUSD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_gemini", - "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/maticusd" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_kucoin", - "selector": "data.MATIC", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=MATIC" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_kraken", - "selector": "result.MATICUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=MATICUSD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_binance", - "selector": "price", - "url": "https://api.binance.com/api/v3/avgPrice?symbol=MATICBUSD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/MATIC-USD/spot" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "maticusd_cryptocompare", - "selector": "USD", - "url": "https://min-api.cryptocompare.com/data/price?fsym=MATIC&tsyms=USD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 1, - "name": "maticusd_coinmarjetcap_xhtml", - "selector": "/html/body/div[1]/div[2]/div/div[2]/div/div/div[2]/div[1]/div[2]/span", - "url": "https://coinmarketcap.com/currencies/polygon/" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "grtusd_gemini", + "name": "usdtusd_gemini", "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/grtusd" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "grtusd_kucoin", - "selector": "data.GRT", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=GRT" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "grtusd_kraken", - "selector": "result.GRTUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=GRTUSD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "grtusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/GRT-USD/spot" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "grtusd_cryptocompare", - "selector": "USD", - "url": "https://min-api.cryptocompare.com/data/price?fsym=GRT&tsyms=USD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 1, - "name": "grtusd_blockworks_xhtml", - "selector": "/html/body/div[1]/div/main/div[2]/div[1]/section[2]/div[1]/div/div[1]/div[1]/p", - "url": "https://blockworks.co/price/grt" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "arbusd_kucoin", - "selector": "data.ARB", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=ARB" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "arbusd_kraken", - "selector": "result.ARBUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=ARBUSD" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "arbusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/ARB-USD/spot" - }, - { - "weight": 1, - "power": 4, - "selectorType": 1, - "name": "arb_binance_xhtml", - "selector": "/html/body/div[3]/section/div/div[2]/div[4]/div[1]/div[1]", - "url": "https://www.binance.com/en-IN/price/arbitrum" - }, - { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "solusd_kucoin", - "selector": "data.SOL", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=SOL" + "url": "https://api.gemini.com/v1/pubticker/usdtusd" }, { "weight": 1, - "power": 4, + "power": 5, "selectorType": 0, - "name": "solusd_coinbase", + "name": "usdtusd_coinbase", "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/SOL-USD/spot" + "url": "https://api.coinbase.com/v2/prices/USDT-USD/spot" }, { "weight": 1, - "power": 4, + "power": 5, "selectorType": 0, - "name": "solusd_kraken", - "selector": "result.SOLUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=SOLUSD" + "name": "usdtusd_kraken", + "selector": "result.USDTZUSD.c[0]", + "url": "https://api.kraken.com/0/public/Ticker?pair=USDTZUSD" }, { - "weight": 1, - "power": 4, - "selectorType": 0, - "name": "solusd_gemini", - "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/solusd" + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_stablecoin_stats", + "selector": "USDT.kraken.USDT_USD.price", + "url": "https://stablecoinstats.com/api/tickers" }, { "weight": 1, - "power": 6, + "power": 5, "selectorType": 0, - "name": "sklusd_gemini", + "name": "usdtusd_bitstamp", "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/sklusd" + "url": "https://www.bitstamp.net/api/v2/ticker/usdtusd/" }, { "weight": 1, - "power": 6, - "selectorType": 0, - "name": "sklusd_kucoin", - "selector": "data.SKL", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=SKL" - }, - { - "weight": 1, - "power": 6, - "selectorType": 0, - "name": "sklusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/SKL-USD/spot" - }, - { - "weight": 1, - "power": 6, - "selectorType": 1, - "name": "sklusd_binance_xhtml", - "selector": "/html/body/div[3]/section/div/div[2]/div[4]/div[1]/div[1]", - "url": "https://www.binance.com/en-IN/price/skale-network" - }, - { - "weight": 1, - "power": 6, - "selectorType": 0, - "name": "sklusd_coingecko_api", - "selector": "skale.usd", - "url": "https://api.coingecko.com/api/v3/simple/price?ids=skale&vs_currencies=usd" - }, - { - "weight": 1, - "power": 6, - "selectorType": 0, - "name": "sklusd_cryptocompare", - "selector": "USD", - "url": "https://min-api.cryptocompare.com/data/price?fsym=SKL&tsyms=USD" - }, - { - "weight": 1, - "power": 8, - "selectorType": 0, - "name": "razorusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/RAZOR-USD/spot" - }, - { - "weight": 1, - "power": 8, + "power": 5, "selectorType": 0, - "name": "razorusdp_uniswap_v2", - "selector": "result", - "url": "{\"type\": \"POST\",\"url\": \"https://rpc.ankr.com/eth\",\"body\": {\"jsonrpc\":\"2.0\",\"id\":7269270904970082,\"method\":\"eth_call\",\"params\":[{\"from\":\"0x0000000000000000000000000000000000000000\",\"data\":\"0xd06ca61f0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000050de6856358cc35f3a9a57eaaa34bd4cb707d2cd0000000000000000000000008e870d67f660d95d5be530380d0ec0bd388289e1\",\"to\":\"0x7a250d5630b4cf539739df2c5dacb4c659f2488d\"},\"latest\"]},\"header\": {\"content-type\": \"application/json\"}, \"returnType\": \"hexArray[1]\"}" - } - ] \ No newline at end of file + "name": "usdtusd_razor", + "selector": "USDTUSD", + "url": "https://datafeeds.razorscan.io/prices" + } + ] + \ No newline at end of file From 04e33189922511e16d096b7053669acfac30e8cb Mon Sep 17 00:00:00 2001 From: yohanelly95 Date: Mon, 23 Sep 2024 10:22:25 +0530 Subject: [PATCH 4/6] chore: lint --- mainnet/jobs.json | 434 +++++++++++++++++++-------------------- testnet/collections.json | 58 +++--- testnet/jobs.json | 23 +-- 3 files changed, 257 insertions(+), 258 deletions(-) diff --git a/mainnet/jobs.json b/mainnet/jobs.json index 9d224b3..05ab655 100644 --- a/mainnet/jobs.json +++ b/mainnet/jobs.json @@ -1,218 +1,218 @@ [ - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_gemini", - "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/ethusd" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_kucoin", - "selector": "data.ETH", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=ETH" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_kraken", - "selector": "result.XETHZUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=ETHUSD" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/ETH-USD/spot" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_coingecko_api", - "selector": "ethereum.usd", - "url": "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_bitfinex", - "selector": "last_price", - "url": "https://api.bitfinex.com/v1/pubticker/ethusd" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_cryptocompare", - "selector": "[USD]", - "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "ethusd_razor", - "selector": "ETHUSD", - "url": "https://datafeeds.razorscan.io/prices" -}, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_gemini", - "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/btcusd" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_kucoin", - "selector": "data.BTC", - "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=BTC" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_kraken", - "selector": "result.XXBTZUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=BTCUSD" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/BTC-USD/spot" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_coingecko_api", - "selector": "bitcoin.usd", - "url": "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_cryptocompare", - "selector": "[USD]", - "url": "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" - }, - { - "weight": 1, - "power": 2, - "selectorType": 0, - "name": "btcusd_razor", - "selector": "BTCUSD", - "url": "https://datafeeds.razorscan.io/prices" -}, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdcusd_stablecoin_stats", - "selector": "USDC.kraken.USDC_USD.price", - "url": "https://stablecoinstats.com/api/tickers" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdcusd_gemini", - "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/usdcusd" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdcusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/USDC-USD/spot" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdcusd_kraken", - "selector": "result.USDCUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=USDCUSD" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdcusd_bitstamp", - "selector": "last", - "url": "https://www.bitstamp.net/api/v2/ticker/usdcusd/" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdcusd_razor", - "selector": "USDCUSD", - "url": "https://datafeeds.razorscan.io/prices" -}, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_gemini", - "selector": "last", - "url": "https://api.gemini.com/v1/pubticker/usdtusd" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_coinbase", - "selector": "data.amount", - "url": "https://api.coinbase.com/v2/prices/USDT-USD/spot" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_kraken", - "selector": "result.USDTZUSD.c[0]", - "url": "https://api.kraken.com/0/public/Ticker?pair=USDTZUSD" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_stablecoin_stats", - "selector": "USDT.kraken.USDT_USD.price", - "url": "https://stablecoinstats.com/api/tickers" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_bitstamp", - "selector": "last", - "url": "https://www.bitstamp.net/api/v2/ticker/usdtusd/" - }, - { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_razor", - "selector": "USDTUSD", - "url": "https://datafeeds.razorscan.io/prices" -} -] + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_gemini", + "selector": "last", + "url": "https://api.gemini.com/v1/pubticker/ethusd" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_kucoin", + "selector": "data.ETH", + "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=ETH" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_kraken", + "selector": "result.XETHZUSD.c[0]", + "url": "https://api.kraken.com/0/public/Ticker?pair=ETHUSD" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_coinbase", + "selector": "data.amount", + "url": "https://api.coinbase.com/v2/prices/ETH-USD/spot" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_coingecko_api", + "selector": "ethereum.usd", + "url": "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_bitfinex", + "selector": "last_price", + "url": "https://api.bitfinex.com/v1/pubticker/ethusd" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_cryptocompare", + "selector": "[USD]", + "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "ethusd_razor", + "selector": "ETHUSD", + "url": "https://datafeeds.razorscan.io/prices" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_gemini", + "selector": "last", + "url": "https://api.gemini.com/v1/pubticker/btcusd" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_kucoin", + "selector": "data.BTC", + "url": "https://api.kucoin.com/api/v1/prices?base=USD¤cies=BTC" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_kraken", + "selector": "result.XXBTZUSD.c[0]", + "url": "https://api.kraken.com/0/public/Ticker?pair=BTCUSD" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_coinbase", + "selector": "data.amount", + "url": "https://api.coinbase.com/v2/prices/BTC-USD/spot" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_coingecko_api", + "selector": "bitcoin.usd", + "url": "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_cryptocompare", + "selector": "[USD]", + "url": "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" + }, + { + "weight": 1, + "power": 2, + "selectorType": 0, + "name": "btcusd_razor", + "selector": "BTCUSD", + "url": "https://datafeeds.razorscan.io/prices" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_stablecoin_stats", + "selector": "USDC.kraken.USDC_USD.price", + "url": "https://stablecoinstats.com/api/tickers" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_gemini", + "selector": "last", + "url": "https://api.gemini.com/v1/pubticker/usdcusd" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_coinbase", + "selector": "data.amount", + "url": "https://api.coinbase.com/v2/prices/USDC-USD/spot" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_kraken", + "selector": "result.USDCUSD.c[0]", + "url": "https://api.kraken.com/0/public/Ticker?pair=USDCUSD" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_bitstamp", + "selector": "last", + "url": "https://www.bitstamp.net/api/v2/ticker/usdcusd/" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdcusd_razor", + "selector": "USDCUSD", + "url": "https://datafeeds.razorscan.io/prices" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_gemini", + "selector": "last", + "url": "https://api.gemini.com/v1/pubticker/usdtusd" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_coinbase", + "selector": "data.amount", + "url": "https://api.coinbase.com/v2/prices/USDT-USD/spot" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_kraken", + "selector": "result.USDTZUSD.c[0]", + "url": "https://api.kraken.com/0/public/Ticker?pair=USDTZUSD" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_stablecoin_stats", + "selector": "USDT.kraken.USDT_USD.price", + "url": "https://stablecoinstats.com/api/tickers" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_bitstamp", + "selector": "last", + "url": "https://www.bitstamp.net/api/v2/ticker/usdtusd/" + }, + { + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_razor", + "selector": "USDTUSD", + "url": "https://datafeeds.razorscan.io/prices" + } +] \ No newline at end of file diff --git a/testnet/collections.json b/testnet/collections.json index 1a206e2..13b01a1 100644 --- a/testnet/collections.json +++ b/testnet/collections.json @@ -1,31 +1,31 @@ [ - { - "jobIDs": [1, 2, 3, 4, 5, 6, 7, 8], - "aggregationMethod": 2, - "power": 2, - "name": "ETHUSD", - "tolerance": 500000 - }, - { - "jobIDs": [9, 10, 11, 12, 13, 14, 15], - "aggregationMethod": 2, - "power": 2, - "name": "BTCUSD", - "tolerance": 500000 - }, - { - "jobIDs": [16, 17, 18, 19, 20, 21], - "aggregationMethod": 2, - "power": 5, - "name": "USDCUSD", - "tolerance": 500000 - }, - { - "jobIDs": [22, 23, 24, 25, 26, 27], - "aggregationMethod": 2, - "power": 5, - "name": "USDTUSD", - "tolerance": 500000 - } - ] + { + "jobIDs": [1, 2, 3, 4, 5, 6, 7, 8], + "aggregationMethod": 2, + "power": 2, + "name": "ETHUSD", + "tolerance": 500000 + }, + { + "jobIDs": [9, 10, 11, 12, 13, 14, 15], + "aggregationMethod": 2, + "power": 2, + "name": "BTCUSD", + "tolerance": 500000 + }, + { + "jobIDs": [16, 17, 18, 19, 20, 21], + "aggregationMethod": 2, + "power": 5, + "name": "USDCUSD", + "tolerance": 500000 + }, + { + "jobIDs": [22, 23, 24, 25, 26, 27], + "aggregationMethod": 2, + "power": 5, + "name": "USDTUSD", + "tolerance": 500000 + } +] \ No newline at end of file diff --git a/testnet/jobs.json b/testnet/jobs.json index bc12b5d..05ab655 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -62,7 +62,7 @@ "name": "ethusd_razor", "selector": "ETHUSD", "url": "https://datafeeds.razorscan.io/prices" - }, + }, { "weight": 1, "power": 2, @@ -118,7 +118,7 @@ "name": "btcusd_razor", "selector": "BTCUSD", "url": "https://datafeeds.razorscan.io/prices" - }, + }, { "weight": 1, "power": 5, @@ -166,7 +166,7 @@ "name": "usdcusd_razor", "selector": "USDCUSD", "url": "https://datafeeds.razorscan.io/prices" - }, + }, { "weight": 1, "power": 5, @@ -192,12 +192,12 @@ "url": "https://api.kraken.com/0/public/Ticker?pair=USDTZUSD" }, { - "weight": 1, - "power": 5, - "selectorType": 0, - "name": "usdtusd_stablecoin_stats", - "selector": "USDT.kraken.USDT_USD.price", - "url": "https://stablecoinstats.com/api/tickers" + "weight": 1, + "power": 5, + "selectorType": 0, + "name": "usdtusd_stablecoin_stats", + "selector": "USDT.kraken.USDT_USD.price", + "url": "https://stablecoinstats.com/api/tickers" }, { "weight": 1, @@ -214,6 +214,5 @@ "name": "usdtusd_razor", "selector": "USDTUSD", "url": "https://datafeeds.razorscan.io/prices" - } - ] - \ No newline at end of file + } +] \ No newline at end of file From ddbd6f95d6097ffaa090e7f31498772924e0f8cb Mon Sep 17 00:00:00 2001 From: yohanelly95 Date: Mon, 23 Sep 2024 10:42:44 +0530 Subject: [PATCH 5/6] chore: rate limiting for coingecko, increase sleep --- test/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/index.js b/test/utils/index.js index f75cbc0..666fa1b 100644 --- a/test/utils/index.js +++ b/test/utils/index.js @@ -1,5 +1,5 @@ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); -const SLEEP_TIME = 500; +const SLEEP_TIME = 1000; module.exports = { sleep, SLEEP_TIME }; From 4deef4c92eb1a1e4fd37bea3c412bf5a385520d6 Mon Sep 17 00:00:00 2001 From: yohanelly95 Date: Wed, 25 Sep 2024 15:06:01 +0530 Subject: [PATCH 6/6] fix: cryptocompare selector no array --- mainnet/jobs.json | 4 ++-- testnet/jobs.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mainnet/jobs.json b/mainnet/jobs.json index 05ab655..9cda6b8 100644 --- a/mainnet/jobs.json +++ b/mainnet/jobs.json @@ -52,7 +52,7 @@ "power": 2, "selectorType": 0, "name": "ethusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" }, { @@ -108,7 +108,7 @@ "power": 2, "selectorType": 0, "name": "btcusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" }, { diff --git a/testnet/jobs.json b/testnet/jobs.json index 05ab655..9cda6b8 100644 --- a/testnet/jobs.json +++ b/testnet/jobs.json @@ -52,7 +52,7 @@ "power": 2, "selectorType": 0, "name": "ethusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD" }, { @@ -108,7 +108,7 @@ "power": 2, "selectorType": 0, "name": "btcusd_cryptocompare", - "selector": "[USD]", + "selector": "USD", "url": "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD" }, {