From 1b5c83654bfaeaa06b88b6971f8a7631c712248b Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Tue, 28 Nov 2023 11:13:48 -0600 Subject: [PATCH] add events for logging purposes --- proto/nibiru/perp/v2/event.proto | 24 + x/perp/v2/integration/action/market.go | 4 +- x/perp/v2/keeper/admin.go | 2 +- x/perp/v2/keeper/amm.go | 49 +- x/perp/v2/keeper/amm_test.go | 22 +- x/perp/v2/keeper/clearing_house_test.go | 23 +- x/perp/v2/keeper/msg_server.go | 16 +- x/perp/v2/types/event.pb.go | 681 +++++++++++++++++++++--- 8 files changed, 700 insertions(+), 121 deletions(-) diff --git a/proto/nibiru/perp/v2/event.proto b/proto/nibiru/perp/v2/event.proto index f8a6b7a04..4cd8f6cd5 100644 --- a/proto/nibiru/perp/v2/event.proto +++ b/proto/nibiru/perp/v2/event.proto @@ -234,3 +234,27 @@ message MarketUpdatedEvent { // the final state of the market nibiru.perp.v2.Market final_market = 1 [ (gogoproto.nullable) = false ]; } + +message EventShiftPegMultiplier { + string old_peg_multiplier = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string new_peg_multiplier = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin cost_paid = 3 [ (gogoproto.nullable) = false ]; +} + +message EventShiftSwapInvariant { + string old_swap_invariant = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string new_swap_invariant = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + cosmos.base.v1beta1.Coin cost_paid = 3 [ (gogoproto.nullable) = false ]; +} diff --git a/x/perp/v2/integration/action/market.go b/x/perp/v2/integration/action/market.go index 5617181cd..57139755f 100644 --- a/x/perp/v2/integration/action/market.go +++ b/x/perp/v2/integration/action/market.go @@ -153,7 +153,7 @@ func EditPriceMultiplier(pair asset.Pair, newValue sdk.Dec) action.Action { type editSwapInvariant struct { pair asset.Pair - newValue sdk.Dec + newValue sdk.Int } func (e editSwapInvariant) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context, error, bool) { @@ -161,7 +161,7 @@ func (e editSwapInvariant) Do(app *app.NibiruApp, ctx sdk.Context) (sdk.Context, return ctx, err, true } -func EditSwapInvariant(pair asset.Pair, newValue sdk.Dec) action.Action { +func EditSwapInvariant(pair asset.Pair, newValue sdk.Int) action.Action { return editSwapInvariant{ pair: pair, newValue: newValue, diff --git a/x/perp/v2/keeper/admin.go b/x/perp/v2/keeper/admin.go index 3783d0355..f3ee22077 100644 --- a/x/perp/v2/keeper/admin.go +++ b/x/perp/v2/keeper/admin.go @@ -196,7 +196,7 @@ func (k admin) ShiftPegMultiplier( func (k admin) ShiftSwapInvariant( ctx sdk.Context, pair asset.Pair, - newSwapInvariant sdk.Dec, + newSwapInvariant sdk.Int, sender sdk.AccAddress, ) error { if err := k.SudoKeeper.CheckPermissions(sender, ctx); err != nil { diff --git a/x/perp/v2/keeper/amm.go b/x/perp/v2/keeper/amm.go index c8da1be71..7ca0322f7 100644 --- a/x/perp/v2/keeper/amm.go +++ b/x/perp/v2/keeper/amm.go @@ -24,8 +24,9 @@ func (k Keeper) UnsafeShiftPegMultiplier( if err != nil { return err } + oldPriceMult := amm.PriceMultiplier - if newPriceMultiplier.Equal(amm.PriceMultiplier) { + if newPriceMultiplier.Equal(oldPriceMult) { // same price multiplier, no-op return nil } @@ -36,7 +37,7 @@ func (k Keeper) UnsafeShiftPegMultiplier( return err } - err = k.handleMarketUpdateCost(ctx, pair, cost) + costPaid, err := k.handleMarketUpdateCost(ctx, pair, cost) if err != nil { return err } @@ -45,7 +46,11 @@ func (k Keeper) UnsafeShiftPegMultiplier( amm.PriceMultiplier = newPriceMultiplier k.SaveAMM(ctx, amm) - return nil + return ctx.EventManager().EmitTypedEvent(&types.EventShiftPegMultiplier{ + OldPegMultiplier: oldPriceMult, + NewPegMultiplier: newPriceMultiplier, + CostPaid: costPaid, + }) } // UnsafeShiftSwapInvariant: [Without checking x/sudo permissions] Edit the swap @@ -53,7 +58,7 @@ func (k Keeper) UnsafeShiftPegMultiplier( // fund to pay for the operation. These funds get send to the vault to pay for // trader's new net margin. func (k Keeper) UnsafeShiftSwapInvariant( - ctx sdk.Context, pair asset.Pair, newSwapInvariant sdk.Dec, + ctx sdk.Context, pair asset.Pair, newSwapInvariant sdk.Int, ) (err error) { // Get the pool amm, err := k.GetAMM(ctx, pair) @@ -61,33 +66,36 @@ func (k Keeper) UnsafeShiftSwapInvariant( return err } - // Compute cost of re-pegging the pool - cost, err := amm.CalcUpdateSwapInvariantCost(newSwapInvariant) + cost, err := amm.CalcUpdateSwapInvariantCost(newSwapInvariant.ToLegacyDec()) if err != nil { return err } - err = k.handleMarketUpdateCost(ctx, pair, cost) + costPaid, err := k.handleMarketUpdateCost(ctx, pair, cost) if err != nil { return err } - err = amm.UpdateSwapInvariant(newSwapInvariant) + err = amm.UpdateSwapInvariant(newSwapInvariant.ToLegacyDec()) if err != nil { return err } k.SaveAMM(ctx, amm) - return nil + return ctx.EventManager().EmitTypedEvent(&types.EventShiftSwapInvariant{ + OldSwapInvariant: amm.BaseReserve.Mul(amm.QuoteReserve).RoundInt(), + NewSwapInvariant: newSwapInvariant, + CostPaid: costPaid, + }) } func (k Keeper) handleMarketUpdateCost( ctx sdk.Context, pair asset.Pair, costAmt sdkmath.Int, -) (err error) { +) (costPaid sdk.Coin, err error) { collateral, err := k.Collateral.Get(ctx) if err != nil { - return err + return costPaid, err } if costAmt.IsPositive() { @@ -102,11 +110,13 @@ func (k Keeper) handleMarketUpdateCost( cost, ) if err != nil { - return types.ErrNotEnoughFundToPayAction.Wrapf( + return costPaid, types.ErrNotEnoughFundToPayAction.Wrapf( "not enough fund in perp ef to pay for repeg, need %s got %s", cost.String(), k.BankKeeper.GetBalance(ctx, k.AccountKeeper.GetModuleAddress(types.PerpEFModuleAccount), collateral).String(), ) + } else { + costPaid = cost[0] } } else if costAmt.IsNegative() { // Negative cost, send from margin vault to perp ef. @@ -119,13 +129,18 @@ func (k Keeper) handleMarketUpdateCost( ), ) if err != nil { // nolint:staticcheck - // if there's no money in margin to pay for the repeg, we still repeg. It's surprising if it's - // happening on mainnet, but it's not a problem. - // It means there's bad debt in the system, and it's preventing to pay for the repeg down. But the bad debt - // end up being paid up by the perp EF anyway. + costPaid = sdk.NewInt64Coin(collateral, 0) + // Explanation: If there's no money in the vault to pay for the + // operation, the execution should still be successful. It's + // surprising if it's happening on mainnet, but it's not a problem. + // It means there's bad debt in the system, and it's preventing to + // pay for the repeg down. But the bad debt end up being paid up by + // the perp EF anyway. + } else { + costPaid = sdk.NewCoin(collateral, costAmt.Abs()) } } - return nil + return costPaid, nil } // GetMarket returns the market that is enabled. It is the last version of the market. diff --git a/x/perp/v2/keeper/amm_test.go b/x/perp/v2/keeper/amm_test.go index 7dc0b967a..06d0caee9 100644 --- a/x/perp/v2/keeper/amm_test.go +++ b/x/perp/v2/keeper/amm_test.go @@ -255,11 +255,11 @@ func TestUnsafeShiftSwapInvariant_Fail(t *testing.T) { require.NoError(t, err) // Error because of invalid price multiplier - err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, asset.MustNewPair("luna:usdt"), sdk.NewDec(-1)) + err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, asset.MustNewPair("luna:usdt"), sdk.NewInt(-1)) require.ErrorContains(t, err, "market luna:usdt not found") // Error because of invalid price multiplier - err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewDec(-1)) + err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewInt(-1)) require.ErrorIs(t, err, types.ErrNonPositiveSwapInvariant) // Add market activity @@ -281,15 +281,15 @@ func TestUnsafeShiftSwapInvariant_Fail(t *testing.T) { require.NoError(t, err) // Error because no money in perp ef fund - err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewDec(2_000_000)) + err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewInt(2_000_000)) require.ErrorContains(t, err, "not enough fund in perp ef to pay for repeg") // Fail at validate - err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewDec(0)) + err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewInt(0)) require.ErrorContains(t, err, "swap multiplier must be > 0") // Works because it goes in the other way - err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewDec(500_000)) + err = app.PerpKeeperV2.Admin.UnsafeShiftSwapInvariant(ctx, pair, sdk.NewInt(500_000)) require.NoError(t, err) } @@ -308,7 +308,7 @@ func TestUnsafeShiftSwapInvariant(t *testing.T) { FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)))), ). When( - EditSwapInvariant(pair, sdk.NewDec(1e12)), + EditSwapInvariant(pair, sdk.NewInt(1e12)), ). Then( ModuleBalanceEqual(types.VaultModuleAccount, types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)), @@ -332,7 +332,7 @@ func TestUnsafeShiftSwapInvariant(t *testing.T) { FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)))), ). When( - EditSwapInvariant(pair, sdk.NewDec(1e18)), + EditSwapInvariant(pair, sdk.NewInt(1e18)), ). Then( ModuleBalanceEqual(types.VaultModuleAccount, types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)), @@ -352,7 +352,7 @@ func TestUnsafeShiftSwapInvariant(t *testing.T) { FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)))), ). When( - EditSwapInvariant(pair, sdk.NewDec(1e14)), + EditSwapInvariant(pair, sdk.NewInt(1e14)), ). Then( ModuleBalanceEqual(types.VaultModuleAccount, types.TestingCollateralDenomNUSD, sdk.NewInt(1008101)), @@ -372,7 +372,7 @@ func TestUnsafeShiftSwapInvariant(t *testing.T) { FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)))), ). When( - EditSwapInvariant(pair, sdk.NewDec(1e6)), + EditSwapInvariant(pair, sdk.NewInt(1e6)), ). Then( ModuleBalanceEqual(types.VaultModuleAccount, types.TestingCollateralDenomNUSD, sdk.NewInt(999991)), @@ -392,7 +392,7 @@ func TestUnsafeShiftSwapInvariant(t *testing.T) { FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)))), ). When( - EditSwapInvariant(pair, sdk.NewDec(1e14)), + EditSwapInvariant(pair, sdk.NewInt(1e14)), ). Then( ModuleBalanceEqual(types.VaultModuleAccount, types.TestingCollateralDenomNUSD, sdk.NewInt(1010102)), @@ -412,7 +412,7 @@ func TestUnsafeShiftSwapInvariant(t *testing.T) { FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(1e6)))), ). When( - EditSwapInvariant(pair, sdk.NewDec(1e6)), + EditSwapInvariant(pair, sdk.NewInt(1e6)), ). Then( ModuleBalanceEqual(types.VaultModuleAccount, types.TestingCollateralDenomNUSD, sdk.NewInt(999989)), diff --git a/x/perp/v2/keeper/clearing_house_test.go b/x/perp/v2/keeper/clearing_house_test.go index 270b1dba2..f8d587864 100644 --- a/x/perp/v2/keeper/clearing_house_test.go +++ b/x/perp/v2/keeper/clearing_house_test.go @@ -48,7 +48,7 @@ func TestMarketOrder(t *testing.T) { MarketOrder(alice, pairBtcNusd, types.Direction_SHORT, sdk.NewInt(10_000), sdk.OneDec(), sdk.ZeroDec()), MarketOrder(bob, pairBtcNusd, types.Direction_LONG, sdk.NewInt(10_000), sdk.OneDec(), sdk.ZeroDec()), - EditSwapInvariant(pairBtcNusd, sdk.OneDec()), + EditSwapInvariant(pairBtcNusd, sdk.NewInt(1)), ). When( PartialCloseFails(alice, pairBtcNusd, sdk.NewDec(5_000), types.ErrBaseReserveAtZero), @@ -264,7 +264,7 @@ func TestMarketOrder(t *testing.T) { FundAccount(alice, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(10_000)))), MarketOrder(alice, pairBtcNusd, types.Direction_LONG, sdk.NewInt(9_000), sdk.NewDec(10), sdk.ZeroDec()), FundModule(types.PerpEFModuleAccount, sdk.NewCoins(sdk.NewCoin(types.TestingCollateralDenomNUSD, sdk.NewInt(100_000_000)))), - EditSwapInvariant(pairBtcNusd, sdk.OneDec()), + EditSwapInvariant(pairBtcNusd, sdk.NewInt(1)), ). When( ClosePosition(alice, pairBtcNusd), @@ -1956,7 +1956,7 @@ func TestUpdateSwapInvariant(t *testing.T) { pairBtcNusd := asset.Registry.Pair(denoms.BTC, denoms.NUSD) startBlockTime := time.Now() - startingSwapInvariant := sdk.NewDec(1_000_000_000_000).Mul(sdk.NewDec(1_000_000_000_000)) + startingSwapInvariant := sdk.NewInt(1e12).Mul(sdk.NewInt(1e12)) tc := TestCases{ TC("only long position - no change to swap invariant"). @@ -1999,7 +1999,7 @@ func TestUpdateSwapInvariant(t *testing.T) { ). When( MarketOrder(alice, pairBtcNusd, types.Direction_LONG, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.ZeroDec()), - EditSwapInvariant(pairBtcNusd, startingSwapInvariant.MulInt64(100)), + EditSwapInvariant(pairBtcNusd, startingSwapInvariant.MulRaw(100)), AMMShouldBeEqual( pairBtcNusd, AMM_SwapInvariantShouldBeEqual(sdk.MustNewDecFromStr("99999999999999999999999999.999999000000000000"))), @@ -2019,7 +2019,7 @@ func TestUpdateSwapInvariant(t *testing.T) { ). When( MarketOrder(alice, pairBtcNusd, types.Direction_SHORT, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.ZeroDec()), - EditSwapInvariant(pairBtcNusd, startingSwapInvariant.MulInt64(100)), + EditSwapInvariant(pairBtcNusd, startingSwapInvariant.MulRaw(100)), AMMShouldBeEqual( pairBtcNusd, AMM_SwapInvariantShouldBeEqual(sdk.MustNewDecFromStr("99999999999999999999999999.999999000000000000"))), @@ -2040,7 +2040,9 @@ func TestUpdateSwapInvariant(t *testing.T) { ). When( MarketOrder(alice, pairBtcNusd, types.Direction_LONG, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.ZeroDec()), - EditSwapInvariant(pairBtcNusd, startingSwapInvariant.Mul(sdk.MustNewDecFromStr("0.1"))), + EditSwapInvariant( + pairBtcNusd, + startingSwapInvariant.QuoRaw(10)), AMMShouldBeEqual( pairBtcNusd, AMM_SwapInvariantShouldBeEqual(sdk.MustNewDecFromStr("99999999999999999873578.871987715651277660"))), @@ -2060,7 +2062,8 @@ func TestUpdateSwapInvariant(t *testing.T) { ). When( MarketOrder(alice, pairBtcNusd, types.Direction_SHORT, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.ZeroDec()), - EditSwapInvariant(pairBtcNusd, startingSwapInvariant.Mul(sdk.MustNewDecFromStr("0.1"))), + EditSwapInvariant(pairBtcNusd, + startingSwapInvariant.QuoRaw(10)), AMMShouldBeEqual( pairBtcNusd, AMM_SwapInvariantShouldBeEqual(sdk.MustNewDecFromStr("99999999999999999873578.871987801032774485"))), @@ -2083,7 +2086,8 @@ func TestUpdateSwapInvariant(t *testing.T) { MarketOrder(alice, pairBtcNusd, types.Direction_LONG, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.ZeroDec()), MarketOrder(bob, pairBtcNusd, types.Direction_SHORT, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.NewDec(10_000_000_000_000)), - EditSwapInvariant(pairBtcNusd, startingSwapInvariant.MulInt64(100)), + EditSwapInvariant(pairBtcNusd, + startingSwapInvariant.MulRaw(100)), AMMShouldBeEqual( pairBtcNusd, AMM_BiasShouldBeEqual(sdk.ZeroDec()), @@ -2114,7 +2118,8 @@ func TestUpdateSwapInvariant(t *testing.T) { MarketOrder(alice, pairBtcNusd, types.Direction_LONG, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.ZeroDec()), MarketOrder(bob, pairBtcNusd, types.Direction_SHORT, sdk.NewInt(10_000_000_000), sdk.OneDec(), sdk.NewDec(10_000_000_000_000)), - EditSwapInvariant(pairBtcNusd, startingSwapInvariant.Mul(sdk.MustNewDecFromStr("0.1"))), + EditSwapInvariant(pairBtcNusd, + startingSwapInvariant.QuoRaw(10)), AMMShouldBeEqual( pairBtcNusd, AMM_BiasShouldBeEqual(sdk.ZeroDec()), diff --git a/x/perp/v2/keeper/msg_server.go b/x/perp/v2/keeper/msg_server.go index 303d47471..9add4d5ca 100644 --- a/x/perp/v2/keeper/msg_server.go +++ b/x/perp/v2/keeper/msg_server.go @@ -194,12 +194,10 @@ func (m msgServer) WithdrawEpochRebates(ctx context.Context, msg *types.MsgWithd func (m msgServer) ShiftPegMultiplier( goCtx context.Context, msg *types.MsgShiftPegMultiplier, ) (*types.MsgShiftPegMultiplierResponse, error) { - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } + // The `msg` here is checked with ValidateBasic before this fn is called. + sender, _ := sdk.AccAddressFromBech32(msg.Sender) ctx := sdk.UnwrapSDKContext(goCtx) - err = m.k.Admin.ShiftPegMultiplier(ctx, msg.Pair, msg.NewPegMult, sender) + err := m.k.Admin.ShiftPegMultiplier(ctx, msg.Pair, msg.NewPegMult, sender) return &types.MsgShiftPegMultiplierResponse{}, err } @@ -208,11 +206,9 @@ func (m msgServer) ShiftPegMultiplier( func (m msgServer) ShiftSwapInvariant( goCtx context.Context, msg *types.MsgShiftSwapInvariant, ) (*types.MsgShiftSwapInvariantResponse, error) { - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } + // The `msg` here is checked with ValidateBasic before this fn is called. + sender, _ := sdk.AccAddressFromBech32(msg.Sender) ctx := sdk.UnwrapSDKContext(goCtx) - err = m.k.Admin.ShiftSwapInvariant(ctx, msg.Pair, msg.NewSwapInvariant.ToLegacyDec(), sender) + err := m.k.Admin.ShiftSwapInvariant(ctx, msg.Pair, msg.NewSwapInvariant, sender) return &types.MsgShiftSwapInvariantResponse{}, err } diff --git a/x/perp/v2/types/event.pb.go b/x/perp/v2/types/event.pb.go index 598fae243..3a2e1756c 100644 --- a/x/perp/v2/types/event.pb.go +++ b/x/perp/v2/types/event.pb.go @@ -523,6 +523,98 @@ func (m *MarketUpdatedEvent) GetFinalMarket() Market { return Market{} } +type EventShiftPegMultiplier struct { + OldPegMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=old_peg_multiplier,json=oldPegMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"old_peg_multiplier"` + NewPegMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=new_peg_multiplier,json=newPegMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"new_peg_multiplier"` + CostPaid types.Coin `protobuf:"bytes,3,opt,name=cost_paid,json=costPaid,proto3" json:"cost_paid"` +} + +func (m *EventShiftPegMultiplier) Reset() { *m = EventShiftPegMultiplier{} } +func (m *EventShiftPegMultiplier) String() string { return proto.CompactTextString(m) } +func (*EventShiftPegMultiplier) ProtoMessage() {} +func (*EventShiftPegMultiplier) Descriptor() ([]byte, []int) { + return fileDescriptor_a5313bbc89fa31dd, []int{7} +} +func (m *EventShiftPegMultiplier) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventShiftPegMultiplier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventShiftPegMultiplier.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventShiftPegMultiplier) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventShiftPegMultiplier.Merge(m, src) +} +func (m *EventShiftPegMultiplier) XXX_Size() int { + return m.Size() +} +func (m *EventShiftPegMultiplier) XXX_DiscardUnknown() { + xxx_messageInfo_EventShiftPegMultiplier.DiscardUnknown(m) +} + +var xxx_messageInfo_EventShiftPegMultiplier proto.InternalMessageInfo + +func (m *EventShiftPegMultiplier) GetCostPaid() types.Coin { + if m != nil { + return m.CostPaid + } + return types.Coin{} +} + +type EventShiftSwapInvariant struct { + OldSwapInvariant github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=old_swap_invariant,json=oldSwapInvariant,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"old_swap_invariant"` + NewSwapInvariant github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=new_swap_invariant,json=newSwapInvariant,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"new_swap_invariant"` + CostPaid types.Coin `protobuf:"bytes,3,opt,name=cost_paid,json=costPaid,proto3" json:"cost_paid"` +} + +func (m *EventShiftSwapInvariant) Reset() { *m = EventShiftSwapInvariant{} } +func (m *EventShiftSwapInvariant) String() string { return proto.CompactTextString(m) } +func (*EventShiftSwapInvariant) ProtoMessage() {} +func (*EventShiftSwapInvariant) Descriptor() ([]byte, []int) { + return fileDescriptor_a5313bbc89fa31dd, []int{8} +} +func (m *EventShiftSwapInvariant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventShiftSwapInvariant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventShiftSwapInvariant.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventShiftSwapInvariant) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventShiftSwapInvariant.Merge(m, src) +} +func (m *EventShiftSwapInvariant) XXX_Size() int { + return m.Size() +} +func (m *EventShiftSwapInvariant) XXX_DiscardUnknown() { + xxx_messageInfo_EventShiftSwapInvariant.DiscardUnknown(m) +} + +var xxx_messageInfo_EventShiftSwapInvariant proto.InternalMessageInfo + +func (m *EventShiftSwapInvariant) GetCostPaid() types.Coin { + if m != nil { + return m.CostPaid + } + return types.Coin{} +} + func init() { proto.RegisterEnum("nibiru.perp.v2.LiquidationFailedEvent_LiquidationFailedReason", LiquidationFailedEvent_LiquidationFailedReason_name, LiquidationFailedEvent_LiquidationFailedReason_value) proto.RegisterType((*PositionChangedEvent)(nil), "nibiru.perp.v2.PositionChangedEvent") @@ -532,82 +624,91 @@ func init() { proto.RegisterType((*LiquidationFailedEvent)(nil), "nibiru.perp.v2.LiquidationFailedEvent") proto.RegisterType((*AmmUpdatedEvent)(nil), "nibiru.perp.v2.AmmUpdatedEvent") proto.RegisterType((*MarketUpdatedEvent)(nil), "nibiru.perp.v2.MarketUpdatedEvent") + proto.RegisterType((*EventShiftPegMultiplier)(nil), "nibiru.perp.v2.EventShiftPegMultiplier") + proto.RegisterType((*EventShiftSwapInvariant)(nil), "nibiru.perp.v2.EventShiftSwapInvariant") } func init() { proto.RegisterFile("nibiru/perp/v2/event.proto", fileDescriptor_a5313bbc89fa31dd) } var fileDescriptor_a5313bbc89fa31dd = []byte{ - // 1109 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x96, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xc0, 0xe3, 0xb8, 0xa4, 0xcd, 0xf8, 0x6f, 0x06, 0x93, 0x6e, 0x43, 0xe5, 0x84, 0x55, 0x41, - 0xb9, 0x64, 0x57, 0x09, 0x12, 0x52, 0x7b, 0x00, 0x39, 0x89, 0x43, 0x2c, 0x25, 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69, 0x39, - 0x93, 0x48, 0x9b, 0x7b, 0xcd, 0xfa, 0x93, 0xc6, 0x7e, 0xbb, 0xde, 0x6c, 0xbb, 0xad, 0x5a, 0xc3, - 0x29, 0x4f, 0x43, 0x03, 0x54, 0x46, 0xa4, 0xda, 0xae, 0x9c, 0x35, 0xff, 0xca, 0x80, 0x52, 0x2d, - 0x0c, 0x0f, 0xa2, 0xa1, 0x7d, 0xff, 0x11, 0x98, 0x55, 0x5f, 0x59, 0x28, 0x0c, 0xf5, 0x8a, 0x7f, - 0x7b, 0x3c, 0xc1, 0xda, 0xee, 0xae, 0xde, 0xe8, 0x77, 0xe4, 0xd9, 0x5a, 0x18, 0xfe, 0xff, 0x86, - 0xc6, 0x3c, 0x00, 0x70, 0x17, 0xc5, 0x47, 0x58, 0x8c, 0xe4, 0xff, 0x09, 0xc8, 0xab, 0xfc, 0x43, - 0xa9, 0xd3, 0x25, 0x98, 0x1f, 0x2f, 0x81, 0xb2, 0xd4, 0x55, 0xc8, 0x49, 0x0b, 0x2d, 0xfa, 0xf4, - 0xf9, 0x45, 0x35, 0xf3, 0xe2, 0xa2, 0x9a, 0xf9, 0xf5, 0xa2, 0x9a, 0xf9, 0xfe, 0xb2, 0x3a, 0xf5, - 0xe2, 0xb2, 0x3a, 0xf5, 0xd3, 0x65, 0x75, 0xea, 0x8b, 0x95, 0x9b, 0x3a, 0x35, 0xfd, 0x5e, 0x96, - 0x31, 0x7b, 0x33, 0xf2, 0x7b, 0xf8, 0xc3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xe7, 0x3a, - 0x1d, 0xce, 0x0b, 0x00, 0x00, + // 1230 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0xe3, 0xb8, 0xa4, 0xcd, 0xc4, 0xb1, 0x9d, 0xc1, 0x24,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 0x74, 0x23, 0x42, + 0xfd, 0xb3, 0xef, 0x5b, 0x5d, 0x1e, 0xc9, 0x8e, 0x26, 0xa1, 0xfe, 0x84, 0x2a, 0xad, 0x01, 0x89, + 0xea, 0xec, 0x88, 0xc4, 0x94, 0x30, 0x99, 0xa9, 0x22, 0x06, 0x24, 0x72, 0x69, 0x66, 0x9d, 0x42, + 0x95, 0xe4, 0x4b, 0x2e, 0x51, 0xe5, 0x14, 0x3d, 0x51, 0x65, 0x82, 0x3e, 0x3b, 0x1d, 0x9d, 0xc1, + 0x60, 0x9c, 0xfe, 0x8f, 0x54, 0xd9, 0xfa, 0xe8, 0xf1, 0xb3, 0x6a, 0xee, 0xc9, 0xb3, 0x6a, 0xee, + 0x97, 0x67, 0xd5, 0xdc, 0xb7, 0xcf, 0xab, 0x33, 0x4f, 0x9e, 0x57, 0x67, 0x7e, 0x7c, 0x5e, 0x9d, + 0xf9, 0xf4, 0xfa, 0x59, 0x53, 0x2d, 0xfb, 0x6d, 0xa5, 0x92, 0xeb, 0xcc, 0xa9, 0xdf, 0x4e, 0xef, + 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x50, 0x37, 0x90, 0x96, 0xfa, 0x0d, 0x00, 0x00, } func (m *PositionChangedEvent) Marshal() (dAtA []byte, err error) { @@ -1063,6 +1164,112 @@ func (m *MarketUpdatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventShiftPegMultiplier) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventShiftPegMultiplier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventShiftPegMultiplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.CostPaid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.NewPegMultiplier.Size() + i -= size + if _, err := m.NewPegMultiplier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.OldPegMultiplier.Size() + i -= size + if _, err := m.OldPegMultiplier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *EventShiftSwapInvariant) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventShiftSwapInvariant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventShiftSwapInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.CostPaid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.NewSwapInvariant.Size() + i -= size + if _, err := m.NewSwapInvariant.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.OldSwapInvariant.Size() + i -= size + if _, err := m.OldSwapInvariant.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { offset -= sovEvent(v) base := offset @@ -1213,6 +1420,36 @@ func (m *MarketUpdatedEvent) Size() (n int) { return n } +func (m *EventShiftPegMultiplier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.OldPegMultiplier.Size() + n += 1 + l + sovEvent(uint64(l)) + l = m.NewPegMultiplier.Size() + n += 1 + l + sovEvent(uint64(l)) + l = m.CostPaid.Size() + n += 1 + l + sovEvent(uint64(l)) + return n +} + +func (m *EventShiftSwapInvariant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.OldSwapInvariant.Size() + n += 1 + l + sovEvent(uint64(l)) + l = m.NewSwapInvariant.Size() + n += 1 + l + sovEvent(uint64(l)) + l = m.CostPaid.Size() + n += 1 + l + sovEvent(uint64(l)) + return n +} + func sovEvent(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2577,6 +2814,308 @@ func (m *MarketUpdatedEvent) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventShiftPegMultiplier) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventShiftPegMultiplier: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventShiftPegMultiplier: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldPegMultiplier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OldPegMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPegMultiplier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NewPegMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CostPaid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CostPaid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventShiftSwapInvariant) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventShiftSwapInvariant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventShiftSwapInvariant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldSwapInvariant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.OldSwapInvariant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewSwapInvariant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NewSwapInvariant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CostPaid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CostPaid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0