diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index b26b996923..598d1dbc98 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -405,14 +405,18 @@ "prices": { "market_params": [ { + "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"BTCUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"BTCUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tBTCUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"BTC/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"BTCUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BTC-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"BTC_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXBTZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BTC-USDT\"}]}", "exponent": -5, "id": 0, + "min_exchanges": 1, "min_price_change_ppm": 1000, "pair": "BTC-USD" }, { + "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"ETHUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"ETHUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tETHUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"ETH/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ETHUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ETH-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"ETH_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XETHZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ETH-USDT\"}]}", "exponent": -6, "id": 1, + "min_exchanges": 1, "min_price_change_ppm": 1000, "pair": "ETH-USD" } diff --git a/protocol/x/prices/types/genesis.go b/protocol/x/prices/types/genesis.go index e44ed6e855..a83dcbad6f 100644 --- a/protocol/x/prices/types/genesis.go +++ b/protocol/x/prices/types/genesis.go @@ -10,16 +10,20 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ MarketParams: []MarketParam{ { - Exponent: -5, - Id: 0, - MinPriceChangePpm: 1000, - Pair: "BTC-USD", + ExchangeConfigJson: "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"BTCUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"BTCUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tBTCUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"BTC/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"BTCUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BTC-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"BTC_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXBTZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BTC-USDT\"}]}", //nolint:lll + Exponent: -5, + Id: 0, + MinExchanges: 1, + MinPriceChangePpm: 1000, + Pair: "BTC-USD", }, { - Exponent: -6, - Id: 1, - MinPriceChangePpm: 1000, - Pair: "ETH-USD", + ExchangeConfigJson: "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"ETHUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"ETHUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tETHUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"ETH/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ETHUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ETH-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"ETH_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XETHZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ETH-USDT\"}]}", //nolint:lll + Exponent: -6, + Id: 1, + MinExchanges: 1, + MinPriceChangePpm: 1000, + Pair: "ETH-USD", }, }, MarketPrices: []MarketPrice{ diff --git a/protocol/x/rewards/keeper/keeper_test.go b/protocol/x/rewards/keeper/keeper_test.go index 720bb70a7d..e5db22d37b 100644 --- a/protocol/x/rewards/keeper/keeper_test.go +++ b/protocol/x/rewards/keeper/keeper_test.go @@ -986,10 +986,12 @@ func TestProcessRewardsForBlock(t *testing.T) { ctx, &tApp.App.PricesKeeper, pricestypes.MarketParam{ - Id: testRewardTokenMarketId, - Pair: testRewardTokenMarket, - Exponent: tc.tokenPrice.Exponent, - MinPriceChangePpm: uint32(50), + Id: testRewardTokenMarketId, + Pair: testRewardTokenMarket, + Exponent: tc.tokenPrice.Exponent, + MinExchanges: uint32(1), + MinPriceChangePpm: uint32(50), + ExchangeConfigJson: "{}", }, tc.tokenPrice, )