From 3e82bb335665bcc6188418e88fc1ef2b936867ac Mon Sep 17 00:00:00 2001 From: yang-dydx <117109716+yang-dydx@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:29:06 -0700 Subject: [PATCH] Fix `x/prices` exchange config (#664) * add NEAR exchange * fix OKX LDO USDT --- .../client/constants/testdata/ldo_exchange_config.json | 3 ++- .../client/constants/testdata/near_exchange_config.json | 5 +++++ protocol/scripts/genesis/sample_pregenesis.json | 4 ++-- .../exchange_config/testnet_exchange_market_config.go | 7 ++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/protocol/daemons/pricefeed/client/constants/testdata/ldo_exchange_config.json b/protocol/daemons/pricefeed/client/constants/testdata/ldo_exchange_config.json index f50dafec2c..ad19f3820a 100644 --- a/protocol/daemons/pricefeed/client/constants/testdata/ldo_exchange_config.json +++ b/protocol/daemons/pricefeed/client/constants/testdata/ldo_exchange_config.json @@ -25,7 +25,8 @@ }, { "exchangeName": "Okx", - "ticker": "LDO-USDT" + "ticker": "LDO-USDT", + "adjustByMarket": "USDT-USD" } ] } diff --git a/protocol/daemons/pricefeed/client/constants/testdata/near_exchange_config.json b/protocol/daemons/pricefeed/client/constants/testdata/near_exchange_config.json index fda0d9f460..8cc7f8f0a1 100644 --- a/protocol/daemons/pricefeed/client/constants/testdata/near_exchange_config.json +++ b/protocol/daemons/pricefeed/client/constants/testdata/near_exchange_config.json @@ -28,6 +28,11 @@ "exchangeName": "Mexc", "ticker": "NEAR_USDT", "adjustByMarket": "USDT-USD" + }, + { + "exchangeName": "Okx", + "ticker": "NEAR-USDT", + "adjustByMarket": "USDT-USD" } ] } diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 1641e5de5e..55e6f244d6 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -1312,7 +1312,7 @@ "pair": "TRX-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"NEARUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"NEAR-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"NEAR_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"nearusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"NEAR-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Mexc\",\"ticker\":\"NEAR_USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", + "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"NEARUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"NEAR-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"NEAR_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"nearusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"NEAR-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Mexc\",\"ticker\":\"NEAR_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"NEAR-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 16, "min_exchanges": 3, @@ -1392,7 +1392,7 @@ "pair": "BLUR-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"LDOUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"LDO-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"LDOUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"LDO-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Mexc\",\"ticker\":\"LDO_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"LDO-USDT\"}]}", + "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"LDOUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"LDO-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"LDOUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"LDO-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Mexc\",\"ticker\":\"LDO_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"LDO-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 26, "min_exchanges": 3, diff --git a/protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go b/protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go index 1d7998d635..5f5f9425f9 100644 --- a/protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go +++ b/protocol/testutil/daemons/pricefeed/exchange_config/testnet_exchange_market_config.go @@ -804,7 +804,8 @@ var ( AdjustByMarket: newMarketIdWithValue(MARKET_USDT_USD), }, MARKET_LDO_USD: { - Ticker: "LDO-USDT", + Ticker: "LDO-USDT", + AdjustByMarket: newMarketIdWithValue(MARKET_USDT_USD), }, MARKET_USDT_USD: { Ticker: "USDC-USDT", @@ -814,6 +815,10 @@ var ( Ticker: "XLM-USDT", AdjustByMarket: newMarketIdWithValue(MARKET_USDT_USD), }, + MARKET_NEAR_USD: { + Ticker: "NEAR-USDT", + AdjustByMarket: newMarketIdWithValue(MARKET_USDT_USD), + }, }, }, exchange_common.EXCHANGE_ID_MEXC: {