diff --git a/proto/nibiru/perp/v2/state.proto b/proto/nibiru/perp/v2/state.proto index 986aba141..50a2d4f4b 100644 --- a/proto/nibiru/perp/v2/state.proto +++ b/proto/nibiru/perp/v2/state.proto @@ -116,6 +116,14 @@ message Market { (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; + + // the pair of the oracle that is used to determine the index price + // for the market + string oracle_pair = 15 [ + (gogoproto.customtype) = + "github.com/NibiruChain/nibiru/x/common/asset.Pair", + (gogoproto.nullable) = false + ]; } // MarketLastVersion is used to store the last version of the market diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index 8e360a09d..836406af1 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -90,6 +90,7 @@ type MarketParams struct { MaxFundingRate sdk.Dec `json:"max_funding_rate,omitempty"` // amount of time to look back for TWAP calculations TwapLookbackWindow sdkmath.Int `json:"twap_lookback_window"` + OraclePair string `json:"oracle_pair"` } type NoOp struct{} diff --git a/wasmbinding/exec_perp.go b/wasmbinding/exec_perp.go index 9ef201feb..0ff213d8f 100644 --- a/wasmbinding/exec_perp.go +++ b/wasmbinding/exec_perp.go @@ -86,6 +86,7 @@ func (exec *ExecutorPerp) CreateMarket( MaxFundingRate: mp.MaxFundingRate, TwapLookbackWindow: time.Duration(mp.TwapLookbackWindow.Int64()), PrepaidBadDebt: sdk.NewCoin(pair.QuoteDenom(), sdk.ZeroInt()), + OraclePair: pair, } } diff --git a/x/common/asset/pair.go b/x/common/asset/pair.go index bb1a49ebe..65b0c6070 100644 --- a/x/common/asset/pair.go +++ b/x/common/asset/pair.go @@ -83,6 +83,10 @@ func (pair Pair) QuoteDenom() string { // Validate performs a basic validation of the market params func (pair Pair) Validate() error { + if len(pair) == 0 { + return ErrInvalidTokenPair.Wrap("oracle pair is empty") + } + split := strings.Split(pair.String(), ":") if len(split) != 2 { return ErrInvalidTokenPair.Wrap(pair.String()) diff --git a/x/common/testutil/genesis/perp_genesis.go b/x/common/testutil/genesis/perp_genesis.go index b1d332636..3d9287014 100644 --- a/x/common/testutil/genesis/perp_genesis.go +++ b/x/common/testutil/genesis/perp_genesis.go @@ -18,6 +18,7 @@ func AddPerpV2Genesis(gen app.GenesisState) app.GenesisState { asset.Registry.Pair(denoms.BTC, denoms.NUSD): { Market: perpv2types.Market{ Pair: asset.NewPair(denoms.BTC, denoms.NUSD), + OraclePair: asset.NewPair(denoms.BTC, denoms.USD), Version: 1, Enabled: true, MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.04"), @@ -46,6 +47,7 @@ func AddPerpV2Genesis(gen app.GenesisState) app.GenesisState { asset.Registry.Pair(denoms.ATOM, denoms.NUSD): { Market: perpv2types.Market{ Pair: asset.NewPair(denoms.ATOM, denoms.NUSD), + OraclePair: asset.NewPair(denoms.ATOM, denoms.USD), Enabled: true, Version: 1, MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.0625"), @@ -74,6 +76,7 @@ func AddPerpV2Genesis(gen app.GenesisState) app.GenesisState { asset.Registry.Pair(denoms.OSMO, denoms.NUSD): { Market: perpv2types.Market{ Pair: asset.NewPair(denoms.OSMO, denoms.NUSD), + OraclePair: asset.NewPair(denoms.OSMO, denoms.USD), Enabled: true, Version: 1, MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.0625"), @@ -134,6 +137,7 @@ var START_MARKETS = map[asset.Pair]perpv2types.AmmMarket{ asset.Registry.Pair(denoms.ETH, denoms.NUSD): { Market: perpv2types.Market{ Pair: asset.Registry.Pair(denoms.ETH, denoms.NUSD), + OraclePair: asset.Registry.Pair(denoms.ETH, denoms.USD), Enabled: true, Version: 1, MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.0625"), @@ -162,6 +166,7 @@ var START_MARKETS = map[asset.Pair]perpv2types.AmmMarket{ asset.Registry.Pair(denoms.NIBI, denoms.NUSD): { Market: perpv2types.Market{ Pair: asset.Registry.Pair(denoms.NIBI, denoms.NUSD), + OraclePair: asset.Registry.Pair(denoms.NIBI, denoms.USD), Enabled: true, Version: 1, MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.04"), @@ -194,6 +199,7 @@ func PerpV2Genesis() *perpv2types.GenesisState { Markets: []perpv2types.Market{ { Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), + OraclePair: asset.Registry.Pair(denoms.BTC, denoms.USD), Enabled: true, MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.04"), MaxLeverage: sdk.MustNewDecFromStr("20"), diff --git a/x/common/testutil/mock/perp_market.go b/x/common/testutil/mock/perp_market.go index 4c5d4de48..96a1c4167 100644 --- a/x/common/testutil/mock/perp_market.go +++ b/x/common/testutil/mock/perp_market.go @@ -27,5 +27,6 @@ func TestMarket() *types.Market { MaxFundingRate: sdk.NewDec(1), TwapLookbackWindow: time.Minute * 30, PrepaidBadDebt: sdk.NewInt64Coin(denoms.NUSD, 0), + OraclePair: asset.NewPair(denoms.BTC, denoms.USD), } } diff --git a/x/perp/v2/client/cli/gen_market.go b/x/perp/v2/client/cli/gen_market.go index a7c3b4ded..1a5a5c624 100644 --- a/x/perp/v2/client/cli/gen_market.go +++ b/x/perp/v2/client/cli/gen_market.go @@ -27,6 +27,7 @@ const ( FlagMaintenenceMarginRatio = "mmr" FlagMaxLeverage = "max-leverage" FlagMaxFundingrate = "max-funding-rate" + FlagOraclePair = "oracle-pair" ) var addMarketGenesisFlags = map[string]struct { @@ -39,6 +40,7 @@ var addMarketGenesisFlags = map[string]struct { FlagMaintenenceMarginRatio: {"0.0625", "maintenance margin ratio"}, FlagMaxLeverage: {"10", "maximum leverage for opening a position"}, FlagMaxFundingrate: {"0.01", "maximum funding rate for the market"}, + FlagOraclePair: {"", "oracle pair identifier of the form 'base:quote'. E.g., ueth:uusd"}, } // getCmdFlagSet returns a flag set and list of required flags for the command. @@ -140,6 +142,9 @@ func newMarketFromFlags(flagSet *flag.FlagSet, maxFundingRateStr, err := flagSet.GetString(FlagMaxFundingrate) flagErrors = append(flagErrors, err) + oraclePairStr, err := flagSet.GetString(FlagOraclePair) + flagErrors = append(flagErrors, err) + for _, err := range flagErrors { // for brevity's sake if err != nil { return types.Market{}, types.AMM{}, err @@ -171,6 +176,11 @@ func newMarketFromFlags(flagSet *flag.FlagSet, return types.Market{}, types.AMM{}, err } + oraclePair, err := asset.TryNewPair(oraclePairStr) + if err != nil { + return + } + priceMultiplier, err := sdk.NewDecFromStr(priceMultiplierStr) if err != nil { return types.Market{}, types.AMM{}, err @@ -190,6 +200,7 @@ func newMarketFromFlags(flagSet *flag.FlagSet, MaxFundingRate: maxFundingRate, TwapLookbackWindow: time.Minute * 30, PrepaidBadDebt: sdk.NewInt64Coin(pair.QuoteDenom(), 0), + OraclePair: oraclePair, } if err := market.Validate(); err != nil { return types.Market{}, types.AMM{}, err diff --git a/x/perp/v2/client/cli/gen_market_test.go b/x/perp/v2/client/cli/gen_market_test.go index eb513f490..8dbc933b5 100644 --- a/x/perp/v2/client/cli/gen_market_test.go +++ b/x/perp/v2/client/cli/gen_market_test.go @@ -21,6 +21,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio string maxLeverage string maxFundingRate string + oraclePair string expectError bool }{ { @@ -31,6 +32,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "1", maxLeverage: "1", maxFundingRate: "1", + oraclePair: "token0:token1", expectError: true, }, { @@ -41,6 +43,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "1", maxLeverage: "1", maxFundingRate: "1", + oraclePair: "token0:token1", expectError: true, }, { @@ -51,6 +54,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "1", maxLeverage: "1", maxFundingRate: "1", + oraclePair: "token0:token1", expectError: true, }, { @@ -61,6 +65,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "0.1", maxLeverage: "0", maxFundingRate: "0", + oraclePair: "token0:token1", expectError: true, }, { @@ -71,6 +76,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "0.1", maxLeverage: "1", maxFundingRate: "1", + oraclePair: "token0:token1", expectError: true, }, { @@ -81,6 +87,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "0.1", maxLeverage: "1", maxFundingRate: "1", + oraclePair: "token0:token1", expectError: true, }, { @@ -91,6 +98,18 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "0.1", maxLeverage: "10", maxFundingRate: "-1", + oraclePair: "token0:token1", + expectError: true, + }, + { + name: "negative max funding rate", + pairName: "token0:token1", + sqrtDepth: "100", + priceMultiplier: "1", + maintainRatio: "0.1", + maxLeverage: "10", + maxFundingRate: "-1", + oraclePair: "invalidPair", expectError: true, }, { @@ -101,6 +120,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { maintainRatio: "0.1", maxLeverage: "10", maxFundingRate: "10", + oraclePair: "token0:token1", expectError: false, }, } @@ -117,6 +137,7 @@ func TestAddMarketGenesisCmd(t *testing.T) { fmt.Sprintf("--%s=%s", cli.FlagMaintenenceMarginRatio, tc.maintainRatio), fmt.Sprintf("--%s=%s", cli.FlagMaxLeverage, tc.maxLeverage), fmt.Sprintf("--%s=%s", cli.FlagMaxFundingrate, tc.maxFundingRate), + fmt.Sprintf("--%s=%s", cli.FlagOraclePair, tc.oraclePair), fmt.Sprintf("--%s=home", flags.FlagHome), }) diff --git a/x/perp/v2/keeper/admin_test.go b/x/perp/v2/keeper/admin_test.go index 6bcf3eaf8..5488a98d6 100644 --- a/x/perp/v2/keeper/admin_test.go +++ b/x/perp/v2/keeper/admin_test.go @@ -110,6 +110,16 @@ func TestCreateMarket(t *testing.T) { }) require.ErrorContains(t, err, "maintenance margin ratio ratio must be 0 <= ratio <= 1") + // Error because of invalid oracle pair + market = perptypes.DefaultMarket(pair).WithOraclePair("random") + err = admin.CreateMarket(ctx, keeper.ArgsCreateMarket{ + Pair: pair, + PriceMultiplier: amm.PriceMultiplier, + SqrtDepth: amm.SqrtDepth, + Market: &market, // Invalid maintenance ratio + }) + require.ErrorContains(t, err, "err when validating oracle pair random: invalid token pair") + // Error because of invalid amm err = admin.CreateMarket(ctx, keeper.ArgsCreateMarket{ Pair: pair, diff --git a/x/perp/v2/keeper/hooks.go b/x/perp/v2/keeper/hooks.go index 6dbc4a74b..69ee799e2 100644 --- a/x/perp/v2/keeper/hooks.go +++ b/x/perp/v2/keeper/hooks.go @@ -23,7 +23,7 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, number ui return } - indexTwap, err := k.OracleKeeper.GetExchangeRateTwap(ctx, market.Pair) + indexTwap, err := k.OracleKeeper.GetExchangeRateTwap(ctx, market.OraclePair) if err != nil { ctx.Logger().Error("failed to fetch twap index price", "market.Pair", market.Pair, "error", err) continue diff --git a/x/perp/v2/keeper/hooks_test.go b/x/perp/v2/keeper/hooks_test.go index ba1f6335d..24d4c996a 100644 --- a/x/perp/v2/keeper/hooks_test.go +++ b/x/perp/v2/keeper/hooks_test.go @@ -17,6 +17,7 @@ import ( ) func TestAfterEpochEnd(t *testing.T) { + pairBtcUsd := asset.Registry.Pair(denoms.BTC, denoms.USD) pairBtcUsdc := asset.Registry.Pair(denoms.BTC, denoms.USDC) startTime := time.Now() @@ -25,7 +26,7 @@ func TestAfterEpochEnd(t *testing.T) { Given( CreateCustomMarket(pairBtcUsdc, WithEnabled(true)), SetBlockTime(startTime), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("5.8")), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("5.8")), StartEpoch(epochtypes.ThirtyMinuteEpochID), ). When( @@ -39,7 +40,7 @@ func TestAfterEpochEnd(t *testing.T) { Given( CreateCustomMarket(pairBtcUsdc, WithEnabled(true)), SetBlockTime(startTime), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("0.52")), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("0.52")), StartEpoch(epochtypes.ThirtyMinuteEpochID), ). When( @@ -53,7 +54,7 @@ func TestAfterEpochEnd(t *testing.T) { Given( CreateCustomMarket(pairBtcUsdc, WithEnabled(true), WithMaxFundingRate(sdk.MustNewDecFromStr("0.001"))), SetBlockTime(startTime), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("5.8")), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("5.8")), StartEpoch(epochtypes.ThirtyMinuteEpochID), ). When( @@ -67,7 +68,7 @@ func TestAfterEpochEnd(t *testing.T) { Given( CreateCustomMarket(pairBtcUsdc, WithEnabled(true), WithMaxFundingRate(sdk.MustNewDecFromStr("0.001"))), SetBlockTime(startTime), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("0.52")), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.MustNewDecFromStr("0.52")), StartEpoch(epochtypes.ThirtyMinuteEpochID), ). When( @@ -81,7 +82,7 @@ func TestAfterEpochEnd(t *testing.T) { Given( CreateCustomMarket(pairBtcUsdc, WithEnabled(true)), SetBlockTime(startTime), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.OneDec()), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.OneDec()), StartEpoch(epochtypes.ThirtyMinuteEpochID), ). When( @@ -109,7 +110,7 @@ func TestAfterEpochEnd(t *testing.T) { CreateCustomMarket(pairBtcUsdc, WithEnabled(true)), SetBlockTime(startTime), StartEpoch(epochtypes.ThirtyMinuteEpochID), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.ZeroDec()), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.ZeroDec()), ). When( MoveToNextBlockWithDuration(30 * time.Minute), @@ -124,7 +125,7 @@ func TestAfterEpochEnd(t *testing.T) { CloseMarket(pairBtcUsdc), SetBlockTime(startTime), StartEpoch(epochtypes.ThirtyMinuteEpochID), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.NewDec(2)), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.NewDec(2)), ). When( MoveToNextBlockWithDuration(30 * time.Minute), @@ -139,7 +140,7 @@ func TestAfterEpochEnd(t *testing.T) { CloseMarket(pairBtcUsdc), SetBlockTime(startTime), StartEpoch(epochtypes.DayEpochID), - InsertOraclePriceSnapshot(pairBtcUsdc, startTime.Add(15*time.Minute), sdk.NewDec(2)), + InsertOraclePriceSnapshot(pairBtcUsd, startTime.Add(15*time.Minute), sdk.NewDec(2)), ). When( MoveToNextBlockWithDuration(30 * time.Minute), diff --git a/x/perp/v2/module/abci.go b/x/perp/v2/module/abci.go index 6326700dc..873ed7e83 100644 --- a/x/perp/v2/module/abci.go +++ b/x/perp/v2/module/abci.go @@ -43,14 +43,14 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate { } var indexTwap sdk.Dec - indexTwap, err = k.OracleKeeper.GetExchangeRateTwap(ctx, amm.Pair) + indexTwap, err = k.OracleKeeper.GetExchangeRateTwap(ctx, market.OraclePair) if err != nil { - k.Logger(ctx).Error("failed to fetch twap index price", "market.Pair", market.Pair, "error", err) + k.Logger(ctx).Error("failed to fetch twap index price", "market.Pair", market.Pair, "market.OraclePair", market.OraclePair, "error", err) indexTwap = sdk.OneDec().Neg() } if indexTwap.IsNil() { - k.Logger(ctx).Error("index price is zero", "market.Pair", market.Pair) + k.Logger(ctx).Error("index price is zero", "market.Pair", market.Pair, "market.OraclePair", market.OraclePair) continue } diff --git a/x/perp/v2/types/genesis.go b/x/perp/v2/types/genesis.go index c143901c9..28a8f6e43 100644 --- a/x/perp/v2/types/genesis.go +++ b/x/perp/v2/types/genesis.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" + "github.com/NibiruChain/nibiru/x/common/denoms" epochstypes "github.com/NibiruChain/nibiru/x/epochs/types" "github.com/cosmos/cosmos-sdk/codec" @@ -64,6 +65,7 @@ func DefaultMarket(pair asset.Pair) Market { PrepaidBadDebt: sdk.NewCoin(TestingCollateralDenomNUSD, sdk.ZeroInt()), MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.0625"), MaxLeverage: sdk.NewDec(10), + OraclePair: asset.NewPair(pair.BaseDenom(), denoms.USD), } } diff --git a/x/perp/v2/types/market.go b/x/perp/v2/types/market.go index d0996892f..1b36cdfb2 100644 --- a/x/perp/v2/types/market.go +++ b/x/perp/v2/types/market.go @@ -46,6 +46,10 @@ func (market Market) Validate() error { return fmt.Errorf("margin ratio opened with max leverage position will be lower than Maintenance margin ratio") } + if err := market.OraclePair.Validate(); err != nil { + return fmt.Errorf("err when validating oracle pair %w", err) + } + return nil } @@ -94,6 +98,11 @@ func (market Market) WithPair(value asset.Pair) Market { return market } +func (market Market) WithOraclePair(value asset.Pair) Market { + market.OraclePair = value + return market +} + func (market Market) WithLatestCumulativePremiumFraction(value sdk.Dec) Market { market.LatestCumulativePremiumFraction = value return market @@ -178,6 +187,10 @@ func MarketsAreEqual(expected, actual Market) error { return fmt.Errorf("expected market twap lookback window %s, got %s", expected.TwapLookbackWindow, actual.TwapLookbackWindow) } + if expected.OraclePair != actual.OraclePair { + return fmt.Errorf("expected oracle pair %s, got %s", expected.OraclePair, actual.OraclePair) + } + if !expected.LatestCumulativePremiumFraction.Equal(actual.LatestCumulativePremiumFraction) { return fmt.Errorf( "expected market latest cumulative premium fraction %s, got %s", diff --git a/x/perp/v2/types/market_test.go b/x/perp/v2/types/market_test.go index c7fd66eeb..23e80458a 100644 --- a/x/perp/v2/types/market_test.go +++ b/x/perp/v2/types/market_test.go @@ -6,6 +6,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + "github.com/NibiruChain/nibiru/x/common/asset" + "github.com/NibiruChain/nibiru/x/common/denoms" ) func TestIsPercent(t *testing.T) { @@ -25,7 +28,8 @@ func TestValidate(t *testing.T) { WithLiquidationFee(sdk.NewDecWithPrec(2, 1)). WithPartialLiquidationRatio(sdk.NewDecWithPrec(1, 1)). WithMaxLeverage(sdk.NewDec(10)). - WithMaxFundingRate(sdk.NewDec(1)) + WithMaxFundingRate(sdk.NewDec(1)). + WithOraclePair(asset.Registry.Pair(denoms.BTC, denoms.USD)) require.NoError(t, market.Validate()) testCases := []struct { @@ -60,6 +64,10 @@ func TestValidate(t *testing.T) { modifier: func(m Market) Market { return m.WithMaxFundingRate(sdk.NewDec(-1)) }, requiredError: "max funding rate must be >= 0", }, + { + modifier: func(m Market) Market { return m.WithOraclePair("abc") }, + requiredError: "err when validating oracle pair abc: invalid token pair", + }, { modifier: func(m Market) Market { return m.WithMaxLeverage(sdk.NewDec(20)).WithMaintenanceMarginRatio(sdk.NewDec(1)) @@ -88,7 +96,8 @@ func TestMarketEqual(t *testing.T) { WithPartialLiquidationRatio(sdk.NewDecWithPrec(1, 1)). WithMaxLeverage(sdk.NewDec(10)). WithLatestCumulativePremiumFraction(sdk.OneDec()). - WithMaxFundingRate(sdk.OneDec()) + WithMaxFundingRate(sdk.OneDec()). + WithOraclePair(asset.Registry.Pair(denoms.BTC, denoms.USD)) // Test when all values are within expected ranges require.NoError(t, market.Validate()) @@ -151,6 +160,10 @@ func TestMarketEqual(t *testing.T) { modifier: func(m Market) Market { return m.WithTwapLookbackWindow(time.Minute) }, requiredError: "expected market twap lookback window", }, + { + modifier: func(m Market) Market { return m.WithOraclePair("abc") }, + requiredError: "expected oracle pair ubtc:uusd, got abc", + }, } for _, tc := range testCases { tc := tc diff --git a/x/perp/v2/types/state.pb.go b/x/perp/v2/types/state.pb.go index f8d525290..de39cd3ea 100644 --- a/x/perp/v2/types/state.pb.go +++ b/x/perp/v2/types/state.pb.go @@ -137,6 +137,9 @@ type Market struct { // amount of funding that can be paid out per epoch as a percentage of the // position size MaxFundingRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=max_funding_rate,json=maxFundingRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec,stdduration" json:"max_funding_rate"` + // the pair of the oracle that is used to determine the index price + // for the market + OraclePair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,15,opt,name=oracle_pair,json=oraclePair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"oracle_pair"` } func (m *Market) Reset() { *m = Market{} } @@ -503,81 +506,82 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/state.proto", fileDescriptor_8f4829f34f7b8040) } var fileDescriptor_8f4829f34f7b8040 = []byte{ - // 1173 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0xc7, 0x4d, 0x4b, 0x76, 0xac, 0xf5, 0x97, 0xba, 0xb1, 0x53, 0x3a, 0x28, 0x64, 0x57, 0x40, - 0x0b, 0x23, 0x45, 0xc8, 0xda, 0x3d, 0x05, 0x3d, 0xe9, 0xc3, 0x4e, 0x05, 0xe8, 0x2b, 0x94, 0xdc, - 0xa0, 0x45, 0x8a, 0xc5, 0x92, 0x5c, 0x53, 0x5b, 0x93, 0x5c, 0x86, 0xbb, 0x94, 0x9d, 0xf6, 0x0d, - 0x7a, 0x69, 0x8f, 0xed, 0x2b, 0xf4, 0x25, 0x7a, 0xcd, 0x31, 0xc7, 0xa2, 0x87, 0xa4, 0x48, 0x5e, - 0xa4, 0xd8, 0xe5, 0x4a, 0x96, 0x81, 0xa2, 0x4d, 0x89, 0xe6, 0x24, 0xed, 0x0e, 0xe7, 0x37, 0xc3, - 0xc1, 0xcc, 0x7f, 0x24, 0x70, 0x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 0x23, 0x4c, 0x63, 0x41, 0x62, 0x1c, 0x7b, - 0x04, 0x45, 0x38, 0x0d, 0x68, 0x8c, 0x54, 0xc2, 0x66, 0x49, 0xa5, 0x65, 0xe9, 0xb4, 0x3e, 0x5e, - 0x48, 0x4b, 0x57, 0x27, 0xff, 0xb8, 0xcf, 0xfd, 0x0b, 0x5b, 0x3c, 0x4b, 0x08, 0xb7, 0xda, 0xc4, - 0x73, 0xee, 0x2c, 0xf0, 0x7a, 0x0a, 0xe7, 0x48, 0x1a, 0x7c, 0x04, 0x36, 0x22, 0x7c, 0x85, 0x42, - 0x32, 0x25, 0x29, 0x0e, 0x88, 0x59, 0x2e, 0x44, 0x5f, 0x8f, 0xf0, 0x55, 0x57, 0x23, 0xe0, 0xf7, - 0xa0, 0x1e, 0x62, 0x41, 0xb8, 0x40, 0x5e, 0x16, 0x65, 0x21, 0x16, 0x74, 0x4a, 0x50, 0x92, 0x92, - 0x88, 0x66, 0x11, 0x3a, 0x4f, 0xb1, 0x27, 0xcb, 0x6e, 0xae, 0x14, 0x0a, 0xb4, 0x9f, 0x93, 0x5b, - 0x73, 0xf0, 0x30, 0xe7, 0x9e, 0x6a, 0x2c, 0x7c, 0x02, 0x20, 0xb9, 0xf2, 0x26, 0x38, 0x0e, 0x08, - 0x3a, 0x27, 0x44, 0xd7, 0x6c, 0xb5, 0x50, 0xb0, 0xea, 0x8c, 0x74, 0x4a, 0x48, 0x5e, 0xad, 0x00, - 0x98, 0xc4, 0x63, 0xfc, 0x19, 0x17, 0x24, 0x42, 0xe7, 0x59, 0xec, 0x2f, 0xc4, 0xb8, 0x55, 0x28, - 0xc6, 0xee, 0x9c, 0x77, 0x9a, 0xc5, 0xfe, 0x3c, 0x90, 0x0b, 0x76, 0x43, 0xfa, 0x34, 0xa3, 0xbe, - 0xea, 0xd1, 0x85, 0x28, 0x6b, 0x85, 0xa2, 0xdc, 0x5e, 0x80, 0xcd, 0x63, 0x7c, 0x0b, 0xf6, 0x12, - 0x9c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0x50, 0x6a, 0xf4, 0x7a, 0xef, 0x40, 0xbd, 0x66, - 0x01, 0xd7, 0x6e, 0x6a, 0xd4, 0x23, 0xb0, 0x21, 0x0b, 0x85, 0x52, 0xc2, 0x49, 0x3a, 0x25, 0x4a, - 0xdc, 0x0a, 0x28, 0x87, 0x64, 0x38, 0x39, 0x02, 0x8e, 0xc0, 0xe6, 0xd3, 0x8c, 0x89, 0x6b, 0x66, - 0x31, 0xad, 0xdb, 0x50, 0x90, 0x19, 0xb4, 0x07, 0x00, 0x7f, 0x9a, 0x0a, 0xe4, 0x93, 0x44, 0x4c, - 0x0a, 0xea, 0x5b, 0x45, 0x12, 0xda, 0x12, 0x00, 0xbf, 0x92, 0xfd, 0x43, 0xa5, 0x28, 0x67, 0xa1, - 0xa0, 0x49, 0x48, 0x49, 0x5a, 0x50, 0xcb, 0xb6, 0x15, 0xa7, 0x37, 0xc7, 0xc8, 0x4c, 0x05, 0x13, - 0x72, 0x1c, 0x59, 0x1c, 0x14, 0xd4, 0xac, 0x8a, 0x22, 0x74, 0x59, 0x1c, 0xc0, 0x01, 0x58, 0xcf, - 0x71, 0x7c, 0xc2, 0x52, 0x51, 0x50, 0x9f, 0xf2, 0x8c, 0x46, 0x92, 0x00, 0xbf, 0x01, 0x55, 0x4e, - 0x84, 0x08, 0x49, 0x44, 0x62, 0x81, 0x54, 0xf6, 0x5a, 0x27, 0x8a, 0xf4, 0xfb, 0xf6, 0x35, 0x6b, - 0x28, 0x51, 0xf5, 0x5f, 0xca, 0x60, 0x6d, 0xc8, 0x38, 0x55, 0x3a, 0xfe, 0x11, 0xd8, 0x12, 0x29, - 0xf6, 0x49, 0x8a, 0xb0, 0xef, 0xa7, 0x84, 0xf3, 0xbc, 0xa1, 0x9d, 0xcd, 0xfc, 0xb6, 0x91, 0x5f, - 0xce, 0xbb, 0x7d, 0xf9, 0xff, 0xe9, 0xf6, 0x26, 0x28, 0x73, 0xfa, 0x5d, 0xd1, 0xbe, 0x53, 0xbe, - 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f6, 0xc0, 0x6e, 0xbb, 0xe3, 0x9c, 0xb4, 0xc6, 0x9d, 0x41, - 0x1f, 0x9d, 0xf5, 0x47, 0xc3, 0x93, 0x56, 0xe7, 0xb4, 0x73, 0xd2, 0xae, 0x2e, 0xc1, 0x35, 0x50, - 0xee, 0x0e, 0xfa, 0x0f, 0xab, 0x06, 0xac, 0x80, 0x95, 0xd1, 0x17, 0x03, 0x67, 0x5c, 0x5d, 0xbe, - 0x17, 0x80, 0xad, 0xf1, 0x25, 0x4e, 0x5a, 0x38, 0xf4, 0x06, 0x89, 0x22, 0x1c, 0x80, 0x0f, 0xc6, - 0x8f, 0x1b, 0x43, 0xd4, 0x6a, 0x74, 0x5b, 0x68, 0x30, 0xfc, 0x7b, 0xd0, 0x68, 0x38, 0x18, 0x57, - 0x0d, 0xb8, 0x03, 0xaa, 0x8f, 0xce, 0x06, 0xe3, 0x13, 0xd4, 0x18, 0x8d, 0x4e, 0xc6, 0x68, 0xf4, - 0xb8, 0x31, 0xac, 0x2e, 0xc3, 0xdb, 0x60, 0xbb, 0xd9, 0x18, 0xdd, 0xb8, 0x2c, 0x35, 0x1f, 0x3e, - 0x7f, 0x5d, 0x33, 0x5e, 0xbc, 0xae, 0x19, 0x7f, 0xbe, 0xae, 0x19, 0x3f, 0xbd, 0xa9, 0x2d, 0xbd, - 0x78, 0x53, 0x5b, 0xfa, 0xfd, 0x4d, 0x6d, 0xe9, 0xeb, 0xfb, 0xff, 0x36, 0x81, 0xb3, 0x3f, 0x01, - 0xea, 0xe5, 0xdd, 0x55, 0xb5, 0xc5, 0x3f, 0xfb, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x17, 0xec, 0xac, - 0x5e, 0x23, 0x0c, 0x00, 0x00, + // 1197 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0x4d, 0x6f, 0xdb, 0x46, + 0x13, 0xc7, 0x4d, 0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x46, 0x6e, 0xcf, 0xc1, 0xc3, 0x8c, 0x7b, 0x92, 0x63, 0xe1, 0x53, 0x00, 0xc9, 0x95, 0x37, 0xc1, + 0x71, 0x40, 0xd0, 0x39, 0x21, 0x79, 0xcd, 0x56, 0x0b, 0x05, 0xab, 0xcd, 0x48, 0x27, 0x84, 0x64, + 0xd5, 0x0a, 0x80, 0x49, 0x3c, 0x26, 0x9e, 0x0b, 0x49, 0x22, 0x74, 0x9e, 0xc6, 0xfe, 0x42, 0x8c, + 0x5b, 0x85, 0x62, 0xec, 0xcc, 0x79, 0x27, 0x69, 0xec, 0xcf, 0x03, 0xb9, 0x60, 0x27, 0xa4, 0xcf, + 0x52, 0xea, 0xeb, 0x1e, 0x5d, 0x88, 0xb2, 0x56, 0x28, 0xca, 0xed, 0x05, 0xd8, 0x3c, 0xc6, 0x57, + 0x60, 0x37, 0xc1, 0x5c, 0x52, 0x1c, 0xa2, 0xc5, 0x58, 0x59, 0x9c, 0x4a, 0xa1, 0x38, 0xff, 0xcd, + 0x81, 0xdd, 0x6b, 0x5e, 0x16, 0xeb, 0x10, 0xec, 0xa8, 0x72, 0xd1, 0x38, 0x50, 0x7c, 0x82, 0x48, + 0xc2, 0xbc, 0x09, 0xa2, 0xbe, 0x09, 0x54, 0x1c, 0x07, 0xe6, 0x46, 0x07, 0x4b, 0x72, 0xac, 0x4c, + 0xa7, 0x3e, 0x3c, 0x03, 0xdb, 0xf2, 0x12, 0x27, 0x28, 0x64, 0xec, 0xc2, 0xc5, 0xde, 0x05, 0xba, + 0xa4, 0xb1, 0xcf, 0x2e, 0xcd, 0xea, 0xbe, 0x71, 0x50, 0x3d, 0xda, 0xb5, 0xb2, 0x81, 0xb6, 0x66, + 0x03, 0x6d, 0x75, 0xf2, 0x81, 0x6e, 0xad, 0xa9, 0xa4, 0xbf, 0x7f, 0xbd, 0x67, 0x38, 0x50, 0x01, + 0xba, 0xb9, 0xff, 0x63, 0xed, 0x0e, 0x4f, 0x41, 0x2d, 0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06, 0xe3, 0x63, + 0xd4, 0x1c, 0x8d, 0x8e, 0xc7, 0x68, 0xf4, 0xb8, 0x39, 0xac, 0x2d, 0xc3, 0xdb, 0x60, 0xab, 0xd5, + 0x1c, 0xdd, 0xb8, 0x59, 0x6a, 0x3d, 0x7c, 0xf1, 0xa6, 0x6e, 0xbc, 0x7c, 0x53, 0x37, 0x7e, 0x7d, + 0x53, 0x37, 0xbe, 0x7b, 0x5b, 0x5f, 0x7a, 0xf9, 0xb6, 0xbe, 0xf4, 0xf3, 0xdb, 0xfa, 0xd2, 0x93, + 0xfb, 0x7f, 0x35, 0x81, 0xb3, 0x1f, 0x18, 0xfa, 0xe5, 0xdd, 0x55, 0xfd, 0x85, 0xf0, 0xc9, 0xef, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0xfe, 0x66, 0xfb, 0x7f, 0x0c, 0x00, 0x00, } func (m *Market) Marshal() (dAtA []byte, err error) { @@ -600,6 +604,16 @@ func (m *Market) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.OraclePair.Size() + i -= size + if _, err := m.OraclePair.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a if m.Version != 0 { i = encodeVarintState(dAtA, i, uint64(m.Version)) i-- @@ -1083,6 +1097,8 @@ func (m *Market) Size() (n int) { if m.Version != 0 { n += 1 + sovState(uint64(m.Version)) } + l = m.OraclePair.Size() + n += 1 + l + sovState(uint64(l)) return n } @@ -1662,6 +1678,40 @@ func (m *Market) Unmarshal(dAtA []byte) error { break } } + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OraclePair", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OraclePair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) diff --git a/x/sudo/types/state.pb.go b/x/sudo/types/state.pb.go index 033a1c4b9..99b71715a 100644 --- a/x/sudo/types/state.pb.go +++ b/x/sudo/types/state.pb.go @@ -63,7 +63,7 @@ func (m *Sudoers) XXX_DiscardUnknown() { var xxx_messageInfo_Sudoers proto.InternalMessageInfo -func (m *Sudoers) GetRootAddr() string { +func (m *Sudoers) GetRoot() string { if m != nil { return m.Root }