From 338f1ce9d6b8eb0c4be396dd33f829fd9f55c19b Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:16:48 -0600 Subject: [PATCH] [TRA-513] Deprecate exchange config json and min exchanges (#2524) --- .../dydxprotocol/prices/market_param.ts | 12 +- proto/dydxprotocol/prices/market_param.proto | 6 +- protocol/app/ante/market_update_test.go | 10 +- .../price_feed_mutable_market_configs_test.go | 28 +--- .../scripts/genesis/sample_pregenesis.json | 70 --------- protocol/testing/e2e/gov/prices_test.go | 76 ++------- protocol/testing/genesis.sh | 144 ------------------ protocol/x/listing/keeper/listing.go | 10 +- protocol/x/listing/keeper/listing_test.go | 2 - protocol/x/prices/keeper/market_param_test.go | 19 --- protocol/x/prices/keeper/market_test.go | 8 - .../msg_server_update_market_param_test.go | 28 ---- .../x/prices/keeper/slinky_adapter_test.go | 8 +- protocol/x/prices/module_test.go | 7 +- protocol/x/prices/types/genesis_test.go | 90 ++++------- protocol/x/prices/types/market_param.go | 14 -- protocol/x/prices/types/market_param.pb.go | 6 +- protocol/x/prices/types/market_param_test.go | 39 +---- .../message_create_oracle_market_test.go | 48 +----- .../types/message_update_market_param_test.go | 23 +-- 20 files changed, 94 insertions(+), 554 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/market_param.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/market_param.ts index 95ed7d6c89..1bd6ccf456 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/market_param.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/market_param.ts @@ -19,7 +19,7 @@ export interface MarketParam { * represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest * price step (in dollars) that can be recorded. * - * Deprecated since v7.1.x. This value is now determined from the marketmap. + * Deprecated since v8.x. This value is now determined from the marketmap. */ /** @deprecated */ @@ -28,6 +28,8 @@ export interface MarketParam { /** * The minimum number of exchanges that should be reporting a live price for * a price update to be considered valid. + * + * Deprecated since v8.x. This value is now determined from the marketmap. */ minExchanges: number; @@ -40,6 +42,8 @@ export interface MarketParam { /** * A string of json that encodes the configuration for resolving the price * of this market on various exchanges. + * + * Deprecated since v8.x. This is now determined from the marketmap. */ exchangeConfigJson: string; @@ -63,7 +67,7 @@ export interface MarketParamSDKType { * represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest * price step (in dollars) that can be recorded. * - * Deprecated since v7.1.x. This value is now determined from the marketmap. + * Deprecated since v8.x. This value is now determined from the marketmap. */ /** @deprecated */ @@ -72,6 +76,8 @@ export interface MarketParamSDKType { /** * The minimum number of exchanges that should be reporting a live price for * a price update to be considered valid. + * + * Deprecated since v8.x. This value is now determined from the marketmap. */ min_exchanges: number; @@ -84,6 +90,8 @@ export interface MarketParamSDKType { /** * A string of json that encodes the configuration for resolving the price * of this market on various exchanges. + * + * Deprecated since v8.x. This is now determined from the marketmap. */ exchange_config_json: string; diff --git a/proto/dydxprotocol/prices/market_param.proto b/proto/dydxprotocol/prices/market_param.proto index 4b90b2877b..bed51a5ca1 100644 --- a/proto/dydxprotocol/prices/market_param.proto +++ b/proto/dydxprotocol/prices/market_param.proto @@ -19,11 +19,13 @@ message MarketParam { // represents ``$10,000`. Therefore `10 ^ Exponent` represents the smallest // price step (in dollars) that can be recorded. // - // Deprecated since v7.1.x. This value is now determined from the marketmap. + // Deprecated since v8.x. This value is now determined from the marketmap. sint32 exponent = 3 [ deprecated = true ]; // The minimum number of exchanges that should be reporting a live price for // a price update to be considered valid. + // + // Deprecated since v8.x. This value is now determined from the marketmap. uint32 min_exchanges = 4; // The minimum allowable change in `price` value that would cause a price @@ -32,5 +34,7 @@ message MarketParam { // A string of json that encodes the configuration for resolving the price // of this market on various exchanges. + // + // Deprecated since v8.x. This is now determined from the marketmap. string exchange_config_json = 6; } diff --git a/protocol/app/ante/market_update_test.go b/protocol/app/ante/market_update_test.go index 28a03ab7b1..d8e804e11f 100644 --- a/protocol/app/ante/market_update_test.go +++ b/protocol/app/ante/market_update_test.go @@ -265,12 +265,10 @@ var ( } testMarketParams = prices_types.MarketParam{ - Id: 0, - Pair: "TESTING-USD", - Exponent: -8, - MinExchanges: 1, - MinPriceChangePpm: 10, - ExchangeConfigJson: `{"test_config_placeholder":{}}`, + Id: 0, + Pair: "TESTING-USD", + Exponent: -8, + MinPriceChangePpm: 10, } ) diff --git a/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go b/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go index 7c92227bb1..bf94c82363 100644 --- a/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go +++ b/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go @@ -3,9 +3,10 @@ package types_test import ( "errors" "fmt" - "github.com/dydxprotocol/v4-chain/protocol/testutil/daemons/pricefeed" "testing" + "github.com/dydxprotocol/v4-chain/protocol/testutil/daemons/pricefeed" + "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/types" "github.com/dydxprotocol/v4-chain/protocol/mocks" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" @@ -199,31 +200,6 @@ func TestValidateAndTransformParams_Mixed(t *testing.T) { expectedMutableMarketConfigs: testEmptyMarketConfigs, expectedMutableExchangeConfigs: testEmptyExchangeMarketConfigs, }, - "Invalid: invalid exchangeConfigJson (empty, fails marketParams.Validate)": { - marketParams: []prices_types.MarketParam{{ - Id: 1, - Exponent: -2, - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: "", - }}, - expectedMarketParamErrors: map[types.MarketId]error{ - 1: errors.New("ExchangeConfigJson string is not valid"), - }, - expectedMutableMarketConfigs: testEmptyMarketConfigs, - expectedMutableExchangeConfigs: testEmptyExchangeMarketConfigs, - }, - "Invalid: invalid exchangeConfigJson (not json, fails marketParams.Validate)": { - marketParams: []prices_types.MarketParam{ - validMarketParamWithExchangeConfig("invalid"), - }, - expectedMarketParamErrors: map[types.MarketId]error{ - 1: errors.New("ExchangeConfigJson string is not valid"), - }, - expectedMutableMarketConfigs: testEmptyMarketConfigs, - expectedMutableExchangeConfigs: testEmptyExchangeMarketConfigs, - }, "Invalid: invalid exchangeConfigJson (does not conform to schema)": { marketParams: []prices_types.MarketParam{ validMarketParamWithExchangeConfig(`{"exchanges":"invalid"}`), diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index ec979c03d6..d8f14dd9ea 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -3396,282 +3396,212 @@ "prices": { "market_params": [ { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"BTCUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"BTCUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BTC-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"btcusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXBTZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"BTC-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BTC-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -5, "id": 0, - "min_exchanges": 3, "min_price_change_ppm": 1000, "pair": "BTC-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"ETHUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ETHUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ETH-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"ethusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XETHZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"ETH-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ETH-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -6, "id": 1, - "min_exchanges": 3, "min_price_change_ppm": 1000, "pair": "ETH-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"LINKUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"LINKUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"LINK-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"LINKUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"LINK-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"LINK-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 2, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "LINK-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"POLUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"POLUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"POL-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"POL_USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"POL-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 3, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "POL-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"CRVUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"CRV-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"CRV_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"CRVUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"CRV-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"CRV-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 4, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "CRV-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"SOLUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"SOLUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"SOL-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"solusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"SOLUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"SOL-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"SOL-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -8, "id": 5, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "SOL-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"ADAUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ADAUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ADA-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"ADA_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"adausdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"ADAUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"ADA-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ADA-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 6, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "ADA-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"AVAXUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"AVAXUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"AVAX-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"AVAX_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"avaxusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"AVAXUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"AVAX-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"AVAX-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -8, "id": 7, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "AVAX-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"FILUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"FIL-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"FIL_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"filusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"FILUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"FIL-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 8, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "FIL-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"LTCUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"LTCUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"LTC-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"ltcusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XLTCZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"LTC-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"LTC-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -8, "id": 9, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "LTC-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"DOGEUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"DOGEUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"DOGE-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"DOGE_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"dogeusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XDGUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"DOGE-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"DOGE-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -11, "id": 10, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "DOGE-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"ATOMUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ATOMUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ATOM-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"ATOM_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"ATOMUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"ATOM-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ATOM-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 11, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "ATOM-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"DOTUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"DOTUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"DOT-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"DOT_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"DOTUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"DOT-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"DOT-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 12, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "DOT-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"UNIUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"UNIUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"UNI-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"UNI_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"UNIUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"UNI-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"UNI-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 13, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "UNI-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"BCHUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"BCHUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BCH-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"BCH_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"bchusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"BCHUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"BCH-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BCH-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -7, "id": 14, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "BCH-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"TRXUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"TRXUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"TRX_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"trxusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"TRXUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"TRX-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"TRX-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -11, "id": 15, - "min_exchanges": 3, "min_price_change_ppm": 2500, "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\":\"Okx\",\"ticker\":\"NEAR-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 16, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "NEAR-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"MKRUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"MKR-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"MKRUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"MKR-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"MKR-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -6, "id": 17, - "min_exchanges": 3, "min_price_change_ppm": 4000, "pair": "MKR-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"XLMUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"XLMUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"XLM-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXLMZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"XLM-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"XLM-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 18, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "XLM-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"ETCUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ETC-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"ETC_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"etcusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"ETC-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ETC-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -8, "id": 19, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "ETC-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"COMPUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"COMP-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"COMP_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"COMPUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"COMP-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -8, "id": 20, - "min_exchanges": 3, "min_price_change_ppm": 4000, "pair": "COMP-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"WLDUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"WLDUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"WLD_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"wldusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"WLD-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"WLD-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 21, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "WLD-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"APEUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"APE-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"APE_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"APEUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"APE-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"APE-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 22, - "min_exchanges": 3, "min_price_change_ppm": 4000, "pair": "APE-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"APTUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"APTUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"APT-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"APT_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"aptusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"APT-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"APT-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 23, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "APT-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"ARBUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ARBUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ARB-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"ARB_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"arbusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"ARB-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ARB-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 24, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "ARB-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BLUR-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"BLUR_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"BLURUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"BLUR-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BLUR-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 25, - "min_exchanges": 3, "min_price_change_ppm": 4000, "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\":\"Okx\",\"ticker\":\"LDO-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 26, - "min_exchanges": 3, "min_price_change_ppm": 4000, "pair": "LDO-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"OPUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"OP-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"OP_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"OP-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"OP-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 27, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "OP-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"PEPEUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"PEPEUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"PEPE_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"PEPEUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"PEPE-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"PEPE-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -16, "id": 28, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "PEPE-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"SEIUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"SEIUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"SEI-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"SEI_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"seiusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"SEI-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 29, - "min_exchanges": 3, "min_price_change_ppm": 4000, "pair": "SEI-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"SHIBUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"SHIBUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"SHIB-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"SHIB_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"SHIBUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"SHIB-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"SHIB-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -15, "id": 30, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "SHIB-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"SUIUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"SUIUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"SUI-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"SUI_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"suiusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"SUI-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"SUI-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 31, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "SUI-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"XRPUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"XRPUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"XRP-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"XRP_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"xrpusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXRPZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"XRP-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"XRP-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -10, "id": 32, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "XRP-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"USDCUSDT\",\"invert\":true},{\"exchangeName\":\"Bybit\",\"ticker\":\"USDCUSDT\",\"invert\":true},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"ethusdt\",\"adjustByMarket\":\"ETH-USD\",\"invert\":true},{\"exchangeName\":\"Kraken\",\"ticker\":\"USDTZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"BTC-USDT\",\"adjustByMarket\":\"BTC-USD\",\"invert\":true},{\"exchangeName\":\"Okx\",\"ticker\":\"USDC-USDT\",\"invert\":true}]}", "exponent": -9, "id": 1000000, - "min_exchanges": 3, "min_price_change_ppm": 1000, "pair": "USDT-USD" }, { - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"DYDXUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"DYDXUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"DYDX_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"DYDX-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"DYDX-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}", "exponent": -9, "id": 1000001, - "min_exchanges": 3, "min_price_change_ppm": 2500, "pair": "DYDX-USD" } diff --git a/protocol/testing/e2e/gov/prices_test.go b/protocol/testing/e2e/gov/prices_test.go index e1e220e358..debede63c3 100644 --- a/protocol/testing/e2e/gov/prices_test.go +++ b/protocol/testing/e2e/gov/prices_test.go @@ -20,21 +20,15 @@ import ( var ( GENESIS_MARKET_PARAM = pricestypes.MarketParam{ - Id: 0, - Pair: "btc-adv4tnt", - Exponent: -8, - MinExchanges: 2, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: "{}", + Id: 0, + Pair: "btc-adv4tnt", + MinPriceChangePpm: 1_000, } MODIFIED_MARKET_PARAM = pricestypes.MarketParam{ - Id: GENESIS_MARKET_PARAM.Id, - Pair: GENESIS_MARKET_PARAM.Pair, - Exponent: GENESIS_MARKET_PARAM.Exponent, // exponent cannot be updated - MinExchanges: 3, - MinPriceChangePpm: 2_002, - ExchangeConfigJson: `{"exchanges":[{"exchangeName":"Bitfinex","ticker":"tBTCUSD"}]}`, + Id: GENESIS_MARKET_PARAM.Id, + Pair: GENESIS_MARKET_PARAM.Pair, + MinPriceChangePpm: 2_002, } ) @@ -57,12 +51,9 @@ func TestUpdateMarketParam(t *testing.T) { msg: &pricestypes.MsgUpdateMarketParam{ Authority: lib.GovModuleAddress.String(), MarketParam: pricestypes.MarketParam{ - Id: MODIFIED_MARKET_PARAM.Id + 1, // id does not exist - Pair: MODIFIED_MARKET_PARAM.Pair, - Exponent: MODIFIED_MARKET_PARAM.Exponent, - MinExchanges: MODIFIED_MARKET_PARAM.MinExchanges, - MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, - ExchangeConfigJson: MODIFIED_MARKET_PARAM.ExchangeConfigJson, + Id: MODIFIED_MARKET_PARAM.Id + 1, // id does not exist + Pair: MODIFIED_MARKET_PARAM.Pair, + MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, }, }, expectedProposalStatus: govtypesv1.ProposalStatus_PROPOSAL_STATUS_FAILED, @@ -71,12 +62,9 @@ func TestUpdateMarketParam(t *testing.T) { msg: &pricestypes.MsgUpdateMarketParam{ Authority: lib.GovModuleAddress.String(), MarketParam: pricestypes.MarketParam{ - Id: MODIFIED_MARKET_PARAM.Id, - Pair: "nonexistent-pair", - Exponent: MODIFIED_MARKET_PARAM.Exponent, - MinExchanges: MODIFIED_MARKET_PARAM.MinExchanges, - MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, - ExchangeConfigJson: MODIFIED_MARKET_PARAM.ExchangeConfigJson, + Id: MODIFIED_MARKET_PARAM.Id, + Pair: "nonexistent-pair", + MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, }, }, expectedProposalStatus: govtypesv1.ProposalStatus_PROPOSAL_STATUS_FAILED, @@ -85,40 +73,9 @@ func TestUpdateMarketParam(t *testing.T) { msg: &pricestypes.MsgUpdateMarketParam{ Authority: lib.GovModuleAddress.String(), MarketParam: pricestypes.MarketParam{ - Id: MODIFIED_MARKET_PARAM.Id, - Pair: "", // invalid - Exponent: MODIFIED_MARKET_PARAM.Exponent, - MinExchanges: MODIFIED_MARKET_PARAM.MinExchanges, - MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, - ExchangeConfigJson: MODIFIED_MARKET_PARAM.ExchangeConfigJson, - }, - }, - expectCheckTxFails: true, - }, - "Failure: min exchanges is 0": { - msg: &pricestypes.MsgUpdateMarketParam{ - Authority: lib.GovModuleAddress.String(), - MarketParam: pricestypes.MarketParam{ - Id: MODIFIED_MARKET_PARAM.Id, - Pair: MODIFIED_MARKET_PARAM.Pair, - Exponent: MODIFIED_MARKET_PARAM.Exponent, - MinExchanges: 0, // invalid - MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, - ExchangeConfigJson: MODIFIED_MARKET_PARAM.ExchangeConfigJson, - }, - }, - expectCheckTxFails: true, - }, - "Failure: malformed exchange config json": { - msg: &pricestypes.MsgUpdateMarketParam{ - Authority: lib.GovModuleAddress.String(), - MarketParam: pricestypes.MarketParam{ - Id: MODIFIED_MARKET_PARAM.Id, - Pair: MODIFIED_MARKET_PARAM.Pair, - Exponent: MODIFIED_MARKET_PARAM.Exponent, - MinExchanges: MODIFIED_MARKET_PARAM.MinExchanges, - MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, - ExchangeConfigJson: `{{"exchanges":[{"exchangeName":"Bitfinex","ticker":"tBTCUSD"}]}`, // invalid + Id: MODIFIED_MARKET_PARAM.Id, + Pair: "", // invalid + MinPriceChangePpm: MODIFIED_MARKET_PARAM.MinPriceChangePpm, }, }, expectCheckTxFails: true, @@ -177,10 +134,7 @@ func TestUpdateMarketParam(t *testing.T) { marketParamPrice := pricestest.GenerateMarketParamPrice( pricestest.WithId(GENESIS_MARKET_PARAM.Id), pricestest.WithPair(GENESIS_MARKET_PARAM.Pair), - pricestest.WithExponent(GENESIS_MARKET_PARAM.Exponent), - pricestest.WithMinExchanges(GENESIS_MARKET_PARAM.MinExchanges), pricestest.WithMinPriceChangePpm(GENESIS_MARKET_PARAM.MinPriceChangePpm), - pricestest.WithExchangeConfigJson(GENESIS_MARKET_PARAM.ExchangeConfigJson), ) genesisState.MarketParams = []pricestypes.MarketParam{marketParamPrice.Param} genesisState.MarketPrices = []pricestypes.MarketPrice{marketParamPrice.Price} diff --git a/protocol/testing/genesis.sh b/protocol/testing/genesis.sh index fbe658ac42..004f9aee5a 100755 --- a/protocol/testing/genesis.sh +++ b/protocol/testing/genesis.sh @@ -1279,525 +1279,385 @@ function edit_genesis() { dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[0].pair' -v 'BTC-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[0].id' -v '0' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[0].exponent' -v '-5' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[0].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[0].min_price_change_ppm' -v '1000' # 0.1% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[0].id' -v '0' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[0].exponent' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[0].price' -v '2868819524' # $28,688 = 1 BTC. - # BTC Exchange Config - btc_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/btc_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[0].exchange_config_json' -v "$btc_exchange_config_json" # Market: ETH-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[1].pair' -v 'ETH-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[1].id' -v '1' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[1].exponent' -v '-6' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[1].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[1].min_price_change_ppm' -v '1000' # 0.1% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[1].id' -v '1' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[1].exponent' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[1].price' -v '1811985252' # $1,812 = 1 ETH. - # ETH Exchange Config - eth_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/eth_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[1].exchange_config_json' -v "$eth_exchange_config_json" # Market: LINK-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[2].pair' -v 'LINK-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[2].id' -v '2' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[2].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[2].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[2].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[2].id' -v '2' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[2].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[2].price' -v '7204646989' # $7.205 = 1 LINK. - # LINK Exchange Config - link_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/link_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[2].exchange_config_json' -v "$link_exchange_config_json" # Market: POL-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[3].pair' -v 'POL-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[3].id' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[3].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[3].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[3].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[3].id' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[3].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[3].price' -v '3703925550' # $0.370 = 1 POL. - # POL Exchange Config - pol_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/pol_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[3].exchange_config_json' -v "$pol_exchange_config_json" # Market: CRV-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[4].pair' -v 'CRV-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[4].id' -v '4' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[4].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[4].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[4].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[4].id' -v '4' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[4].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[4].price' -v '6029316660' # $0.6029 = 1 CRV. - # CRV Exchange Config - crv_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/crv_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[4].exchange_config_json' -v "$crv_exchange_config_json" # Market: SOL-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[5].pair' -v 'SOL-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[5].id' -v '5' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[5].exponent' -v '-8' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[5].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[5].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[5].id' -v '5' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[5].exponent' -v '-8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[5].price' -v '2350695125' # $23.51 = 1 SOL. - # SOL Exchange Config - sol_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/sol_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[5].exchange_config_json' -v "$sol_exchange_config_json" # Market: ADA-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[6].pair' -v 'ADA-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[6].id' -v '6' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[6].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[6].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[6].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[6].id' -v '6' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[6].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[6].price' -v '2918831290' # $0.2919 = 1 ADA. - # ADA Exchange Config - ada_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/ada_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[6].exchange_config_json' -v "$ada_exchange_config_json" # Market: AVAX-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[7].pair' -v 'AVAX-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[7].id' -v '7' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[7].exponent' -v '-8' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[7].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[7].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[7].id' -v '7' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[7].exponent' -v '-8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[7].price' -v '1223293720' # $12.23 = 1 AVAX. - # AVAX Exchange Config - avax_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/avax_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[7].exchange_config_json' -v "$avax_exchange_config_json" # Market: FIL-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[8].pair' -v 'FIL-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[8].id' -v '8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[8].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[8].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[8].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[8].id' -v '8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[8].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[8].price' -v '4050336602' # $4.050 = 1 FIL. - # FIL Exchange Config - fil_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/fil_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[8].exchange_config_json' -v "$fil_exchange_config_json" # Market: LTC-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[9].pair' -v 'LTC-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[9].id' -v '9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[9].exponent' -v '-8' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[9].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[9].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[9].id' -v '9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[9].exponent' -v '-8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[9].price' -v '8193604950' # $81.93 = 1 LTC. - # LTC Exchange Config - ltc_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/ltc_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[9].exchange_config_json' -v "$ltc_exchange_config_json" # Market: DOGE-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[10].pair' -v 'DOGE-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[10].id' -v '10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[10].exponent' -v '-11' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[10].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[10].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[10].id' -v '10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[10].exponent' -v '-11' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[10].price' -v '7320836895' # $0.07321 = 1 DOGE. - # DOGE Exchange Config - doge_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/doge_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[10].exchange_config_json' -v "$doge_exchange_config_json" # Market: ATOM-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[11].pair' -v 'ATOM-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[11].id' -v '11' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[11].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[11].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[11].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[11].id' -v '11' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[11].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[11].price' -v '8433494428' # $8.433 = 1 ATOM. - # ATOM Exchange Config - atom_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/atom_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[11].exchange_config_json' -v "$atom_exchange_config_json" # Market: DOT-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[12].pair' -v 'DOT-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[12].id' -v '12' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[12].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[12].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[12].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[12].id' -v '12' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[12].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[12].price' -v '4937186533' # $4.937 = 1 DOT. - # DOT Exchange Config - dot_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/dot_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[12].exchange_config_json' -v "$dot_exchange_config_json" # Market: UNI-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[13].pair' -v 'UNI-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[13].id' -v '13' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[13].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[13].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[13].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[13].id' -v '13' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[13].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[13].price' -v '5852293356' # $5.852 = 1 UNI. - # UNI Exchange Config - uni_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/uni_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[13].exchange_config_json' -v "$uni_exchange_config_json" # Market: BCH-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[14].pair' -v 'BCH-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[14].id' -v '14' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[14].exponent' -v '-7' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[14].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[14].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[14].id' -v '14' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[14].exponent' -v '-7' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[14].price' -v '2255676327' # $225.6 = 1 BCH. - # BCH Exchange Config - bch_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/bch_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[14].exchange_config_json' -v "$bch_exchange_config_json" # Market: TRX-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[15].pair' -v 'TRX-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[15].id' -v '15' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[15].exponent' -v '-11' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[15].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[15].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[15].id' -v '15' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[15].exponent' -v '-11' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[15].price' -v '7795369902' # $0.07795 = 1 TRX. - # TRX Exchange Config - trx_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/trx_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[15].exchange_config_json' -v "$trx_exchange_config_json" # Market: NEAR-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[16].pair' -v 'NEAR-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[16].id' -v '16' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[16].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[16].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[16].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[16].id' -v '16' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[16].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[16].price' -v '1312325536' # $1.312 = 1 NEAR. - # NEAR Exchange Config - near_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/near_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[16].exchange_config_json' -v "$near_exchange_config_json" # Market: MKR-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[17].pair' -v 'MKR-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[17].id' -v '17' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[17].exponent' -v '-6' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[17].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[17].min_price_change_ppm' -v '4000' # 0.4% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[17].id' -v '17' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[17].exponent' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[17].price' -v '1199517382' # $1,200 = 1 MKR. - # MKR Exchange Config - mkr_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/mkr_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[17].exchange_config_json' -v "$mkr_exchange_config_json" # Market: XLM-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[18].pair' -v 'XLM-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[18].id' -v '18' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[18].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[18].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[18].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[18].id' -v '18' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[18].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[18].price' -v '1398578933' # $0.1399 = 1 XLM. - # XLM Exchange Config - xlm_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/xlm_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[18].exchange_config_json' -v "$xlm_exchange_config_json" # Market: ETC-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[19].pair' -v 'ETC-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[19].id' -v '19' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[19].exponent' -v '-8' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[19].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[19].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[19].id' -v '19' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[19].exponent' -v '-8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[19].price' -v '1741060746' # $17.41 = 1 ETC. - # ETC Exchange Config - etc_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/etc_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[19].exchange_config_json' -v "$etc_exchange_config_json" # Market: COMP-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[20].pair' -v 'COMP-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[20].id' -v '20' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[20].exponent' -v '-8' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[20].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[20].min_price_change_ppm' -v '4000' # 0.4% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[20].id' -v '20' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[20].exponent' -v '-8' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[20].price' -v '5717635307' # $57.18 = 1 COMP. - # COMP Exchange Config - comp_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/comp_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[20].exchange_config_json' -v "$comp_exchange_config_json" # Market: WLD-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[21].pair' -v 'WLD-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[21].id' -v '21' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[21].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[21].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[21].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[21].id' -v '21' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[21].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[21].price' -v '1943019371' # $1.943 = 1 WLD. - # WLD Exchange Config - wld_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/wld_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[21].exchange_config_json' -v "$wld_exchange_config_json" # Market: APE-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[22].pair' -v 'APE-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[22].id' -v '22' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[22].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[22].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[22].min_price_change_ppm' -v '4000' # 0.4% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[22].id' -v '22' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[22].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[22].price' -v '1842365656' # $1.842 = 1 APE. - # APE Exchange Config - ape_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/ape_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[22].exchange_config_json' -v "$ape_exchange_config_json" # Market: APT-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[23].pair' -v 'APT-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[23].id' -v '23' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[23].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[23].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[23].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[23].id' -v '23' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[23].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[23].price' -v '6787621897' # $6.788 = 1 APT. - # APT Exchange Config - apt_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/apt_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[23].exchange_config_json' -v "$apt_exchange_config_json" # Market: ARB-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[24].pair' -v 'ARB-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[24].id' -v '24' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[24].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[24].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[24].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[24].id' -v '24' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[24].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[24].price' -v '1127629325' # $1.128 = 1 ARB. - # ARB Exchange Config - arb_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/arb_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[24].exchange_config_json' -v "$arb_exchange_config_json" # Market: BLUR-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[25].pair' -v 'BLUR-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[25].id' -v '25' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[25].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[25].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[25].min_price_change_ppm' -v '4000' # 0.4% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[25].id' -v '25' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[25].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[25].price' -v '2779565892' # $.2780 = 1 BLUR. - # BLUR Exchange Config - blur_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/blur_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[25].exchange_config_json' -v "$blur_exchange_config_json" # Market: LDO-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[26].pair' -v 'LDO-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[26].id' -v '26' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[26].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[26].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[26].min_price_change_ppm' -v '4000' # 0.4% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[26].id' -v '26' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[26].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[26].price' -v '1855061997' # $1.855 = 1 LDO. - # LDO Exchange Config - ldo_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/ldo_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[26].exchange_config_json' -v "$ldo_exchange_config_json" # Market: OP-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[27].pair' -v 'OP-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[27].id' -v '27' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[27].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[27].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[27].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[27].id' -v '27' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[27].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[27].price' -v '1562218603' # $1.562 = 1 OP. - # OP Exchange Config - op_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/op_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[27].exchange_config_json' -v "$op_exchange_config_json" # Market: PEPE-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[28].pair' -v 'PEPE-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[28].id' -v '28' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[28].exponent' -v '-16' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[28].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[28].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[28].id' -v '28' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[28].exponent' -v '-16' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[28].price' -v '2481900353' # $.000000248190035 = 1 PEPE. - # PEPE Exchange Config - pepe_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/pepe_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[28].exchange_config_json' -v "$pepe_exchange_config_json" # Market: SEI-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[29].pair' -v 'SEI-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[29].id' -v '29' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[29].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[29].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[29].min_price_change_ppm' -v '4000' # 0.4% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[29].id' -v '29' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[29].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[29].price' -v '1686998025' # $.1687 = 1 SEI. - # SEI Exchange Config - sei_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/sei_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[29].exchange_config_json' -v "$sei_exchange_config_json" # Market: SHIB-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[30].pair' -v 'SHIB-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[30].id' -v '30' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[30].exponent' -v '-15' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[30].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[30].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[30].id' -v '30' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[30].exponent' -v '-15' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[30].price' -v '8895882688' # $.000008896 = 1 SHIB. - # SHIB Exchange Config - shib_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/shib_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[30].exchange_config_json' -v "$shib_exchange_config_json" # Market: SUI-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[31].pair' -v 'SUI-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[31].id' -v '31' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[31].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[31].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[31].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[31].id' -v '31' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[31].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[31].price' -v '5896318772' # $.5896 = 1 SUI. - # SUI Exchange Config - sui_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/sui_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[31].exchange_config_json' -v "$sui_exchange_config_json" # Market: XRP-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[32].pair' -v 'XRP-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[32].id' -v '32' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[32].exponent' -v '-10' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[32].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[32].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[32].id' -v '32' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[32].exponent' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[32].price' -v '6327613800' # $.6328 = 1 XRP. - # XRP Exchange Config - xrp_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/xrp_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[32].exchange_config_json' -v "$xrp_exchange_config_json" # Market: USDT-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[33].pair' -v 'USDT-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[33].id' -v '1000000' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[33].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[33].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[33].min_price_change_ppm' -v '1000' # 0.100% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[33].id' -v '1000000' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[33].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[33].price' -v '1000000000' # $1 = 1 USDT. - # USDT Exchange Config - usdt_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/usdt_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[33].exchange_config_json' -v "$usdt_exchange_config_json" # Market: DYDX-USD dasel put -t json -f "$GENESIS" '.app_state.prices.market_params.[]' -v "{}" dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[34].pair' -v 'DYDX-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[34].id' -v '1000001' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[34].exponent' -v '-9' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[34].min_exchanges' -v '3' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.[34].min_price_change_ppm' -v '2500' # 0.25% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[34].id' -v '1000001' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[34].exponent' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.[34].price' -v '2050000000' # $2.05 = 1 DYDX. - # DYDX Exchange Config - dydx_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/dydx_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.[34].exchange_config_json' -v "$dydx_exchange_config_json" # Initialize bridge module account balance as total native token supply. bridge_module_account_balance=$TOTAL_NATIVE_TOKEN_SUPPLY @@ -2379,15 +2239,11 @@ function update_genesis_use_test_volatile_market() { dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.last().pair' -v 'TEST-USD' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.last().id' -v "${TEST_USD_MARKET_ID}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.last().exponent' -v '-5' - dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.last().min_exchanges' -v '1' dasel put -t int -f "$GENESIS" '.app_state.prices.market_params.last().min_price_change_ppm' -v '250' # 0.025% dasel put -t json -f "$GENESIS" '.app_state.prices.market_prices.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.last().id' -v "${TEST_USD_MARKET_ID}" dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.last().exponent' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.prices.market_prices.last().price' -v '10000000' # $100 = 1 TEST. - # TEST Exchange Config - test_exchange_config_json=$(cat "$EXCHANGE_CONFIG_JSON_DIR/test_exchange_config.json" | jq -c '.') - dasel put -t string -f "$GENESIS" '.app_state.prices.market_params.last().exchange_config_json' -v "$test_exchange_config_json" # Liquidity Tier: For TEST-USD. 1% leverage and regular 1m nonlinear margin thresholds. NUM_LIQUIDITY_TIERS=$(jq -c '.app_state.perpetuals.liquidity_tiers | length' < ${GENESIS}) diff --git a/protocol/x/listing/keeper/listing.go b/protocol/x/listing/keeper/listing.go index 4e116b044e..1a126dd527 100644 --- a/protocol/x/listing/keeper/listing.go +++ b/protocol/x/listing/keeper/listing.go @@ -60,13 +60,9 @@ func (k Keeper) CreateMarket( market, err := k.PricesKeeper.CreateMarket( sdkCtx, pricestypes.MarketParam{ - Id: marketId, - Pair: ticker, - // Set the price exponent to the negative of the number of decimals - Exponent: int32(marketMapDetails.Ticker.Decimals) * -1, - MinExchanges: uint32(marketMapDetails.Ticker.MinProviderCount), - MinPriceChangePpm: types.MinPriceChangePpm_LongTail, - ExchangeConfigJson: "{}", // Placeholder. TODO (TRA-513): Deprecate this field + Id: marketId, + Pair: ticker, + MinPriceChangePpm: types.MinPriceChangePpm_LongTail, }, pricestypes.MarketPrice{ Id: marketId, diff --git a/protocol/x/listing/keeper/listing_test.go b/protocol/x/listing/keeper/listing_test.go index 656fb14aad..18c9a8778f 100644 --- a/protocol/x/listing/keeper/listing_test.go +++ b/protocol/x/listing/keeper/listing_test.go @@ -97,8 +97,6 @@ func TestCreateMarket(t *testing.T) { market, exists := pricesKeeper.GetMarketParam(ctx, marketId) require.True(t, exists) require.Equal(t, testMarketParams.Pair, market.Pair) - require.Equal(t, testMarketParams.Exponent, market.Exponent) - require.Equal(t, testMarketParams.MinExchanges, market.MinExchanges) require.Equal(t, testMarketParams.MinPriceChangePpm, types.MinPriceChangePpm_LongTail) } }, diff --git a/protocol/x/prices/keeper/market_param_test.go b/protocol/x/prices/keeper/market_param_test.go index 95644f3b3e..84c71fbcef 100644 --- a/protocol/x/prices/keeper/market_param_test.go +++ b/protocol/x/prices/keeper/market_param_test.go @@ -222,25 +222,6 @@ func TestModifyMarketParam_Errors(t *testing.T) { exchangeConfigJson: validExchangeConfigJson, expectedErr: errorsmod.Wrap(types.ErrInvalidInput, constants.ErrorMsgInvalidMinPriceChange).Error(), }, - "Min exchanges cannot be zero": { - pair: constants.BtcUsdPair, - minExchanges: uint32(0), // cannot be zero - minPriceChangePpm: uint32(50), - exchangeConfigJson: validExchangeConfigJson, - expectedErr: types.ErrZeroMinExchanges.Error(), - }, - "Empty exchange config json string": { - pair: constants.BtcUsdPair, - minExchanges: uint32(1), - minPriceChangePpm: uint32(50), - exchangeConfigJson: "", - expectedErr: errorsmod.Wrapf( - types.ErrInvalidInput, - "ExchangeConfigJson string is not valid: err=%v, input=%v", - "unexpected end of JSON input", - "", - ).Error(), - }, "Updating pair fails due to pair already existing": { targetId: 0, pair: "1-1", diff --git a/protocol/x/prices/keeper/market_test.go b/protocol/x/prices/keeper/market_test.go index f0323f2a57..4b4705d67f 100644 --- a/protocol/x/prices/keeper/market_test.go +++ b/protocol/x/prices/keeper/market_test.go @@ -144,14 +144,6 @@ func TestCreateMarket_Errors(t *testing.T) { price: constants.FiveBillion, expectedErr: errorsmod.Wrap(types.ErrInvalidInput, constants.ErrorMsgInvalidMinPriceChange).Error(), }, - "Min exchanges cannot be zero": { - pair: constants.BtcUsdPair, - minExchanges: uint32(0), // cannot be zero - minPriceChangePpm: uint32(50), - price: constants.FiveBillion, - exchangeConfigJson: validExchangeConfigJson, - expectedErr: types.ErrZeroMinExchanges.Error(), - }, "Market param and price ids don't match": { pair: constants.BtcUsdPair, minExchanges: uint32(2), diff --git a/protocol/x/prices/keeper/msg_server_update_market_param_test.go b/protocol/x/prices/keeper/msg_server_update_market_param_test.go index f0be3bba9a..3164e49524 100644 --- a/protocol/x/prices/keeper/msg_server_update_market_param_test.go +++ b/protocol/x/prices/keeper/msg_server_update_market_param_test.go @@ -80,20 +80,6 @@ func TestUpdateMarketParam(t *testing.T) { }, expectedErr: "Pair cannot be empty", }, - "Failure: update to 0 min exchanges": { - msg: &pricestypes.MsgUpdateMarketParam{ - Authority: lib.GovModuleAddress.String(), - MarketParam: pricestypes.MarketParam{ - Id: testMarketParam.Id, - Pair: testMarketParam.Pair, - Exponent: testMarketParam.Exponent, - MinExchanges: 0, // invalid - MinPriceChangePpm: testMarketParam.MinPriceChangePpm, - ExchangeConfigJson: testMarketParam.ExchangeConfigJson, - }, - }, - expectedErr: "Min exchanges must be greater than zero", - }, "Failure: update to 0 min price change ppm": { msg: &pricestypes.MsgUpdateMarketParam{ Authority: lib.GovModuleAddress.String(), @@ -108,20 +94,6 @@ func TestUpdateMarketParam(t *testing.T) { }, expectedErr: "Invalid input", }, - "Failure: update to invalid exchange config json": { - msg: &pricestypes.MsgUpdateMarketParam{ - Authority: lib.GovModuleAddress.String(), - MarketParam: pricestypes.MarketParam{ - Id: testMarketParam.Id, - Pair: testMarketParam.Pair, - Exponent: testMarketParam.Exponent, - MinExchanges: testMarketParam.MinExchanges, - MinPriceChangePpm: testMarketParam.MinPriceChangePpm, - ExchangeConfigJson: `{{"exchanges":[{"exchangeName":"XYZ","ticker":"PIKACHU"}]}`, // invalid json - }, - }, - expectedErr: "Invalid input", - }, "Failure: new pair name does not exist in marketmap": { msg: &pricestypes.MsgUpdateMarketParam{ Authority: lib.GovModuleAddress.String(), diff --git a/protocol/x/prices/keeper/slinky_adapter_test.go b/protocol/x/prices/keeper/slinky_adapter_test.go index 017a254899..07dd3872a6 100644 --- a/protocol/x/prices/keeper/slinky_adapter_test.go +++ b/protocol/x/prices/keeper/slinky_adapter_test.go @@ -109,11 +109,9 @@ func TestBadMarketData(t *testing.T) { _, err := keeper.CreateMarket( ctx, types.MarketParam{ - Id: uint32(0), - Pair: "00", - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: "{}", + Id: uint32(0), + Pair: "00", + MinPriceChangePpm: 1, }, types.MarketPrice{}) require.Error(t, err) diff --git a/protocol/x/prices/module_test.go b/protocol/x/prices/module_test.go index 9ddcc5dc96..b9394fb624 100644 --- a/protocol/x/prices/module_test.go +++ b/protocol/x/prices/module_test.go @@ -128,8 +128,8 @@ func TestAppModuleBasic_ValidateGenesisErr(t *testing.T) { }, "Bad state: duplicate market param id": { genesisJson: `{"market_params": [` + - `{"id":0,"pair": "DENT-USD","minExchanges":1,"minPriceChangePpm":1,"exchangeConfigJson":"{}"},` + - `{"id":0,"pair": "LINK-USD","minExchanges":1,"minPriceChangePpm":1,"exchangeConfigJson":"{}"}` + + `{"id":0,"pair": "DENT-USD","minPriceChangePpm":1},` + + `{"id":0,"pair": "LINK-USD","minPriceChangePpm":1}` + `]}`, expectedErr: "duplicated market param id", }, @@ -138,8 +138,7 @@ func TestAppModuleBasic_ValidateGenesisErr(t *testing.T) { expectedErr: errorsmod.Wrap(pricestypes.ErrInvalidInput, "Pair cannot be empty").Error(), }, "Bad state: Mismatch between params and prices": { - genesisJson: `{"market_params": [{"pair": "DENT-USD","minExchanges":1,"minPriceChangePpm":1,` + - `"exchangeConfigJson":"{}"}]}`, + genesisJson: `{"market_params": [{"pair": "DENT-USD","minPriceChangePpm":1}]}`, expectedErr: "expected the same number of market prices and market params", }, } diff --git a/protocol/x/prices/types/genesis_test.go b/protocol/x/prices/types/genesis_test.go index c35803668a..1c953631fc 100644 --- a/protocol/x/prices/types/genesis_test.go +++ b/protocol/x/prices/types/genesis_test.go @@ -2,7 +2,6 @@ package types_test import ( "errors" - "github.com/dydxprotocol/v4-chain/protocol/testutil/daemons/pricefeed/exchange_config" "testing" errorsmod "cosmossdk.io/errors" @@ -25,18 +24,14 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ MarketParams: []types.MarketParam{ { - Id: 0, - Pair: constants.BtcUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_BTC_USD], + Id: 0, + Pair: constants.BtcUsdPair, + MinPriceChangePpm: 1, }, { - Id: 1, - Pair: constants.EthUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_ETH_USD], + Id: 1, + Pair: constants.EthUsdPair, + MinPriceChangePpm: 1, }, }, MarketPrices: []types.MarketPrice{ @@ -52,42 +47,18 @@ func TestGenesisState_Validate(t *testing.T) { }, expectedError: nil, }, - "invalid: empty ExchangeConfigJson": { - genState: &types.GenesisState{ - MarketParams: []types.MarketParam{ - { - Id: 0, - Pair: constants.BtcUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: "", - }, - }, - MarketPrices: []types.MarketPrice{ - { - Id: 0, - Price: constants.FiveBillion, - }, - }, - }, - expectedError: errors.New("ExchangeConfigJson string is not valid"), - }, "invalid: duplicate market param ids": { genState: &types.GenesisState{ MarketParams: []types.MarketParam{ { - Id: 0, - Pair: constants.BtcUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_BTC_USD], + Id: 0, + Pair: constants.BtcUsdPair, + MinPriceChangePpm: 1, }, { - Id: 0, - Pair: constants.EthUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_ETH_USD], + Id: 0, + Pair: constants.EthUsdPair, + MinPriceChangePpm: 1, }, }, }, @@ -97,9 +68,8 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ MarketParams: []types.MarketParam{ { - Id: 0, - Pair: "", - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_BTC_USD], + Id: 0, + Pair: "", }, }, }, @@ -109,18 +79,14 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ MarketParams: []types.MarketParam{ { - Id: 0, - Pair: constants.BtcUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_BTC_USD], + Id: 0, + Pair: constants.BtcUsdPair, + MinPriceChangePpm: 1, }, { - Id: 1, - Pair: constants.EthUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_ETH_USD], + Id: 1, + Pair: constants.EthUsdPair, + MinPriceChangePpm: 1, }, }, MarketPrices: []types.MarketPrice{ @@ -136,18 +102,14 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ MarketParams: []types.MarketParam{ { - Id: 0, - Pair: constants.BtcUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_BTC_USD], + Id: 0, + Pair: constants.BtcUsdPair, + MinPriceChangePpm: 1, }, { - Id: 1, - Pair: constants.EthUsdPair, - MinExchanges: 1, - MinPriceChangePpm: 1, - ExchangeConfigJson: constants.TestMarketExchangeConfigs[exchange_config.MARKET_ETH_USD], + Id: 1, + Pair: constants.EthUsdPair, + MinPriceChangePpm: 1, }, }, MarketPrices: []types.MarketPrice{ diff --git a/protocol/x/prices/types/market_param.go b/protocol/x/prices/types/market_param.go index 918f47fe99..259b60111e 100644 --- a/protocol/x/prices/types/market_param.go +++ b/protocol/x/prices/types/market_param.go @@ -3,7 +3,6 @@ package types import ( errorsmod "cosmossdk.io/errors" "github.com/dydxprotocol/v4-chain/protocol/lib" - "github.com/dydxprotocol/v4-chain/protocol/lib/json" ) // Validate checks that the MarketParam is valid. @@ -13,10 +12,6 @@ func (mp *MarketParam) Validate() error { return errorsmod.Wrap(ErrInvalidInput, "Pair cannot be empty") } - if mp.MinExchanges == 0 { - return ErrZeroMinExchanges - } - // Validate min price change. if mp.MinPriceChangePpm == 0 || mp.MinPriceChangePpm >= lib.MaxPriceChangePpm { return errorsmod.Wrapf( @@ -25,14 +20,5 @@ func (mp *MarketParam) Validate() error { lib.MaxPriceChangePpm) } - if err := json.IsValidJSON(mp.ExchangeConfigJson); err != nil { - return errorsmod.Wrapf( - ErrInvalidInput, - "ExchangeConfigJson string is not valid: err=%v, input=%v", - err, - mp.ExchangeConfigJson, - ) - } - return nil } diff --git a/protocol/x/prices/types/market_param.pb.go b/protocol/x/prices/types/market_param.pb.go index 4dbfd10c4f..5d9deda33d 100644 --- a/protocol/x/prices/types/market_param.pb.go +++ b/protocol/x/prices/types/market_param.pb.go @@ -36,16 +36,20 @@ type MarketParam struct { // represents “$10,000`. Therefore `10 ^ Exponent` represents the smallest // price step (in dollars) that can be recorded. // - // Deprecated since v7.1.x. This value is now determined from the marketmap. + // Deprecated since v8.x. This value is now determined from the marketmap. Exponent int32 `protobuf:"zigzag32,3,opt,name=exponent,proto3" json:"exponent,omitempty"` // Deprecated: Do not use. // The minimum number of exchanges that should be reporting a live price for // a price update to be considered valid. + // + // Deprecated since v8.x. This value is now determined from the marketmap. MinExchanges uint32 `protobuf:"varint,4,opt,name=min_exchanges,json=minExchanges,proto3" json:"min_exchanges,omitempty"` // The minimum allowable change in `price` value that would cause a price // update on the network. Measured as `1e-6` (parts per million). MinPriceChangePpm uint32 `protobuf:"varint,5,opt,name=min_price_change_ppm,json=minPriceChangePpm,proto3" json:"min_price_change_ppm,omitempty"` // A string of json that encodes the configuration for resolving the price // of this market on various exchanges. + // + // Deprecated since v8.x. This is now determined from the marketmap. ExchangeConfigJson string `protobuf:"bytes,6,opt,name=exchange_config_json,json=exchangeConfigJson,proto3" json:"exchange_config_json,omitempty"` } diff --git a/protocol/x/prices/types/market_param_test.go b/protocol/x/prices/types/market_param_test.go index 75f5d0a5d1..1b0b9811e6 100644 --- a/protocol/x/prices/types/market_param_test.go +++ b/protocol/x/prices/types/market_param_test.go @@ -8,7 +8,6 @@ import ( ) func TestMarketParam_Validate(t *testing.T) { - validExchangeConfigJson := `{"exchanges":[{"exchangeName":"Binance","ticker":"BTCUSDT"}]}` testCases := []struct { name string input types.MarketParam @@ -17,53 +16,27 @@ func TestMarketParam_Validate(t *testing.T) { { name: "Valid MarketParam", input: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: validExchangeConfigJson, + Pair: "BTC-USD", + MinPriceChangePpm: 1_000, }, expErrMsg: "", }, { name: "Empty pair", input: types.MarketParam{ - Pair: "", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: validExchangeConfigJson, + Pair: "", + MinPriceChangePpm: 1_000, }, expErrMsg: "Pair cannot be empty", }, { name: "Invalid MinPriceChangePpm", input: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 0, - ExchangeConfigJson: validExchangeConfigJson, + Pair: "BTC-USD", + MinPriceChangePpm: 0, }, expErrMsg: "Min price change in parts-per-million must be greater than 0", }, - { - name: "Empty ExchangeConfigJson", - input: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: "", - }, - expErrMsg: "ExchangeConfigJson string is not valid", - }, - { - name: "Typo in ExchangeConfigJson", - input: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: `{"exchanges":[]`, // missing a bracket - }, - expErrMsg: "ExchangeConfigJson string is not valid", - }, } for _, tc := range testCases { diff --git a/protocol/x/prices/types/message_create_oracle_market_test.go b/protocol/x/prices/types/message_create_oracle_market_test.go index 903cadc28d..6af6c6b7fa 100644 --- a/protocol/x/prices/types/message_create_oracle_market_test.go +++ b/protocol/x/prices/types/message_create_oracle_market_test.go @@ -1,15 +1,15 @@ package types_test import ( - "github.com/dydxprotocol/v4-chain/protocol/x/prices/client/testutil" "testing" + "github.com/dydxprotocol/v4-chain/protocol/x/prices/client/testutil" + types "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" "github.com/stretchr/testify/require" ) func TestMsgCreateOracleMarket_ValidateBasic(t *testing.T) { - validExchangeConfigJson := `{"exchanges":[{"exchangeName":"Binance","ticker":"BTCUSDT"}]}` tests := []struct { desc string msg types.MsgCreateOracleMarket @@ -36,10 +36,8 @@ func TestMsgCreateOracleMarket_ValidateBasic(t *testing.T) { msg: types.MsgCreateOracleMarket{ Authority: testutil.ValidAuthority, Params: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: validExchangeConfigJson, + Pair: "BTC-USD", + MinPriceChangePpm: 1_000, }, }, expectedErr: "", @@ -49,10 +47,8 @@ func TestMsgCreateOracleMarket_ValidateBasic(t *testing.T) { msg: types.MsgCreateOracleMarket{ Authority: testutil.ValidAuthority, Params: types.MarketParam{ - Pair: "", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: validExchangeConfigJson, + Pair: "", + MinPriceChangePpm: 1_000, }, }, expectedErr: "Pair cannot be empty", @@ -62,40 +58,12 @@ func TestMsgCreateOracleMarket_ValidateBasic(t *testing.T) { msg: types.MsgCreateOracleMarket{ Authority: testutil.ValidAuthority, Params: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 0, - ExchangeConfigJson: validExchangeConfigJson, + Pair: "BTC-USD", + MinPriceChangePpm: 0, }, }, expectedErr: "Min price change in parts-per-million must be greater than 0", }, - { - desc: "Empty ExchangeConfigJson", - msg: types.MsgCreateOracleMarket{ - Authority: testutil.ValidAuthority, - Params: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: "", - }, - }, - expectedErr: "ExchangeConfigJson string is not valid", - }, - { - desc: "Typo in ExchangeConfigJson", - msg: types.MsgCreateOracleMarket{ - Authority: testutil.ValidAuthority, - Params: types.MarketParam{ - Pair: "BTC-USD", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: `{"exchanges":[]`, // missing a bracket - }, - }, - expectedErr: "ExchangeConfigJson string is not valid", - }, } for _, tc := range tests { diff --git a/protocol/x/prices/types/message_update_market_param_test.go b/protocol/x/prices/types/message_update_market_param_test.go index d2dda7dd21..d13c5fee0e 100644 --- a/protocol/x/prices/types/message_update_market_param_test.go +++ b/protocol/x/prices/types/message_update_market_param_test.go @@ -1,9 +1,10 @@ package types_test import ( - "github.com/dydxprotocol/v4-chain/protocol/x/prices/client/testutil" "testing" + "github.com/dydxprotocol/v4-chain/protocol/x/prices/client/testutil" + "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" "github.com/stretchr/testify/require" ) @@ -17,10 +18,8 @@ func TestMsgUpdateMarketParam_ValidateBasic(t *testing.T) { msg: types.MsgUpdateMarketParam{ Authority: testutil.ValidAuthority, MarketParam: types.MarketParam{ - Pair: "test", - MinExchanges: 1, - MinPriceChangePpm: 1_000, - ExchangeConfigJson: "{}", + Pair: "test", + MinPriceChangePpm: 1_000, }, }, }, @@ -43,29 +42,16 @@ func TestMsgUpdateMarketParam_ValidateBasic(t *testing.T) { Authority: testutil.ValidAuthority, MarketParam: types.MarketParam{ Pair: "", - MinExchanges: 1, MinPriceChangePpm: 1_000, }, }, expectedErr: "Pair cannot be empty", }, - "Failure: 0 MinExchanges": { - msg: types.MsgUpdateMarketParam{ - Authority: testutil.ValidAuthority, - MarketParam: types.MarketParam{ - Pair: "test", - MinExchanges: 0, - MinPriceChangePpm: 1_000, - }, - }, - expectedErr: "Min exchanges must be greater than zero", - }, "Failure: 0 MinPriceChangePpm": { msg: types.MsgUpdateMarketParam{ Authority: testutil.ValidAuthority, MarketParam: types.MarketParam{ Pair: "test", - MinExchanges: 2, MinPriceChangePpm: 0, }, }, @@ -76,7 +62,6 @@ func TestMsgUpdateMarketParam_ValidateBasic(t *testing.T) { Authority: testutil.ValidAuthority, MarketParam: types.MarketParam{ Pair: "test", - MinExchanges: 2, MinPriceChangePpm: 10_000, }, },