From 3e0917aa3ba956d0cd1bf4eec1e666fa8b48a903 Mon Sep 17 00:00:00 2001 From: sampocs Date: Tue, 28 Nov 2023 18:26:23 -0600 Subject: [PATCH] phase 2 - added trade config (#995) --- proto/stride/stakeibc/trade_route.proto | 51 +- proto/stride/stakeibc/tx.proto | 65 +- x/stakeibc/client/cli/tx.go | 2 - .../client/cli/tx_delete_trade_route.go | 44 -- .../client/cli/tx_update_trade_route.go | 62 -- x/stakeibc/keeper/icqcallbacks_pool_price.go | 8 +- .../keeper/msg_server_create_trade_route.go | 33 +- .../keeper/msg_server_delete_trade_route.go | 27 +- .../keeper/msg_server_update_trade_route.go | 49 +- x/stakeibc/keeper/reward_converter.go | 22 +- x/stakeibc/keeper/trade_route.go | 2 + x/stakeibc/keeper/trade_route_test.go | 19 +- x/stakeibc/types/errors.go | 1 + .../types/message_create_trade_route.go | 11 +- .../types/message_delete_trade_route.go | 37 +- .../types/message_update_trade_route.go | 67 ++- x/stakeibc/types/trade_route.go | 2 +- x/stakeibc/types/trade_route.pb.go | 547 +++++++++++------ x/stakeibc/types/tx.pb.go | 566 ++++++++++-------- 19 files changed, 932 insertions(+), 683 deletions(-) delete mode 100644 x/stakeibc/client/cli/tx_delete_trade_route.go delete mode 100644 x/stakeibc/client/cli/tx_update_trade_route.go diff --git a/proto/stride/stakeibc/trade_route.proto b/proto/stride/stakeibc/trade_route.proto index f8f45f93cc..a19341cc2b 100644 --- a/proto/stride/stakeibc/trade_route.proto +++ b/proto/stride/stakeibc/trade_route.proto @@ -16,27 +16,8 @@ message TradeHop { ICAAccount to_account = 3 [ (gogoproto.nullable) = false ]; } -// TradeRoute represents a round trip including info on transfer and how to do -// the swap. It makes the assumption that the reward token is always foreign to -// the host so therefore the first two hops are to unwind the ibc denom enroute -// to the trade chain and the last hop is the return so funds start/end in the -// withdrawl ICA on hostZone -message TradeRoute { - // ibc denom for the reward on the host zone - string reward_denom_on_host_zone = 1; - // should be the native denom for the reward chain - string reward_denom_on_reward_zone = 2; - // ibc denom of the reward on the trade chain, input to the swap - string reward_denom_on_trade_zone = 3; - // ibc of the host denom on the trade chain, output from the swap - string host_denom_on_trade_zone = 4; - // should be the same as the native host denom on the host chain - string host_denom_on_host_zone = 5; - - TradeHop host_to_reward_hop = 6 [ (gogoproto.nullable) = false ]; - TradeHop reward_to_trade_hop = 7 [ (gogoproto.nullable) = false ]; - TradeHop trade_to_host_hop = 8 [ (gogoproto.nullable) = false ]; - +// Stores pool information needed to execute the swap along a trade route +message TradeConfig { // Currently Osmosis is the only trade chain so this is an osmosis pool id uint64 pool_id = 9; @@ -72,3 +53,31 @@ message TradeRoute { (gogoproto.nullable) = false ]; } + +// TradeRoute represents a round trip including info on transfer and how to do +// the swap. It makes the assumption that the reward token is always foreign to +// the host so therefore the first two hops are to unwind the ibc denom enroute +// to the trade chain and the last hop is the return so funds start/end in the +// withdrawl ICA on hostZone +// The structure is key'd on reward denom and host denom in their native forms +// (i.e. reward_denom_on_reward_zone and host_denom_on_host_zone) +message TradeRoute { + // ibc denom for the reward on the host zone + string reward_denom_on_host_zone = 1; + // should be the native denom for the reward chain + string reward_denom_on_reward_zone = 2; + // ibc denom of the reward on the trade chain, input to the swap + string reward_denom_on_trade_zone = 3; + // ibc of the host denom on the trade chain, output from the swap + string host_denom_on_trade_zone = 4; + // should be the same as the native host denom on the host chain + string host_denom_on_host_zone = 5; + + TradeHop host_to_reward_hop = 6 [ (gogoproto.nullable) = false ]; + TradeHop reward_to_trade_hop = 7 [ (gogoproto.nullable) = false ]; + TradeHop trade_to_host_hop = 8 [ (gogoproto.nullable) = false ]; + + // specifies the configuration needed to execute the swap + // such as pool_id, slippage, min trade amount, etc. + TradeConfig trade_config = 9 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/stride/stakeibc/tx.proto b/proto/stride/stakeibc/tx.proto index 05efd50ea0..cae677fc38 100644 --- a/proto/stride/stakeibc/tx.proto +++ b/proto/stride/stakeibc/tx.proto @@ -211,6 +211,7 @@ message MsgResumeHostZone { } message MsgResumeHostZoneResponse {} +// Creates a new trade route message MsgCreateTradeRoute { option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "stride/x/stakeibc/MsgCreateTradeRoute"; @@ -251,31 +252,69 @@ message MsgCreateTradeRoute { // from the current value string max_allowed_swap_loss_rate = 14; - // min and max set boundaries of reward denom on trade chain we will swap - uint64 min_swap_amount = 15; - uint64 max_swap_amount = 16; + // minimum amount of reward tokens to initate a swap + // if not provided, defaults to 0 + string min_swap_amount = 15 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // maximum amount of reward tokens in a single swap + // if not provided, defaults to 10e24 + string max_swap_amount = 16 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; } message MsgCreateTradeRouteResponse {} +// Deletes a trade route message MsgDeleteTradeRoute { - string creator = 1; - string host_denom = 2; - string reward_denom = 3; + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "stride/x/stakeibc/MsgDeleteTradeRoute"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The reward denom of the route in it's native form (e.g. usdc) + string reward_denom = 2; + // The host zone's denom in it's native form (e.g. dydx) + string host_denom = 3; } message MsgDeleteTradeRouteResponse {} +// Updates the config of a trade route message MsgUpdateTradeRoute { - string creator = 1; - string host_denom = 2; - string reward_denom = 3; + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "stride/x/stakeibc/MsgUpdateTradeRoute"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // The reward denom of the route in it's native form (e.g. usdc) + string reward_denom = 2; + // The host zone's denom in it's native form (e.g. dydx) + string host_denom = 3; + + // The osmosis pool ID uint64 pool_id = 4; - string min_swap_amount = 5 [ - (cosmos_proto.scalar) = "cosmos.Int", + + // Threshold defining the percentage of tokens that could be lost in the trade + // This captures both the loss from slippage and from a stale price on stride + // "0.05" means the output from the trade can be no less than a 5% deviation + // from the current value + string max_allowed_swap_loss_rate = 5; + + // minimum amount of reward tokens to initate a swap + // if not provided, defaults to 0 + string min_swap_amount = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - string max_swap_amount = 6 [ - (cosmos_proto.scalar) = "cosmos.Int", + // maximum amount of reward tokens in a single swap + // if not provided, defaults to 10e24 + string max_swap_amount = 7 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; diff --git a/x/stakeibc/client/cli/tx.go b/x/stakeibc/client/cli/tx.go index 878da08c59..d821f06a5a 100644 --- a/x/stakeibc/client/cli/tx.go +++ b/x/stakeibc/client/cli/tx.go @@ -40,8 +40,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdUndelegateHost()) cmd.AddCommand(CmdUpdateInnerRedemptionRateBounds()) cmd.AddCommand(CmdResumeHostZone()) - cmd.AddCommand(CmdDeleteTradeRoute()) - cmd.AddCommand(CmdUpdateTradeRoute()) return cmd } diff --git a/x/stakeibc/client/cli/tx_delete_trade_route.go b/x/stakeibc/client/cli/tx_delete_trade_route.go deleted file mode 100644 index bc0b32b2b6..0000000000 --- a/x/stakeibc/client/cli/tx_delete_trade_route.go +++ /dev/null @@ -1,44 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - - "github.com/spf13/cobra" - - "github.com/Stride-Labs/stride/v16/x/stakeibc/types" -) - -// The host-denom and reward-denom are not ibc denoms -// these are the native denoms as they appear on their own chains -func CmdDeleteTradeRoute() *cobra.Command { - cmd := &cobra.Command{ - Use: "delete-trade-route [host-denom] [reward-denom]", - Short: "Broadcast message delete-trade-route", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - hostDenom := args[0] - rewardDenom := args[1] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgDeleteTradeRoute( - clientCtx.GetFromAddress().String(), - hostDenom, - rewardDenom, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/stakeibc/client/cli/tx_update_trade_route.go b/x/stakeibc/client/cli/tx_update_trade_route.go deleted file mode 100644 index 7815ace5e3..0000000000 --- a/x/stakeibc/client/cli/tx_update_trade_route.go +++ /dev/null @@ -1,62 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - - "github.com/spf13/cobra" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/Stride-Labs/stride/v16/x/stakeibc/types" -) - -// host-denom and reward-denom are to find which trade route should be updated -// if a match is found, then pool-id and the swap amounts will update on that route -func CmdUpdateTradeRoute() *cobra.Command { - cmd := &cobra.Command{ - Use: "update-trade-route [host-denom] [reward-denom] [pool-id] [min-swap-amount (optional)] [max-swap-amount (optional)]", - Short: "Broadcast message update-trade-route", - Args: cobra.ExactArgs(5), - RunE: func(cmd *cobra.Command, args []string) (err error) { - hostDenom := args[0] - rewardDenom := args[1] - poolId, err := strconv.ParseUint(args[2], 10, 64) - minSwapAmount, found := sdk.NewIntFromString(args[3]) - if !found { - minSwapAmount = sdk.ZeroInt() - } - maxSwapAmount, found := sdk.NewIntFromString(args[4]) - if !found { - const MaxUint = ^uint(0) - const MaxInt = int64(MaxUint >> 1) - maxSwapAmount = sdk.NewInt(MaxInt) - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgUpdateTradeRoute( - clientCtx.GetFromAddress().String(), - hostDenom, - rewardDenom, - poolId, - minSwapAmount, - maxSwapAmount, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/stakeibc/keeper/icqcallbacks_pool_price.go b/x/stakeibc/keeper/icqcallbacks_pool_price.go index 4124410ee3..f3f1ed41f5 100644 --- a/x/stakeibc/keeper/icqcallbacks_pool_price.go +++ b/x/stakeibc/keeper/icqcallbacks_pool_price.go @@ -25,8 +25,8 @@ import ( // P0LastSpotPrice gives the ratio of Asset0Denom / Asset1Denom // P1LastSpotPrice gives the ratio of Asset1Denom / Asset0Denom // -// When storing down the price, we want to store down the ratio of HostDenom. -// Meaning, if Asset0Denom is the host denom, we want to store P0LastSpotPrice +// When storing down the price, we want to store down the ratio of HostDenom to RewardDenom +// Meaning, if Asset0Denom is the HostDenom, we want to store P0LastSpotPrice func PoolPriceCallback(k Keeper, ctx sdk.Context, args []byte, query icqtypes.Query) error { k.Logger(ctx).Info(utils.LogICQCallbackWithHostZone(query.ChainId, ICQCallbackID_PoolPrice, "Starting pool spot price callback, QueryId: %vs, QueryType: %s, Connection: %s", query.Id, query.QueryType, query.ConnectionId)) @@ -65,8 +65,8 @@ func PoolPriceCallback(k Keeper, ctx sdk.Context, args []byte, query icqtypes.Qu tradeRoute.RewardDenomOnTradeZone, tradeRoute.HostDenomOnTradeZone, price)) // Update the price and time on the trade route data - tradeRoute.SwapPrice = price - tradeRoute.PriceUpdateTimestamp = uint64(ctx.BlockTime().UnixNano()) + tradeRoute.TradeConfig.SwapPrice = price + tradeRoute.TradeConfig.PriceUpdateTimestamp = uint64(ctx.BlockTime().UnixNano()) k.SetTradeRoute(ctx, tradeRoute) return nil diff --git a/x/stakeibc/keeper/msg_server_create_trade_route.go b/x/stakeibc/keeper/msg_server_create_trade_route.go index dfc4699bc6..f483ad5723 100644 --- a/x/stakeibc/keeper/msg_server_create_trade_route.go +++ b/x/stakeibc/keeper/msg_server_create_trade_route.go @@ -14,7 +14,10 @@ import ( connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" ) -var DefaultMaxAllowedSwapLossRate = "0.05" +var ( + DefaultMaxAllowedSwapLossRate = "0.05" + DefaultMaxSwapAmount = sdkmath.NewIntWithDecimal(10, 24) // 10e24 +) // Gov tx to to register a trade route that swaps reward tokens for a different denom // @@ -59,10 +62,10 @@ func (ms msgServer) CreateTradeRoute(goCtx context.Context, msg *types.MsgCreate } // Validate trade route does not already exist for this denom - _, found := ms.Keeper.GetTradeRoute(ctx, msg.RewardDenomOnHost, msg.HostDenomOnHost) + _, found := ms.Keeper.GetTradeRoute(ctx, msg.RewardDenomOnReward, msg.HostDenomOnHost) if found { return nil, errorsmod.Wrapf(types.ErrTradeRouteAlreadyExists, - "startDenom: %s, endDenom: %s", msg.RewardDenomOnHost, msg.HostDenomOnHost) + "startDenom: %s, endDenom: %s", msg.RewardDenomOnReward, msg.HostDenomOnHost) } // Confirm the host chain exists and the withdrawal address has been initialized @@ -109,10 +112,26 @@ func (ms msgServer) CreateTradeRoute(goCtx context.Context, msg *types.MsgCreate ToAccount: hostICA, } + // If a max allowed swap loss is not provided, use the default maxAllowedSwapLossRate := msg.MaxAllowedSwapLossRate if maxAllowedSwapLossRate == "" { maxAllowedSwapLossRate = DefaultMaxAllowedSwapLossRate } + maxSwapAmount := msg.MaxSwapAmount + if maxSwapAmount.IsZero() { + maxSwapAmount = DefaultMaxSwapAmount + } + + // Create the trade config to specify parameters needed for the swap + tradeConfig := types.TradeConfig{ + PoolId: msg.PoolId, + SwapPrice: sdk.ZeroDec(), // this should only ever be set by ICQ so initialize to blank + PriceUpdateTimestamp: 0, + + MaxAllowedSwapLossRate: sdk.MustNewDecFromStr(maxAllowedSwapLossRate), + MinSwapAmount: msg.MinSwapAmount, + MaxSwapAmount: maxSwapAmount, + } // Finally build and store the main trade route tradeRoute := types.TradeRoute{ @@ -126,13 +145,7 @@ func (ms msgServer) CreateTradeRoute(goCtx context.Context, msg *types.MsgCreate RewardToTradeHop: rewardToTradeHop, TradeToHostHop: tradeToHostHop, - PoolId: msg.PoolId, - SwapPrice: sdk.ZeroDec(), // this should only ever be set by ICQ so initialize to blank - PriceUpdateTimestamp: 0, - - MaxAllowedSwapLossRate: sdk.MustNewDecFromStr(maxAllowedSwapLossRate), - MinSwapAmount: sdkmath.NewIntFromUint64(msg.MinSwapAmount), - MaxSwapAmount: sdkmath.NewIntFromUint64(msg.MaxSwapAmount), + TradeConfig: tradeConfig, } ms.Keeper.SetTradeRoute(ctx, tradeRoute) diff --git a/x/stakeibc/keeper/msg_server_delete_trade_route.go b/x/stakeibc/keeper/msg_server_delete_trade_route.go index 0bc884e536..508aedae65 100644 --- a/x/stakeibc/keeper/msg_server_delete_trade_route.go +++ b/x/stakeibc/keeper/msg_server_delete_trade_route.go @@ -2,33 +2,28 @@ package keeper import ( "context" - "fmt" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/Stride-Labs/stride/v16/x/stakeibc/types" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -func (k msgServer) DeleteTradeRoute(goCtx context.Context, msg *types.MsgDeleteTradeRoute) (*types.MsgDeleteTradeRouteResponse, error) { +func (ms msgServer) DeleteTradeRoute(goCtx context.Context, msg *types.MsgDeleteTradeRoute) (*types.MsgDeleteTradeRouteResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - k.Logger(ctx).Info(fmt.Sprintf("delete trade route: %s", msg.String())) - - // get our addresses, make sure they're valid - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "creator address is invalid: %s. err: %s", msg.Creator, err.Error()) + if ms.authority != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, msg.Authority) } - routes := k.GetAllTradeRoutes(ctx) - for _, route := range routes { - if route.HostDenomOnHostZone == msg.HostDenom && route.RewardDenomOnRewardZone == msg.RewardDenom { - k.RemoveTradeRoute(ctx, route.RewardDenomOnHostZone, route.HostDenomOnHostZone) - } - // if no matching trade route was found for the given host-denom and reward-denom... do nothing + _, found := ms.Keeper.GetTradeRoute(ctx, msg.RewardDenom, msg.HostDenom) + if !found { + return nil, errorsmod.Wrapf(types.ErrTradeRouteNotFound, + "no trade route for rewardDenom %s and hostDenom %s", msg.RewardDenom, msg.HostDenom) } - k.Logger(ctx).Info(fmt.Sprintf("delete trade route: %s", msg.String())) + ms.Keeper.RemoveTradeRoute(ctx, msg.RewardDenom, msg.HostDenom) + return &types.MsgDeleteTradeRouteResponse{}, nil } diff --git a/x/stakeibc/keeper/msg_server_update_trade_route.go b/x/stakeibc/keeper/msg_server_update_trade_route.go index ac2d41db47..0a299a0238 100644 --- a/x/stakeibc/keeper/msg_server_update_trade_route.go +++ b/x/stakeibc/keeper/msg_server_update_trade_route.go @@ -2,36 +2,49 @@ package keeper import ( "context" - "fmt" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/Stride-Labs/stride/v16/x/stakeibc/types" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -func (k msgServer) UpdateTradeRoute(goCtx context.Context, msg *types.MsgUpdateTradeRoute) (*types.MsgUpdateTradeRouteResponse, error) { +func (ms msgServer) UpdateTradeRoute(goCtx context.Context, msg *types.MsgUpdateTradeRoute) (*types.MsgUpdateTradeRouteResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - k.Logger(ctx).Info(fmt.Sprintf("update trade route: %s", msg.String())) + if ms.authority != msg.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, msg.Authority) + } + + route, found := ms.Keeper.GetTradeRoute(ctx, msg.RewardDenom, msg.HostDenom) + if !found { + return nil, errorsmod.Wrapf(types.ErrTradeRouteNotFound, + "no trade route for rewardDenom %s and hostDenom %s", msg.RewardDenom, msg.HostDenom) + } - // get our addresses, make sure they're valid - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "creator address is invalid: %s. err: %s", msg.Creator, err.Error()) + maxAllowedSwapLossRate := msg.MaxAllowedSwapLossRate + if maxAllowedSwapLossRate == "" { + maxAllowedSwapLossRate = DefaultMaxAllowedSwapLossRate } + maxSwapAmount := msg.MaxSwapAmount + if maxSwapAmount.IsZero() { + maxSwapAmount = DefaultMaxSwapAmount + } + + updatedConfig := types.TradeConfig{ + PoolId: msg.PoolId, - routes := k.GetAllTradeRoutes(ctx) - for _, route := range routes { - if route.HostDenomOnHostZone == msg.HostDenom && route.RewardDenomOnRewardZone == msg.RewardDenom { - route.PoolId = msg.PoolId - route.MinSwapAmount = msg.MinSwapAmount - route.MaxSwapAmount = msg.MaxSwapAmount - k.SetTradeRoute(ctx, route) - } - // if no matching trade route was found for the given host-denom and reward-denom... do nothing + SwapPrice: sdk.ZeroDec(), + PriceUpdateTimestamp: 0, + + MaxAllowedSwapLossRate: sdk.MustNewDecFromStr(maxAllowedSwapLossRate), + MinSwapAmount: maxSwapAmount, + MaxSwapAmount: msg.MaxSwapAmount, } - k.Logger(ctx).Info(fmt.Sprintf("update trade route: %s", msg.String())) + route.TradeConfig = updatedConfig + ms.Keeper.SetTradeRoute(ctx, route) + return &types.MsgUpdateTradeRouteResponse{}, nil } diff --git a/x/stakeibc/keeper/reward_converter.go b/x/stakeibc/keeper/reward_converter.go index 32eedb92b7..7454066d85 100644 --- a/x/stakeibc/keeper/reward_converter.go +++ b/x/stakeibc/keeper/reward_converter.go @@ -46,7 +46,7 @@ func (k Keeper) TransferRewardTokensHostToTrade(ctx sdk.Context, amount sdkmath. // If the min swap amount was not set it would be ZeroInt, if positive we need to compare to the amount given // then if the min swap amount is greater than the current amount, do nothing this epoch to avoid small transfers // Particularly important for the PFM hop if the reward chain has frictional transfer fees (like noble chain) - if route.MinSwapAmount.IsPositive() && route.MinSwapAmount.GT(amount) { + if route.TradeConfig.MinSwapAmount.IsPositive() && route.TradeConfig.MinSwapAmount.GT(amount) { return nil } @@ -144,21 +144,22 @@ func (k Keeper) TransferConvertedTokensTradeToHost(ctx sdk.Context, amount sdkma func (k Keeper) SwapRewardTokens(ctx sdk.Context, rewardAmount sdkmath.Int, route types.TradeRoute) error { // If the min swap amount was not set it would be ZeroInt, if positive we need to compare to the amount given // then if the min swap amount is greater than the current amount, do nothing this epoch to avoid small swaps - if route.MinSwapAmount.IsPositive() && route.MinSwapAmount.GT(rewardAmount) { + tradeConfig := route.TradeConfig + if tradeConfig.MinSwapAmount.IsPositive() && tradeConfig.MinSwapAmount.GT(rewardAmount) { return nil } // If the max swap amount was not set it would be ZeroInt, if positive we need to compare to the amount given // then if max swap amount is LTE to amount full swap is possible so amount is fine, otherwise set amount to max - if route.MaxSwapAmount.IsPositive() && route.MaxSwapAmount.GT(rewardAmount) { - rewardAmount = route.MaxSwapAmount + if tradeConfig.MaxSwapAmount.IsPositive() && tradeConfig.MaxSwapAmount.GT(rewardAmount) { + rewardAmount = tradeConfig.MaxSwapAmount } // See if pool swap price has been set to a valid ratio // The only time this should not be set is right after the pool is added, // before an ICQ has been submitted for the price - if route.SwapPrice == sdk.ZeroDec() { - return fmt.Errorf("Price not found for pool %d", route.PoolId) + if tradeConfig.SwapPrice == sdk.ZeroDec() { + return fmt.Errorf("Price not found for pool %d", tradeConfig.PoolId) } // If there is a valid price, use it to set a floor for the acceptable minimum output tokens @@ -171,8 +172,8 @@ func (k Keeper) SwapRewardTokens(ctx sdk.Context, rewardAmount sdkmath.Int, rout // So, to convert from units of RewardTokens to units of HostTokens, // we multiply the reward amount by the price: // AmountInHost = AmountInReward * SwapPrice - rewardAmountConverted := sdk.NewDecFromInt(rewardAmount).Mul(route.SwapPrice) - minOutPercentage := sdk.OneDec().Sub(route.MaxAllowedSwapLossRate) + rewardAmountConverted := sdk.NewDecFromInt(rewardAmount).Mul(tradeConfig.SwapPrice) + minOutPercentage := sdk.OneDec().Sub(tradeConfig.MaxAllowedSwapLossRate) minOut := rewardAmountConverted.Mul(minOutPercentage).TruncateInt() tradeIcaAccount := route.RewardToTradeHop.ToAccount @@ -182,7 +183,7 @@ func (k Keeper) SwapRewardTokens(ctx sdk.Context, rewardAmount sdkmath.Int, rout // If we want to generalize in the future, write swap message generation funcs for each DEX type, // decide which msg generation function to call based on check of which tradeZone was passed in routes := []types.SwapAmountInRoute{{ - PoolId: route.PoolId, + PoolId: tradeConfig.PoolId, TokenOutDenom: route.HostDenomOnTradeZone, }} msgs := []proto.Message{&types.MsgSwapExactAmountIn{ @@ -372,7 +373,7 @@ func (k Keeper) PoolPriceQuery(ctx sdk.Context, route types.TradeRoute) error { } // Build query request data which consists of the TWAP store key built from each denom - queryData := icqtypes.FormatOsmosisMostRecentTWAPKey(route.PoolId, denom1, denom2) + queryData := icqtypes.FormatOsmosisMostRecentTWAPKey(route.TradeConfig.PoolId, denom1, denom2) // Timeout query at end of epoch strideEpochTracker, found := k.GetEpochTracker(ctx, epochstypes.STRIDE_EPOCH) @@ -446,7 +447,6 @@ func (k Keeper) SwapAllRewardTokens(ctx sdk.Context) { // Helper function to be run hourly, kicks off query to get and update the swap price in keeper data func (k Keeper) UpdateAllSwapPrices(ctx sdk.Context) { - k.SetTradeRoute(ctx, types.TradeRoute{RewardDenomOnHostZone: "A", HostDenomOnHostZone: "B"}) for _, route := range k.GetAllTradeRoutes(ctx) { // ICQ swap price for the specific pair on this route and update keeper on callback if err := k.PoolPriceQuery(ctx, route); err != nil { diff --git a/x/stakeibc/keeper/trade_route.go b/x/stakeibc/keeper/trade_route.go index 84940dc56e..74df68c76e 100644 --- a/x/stakeibc/keeper/trade_route.go +++ b/x/stakeibc/keeper/trade_route.go @@ -16,6 +16,7 @@ func (k Keeper) SetTradeRoute(ctx sdk.Context, tradeRoute types.TradeRoute) { } // GetTradeRoute returns a tradeRoute from its start and end denoms +// The start and end denom's are in their native format (e.g. uusdc and udydx) func (k Keeper) GetTradeRoute(ctx sdk.Context, startDenom string, endDenom string) (val types.TradeRoute, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TradeRouteKeyPrefix)) key := types.TradeRouteKeyFromDenoms(startDenom, endDenom) @@ -28,6 +29,7 @@ func (k Keeper) GetTradeRoute(ctx sdk.Context, startDenom string, endDenom strin } // RemoveTradeRoute removes a tradeRoute from the store +// The start and end denom's are in their native format (e.g. uusdc and udydx) func (k Keeper) RemoveTradeRoute(ctx sdk.Context, startDenom string, endDenom string) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TradeRouteKeyPrefix)) key := types.TradeRouteKeyFromDenoms(startDenom, endDenom) diff --git a/x/stakeibc/keeper/trade_route_test.go b/x/stakeibc/keeper/trade_route_test.go index ed0cd5d889..bc0291b206 100644 --- a/x/stakeibc/keeper/trade_route_test.go +++ b/x/stakeibc/keeper/trade_route_test.go @@ -40,6 +40,15 @@ func (s *KeeperTestSuite) CreateTradeRoutes() (routes []types.TradeRoute) { ToAccount: hostICA, } + tradeConfig := types.TradeConfig{ + PoolId: uint64(i * 100), + SwapPrice: sdk.OneDec(), + MaxAllowedSwapLossRate: sdk.MustNewDecFromStr("0.05"), + + MinSwapAmount: sdk.ZeroInt(), + MaxSwapAmount: sdk.NewInt(1_000_000_000), + } + hostDenom := fmt.Sprintf("host-denom-%d", i) rewardDenom := fmt.Sprintf("reward-denom-%d", i) @@ -54,11 +63,7 @@ func (s *KeeperTestSuite) CreateTradeRoutes() (routes []types.TradeRoute) { RewardToTradeHop: rewardTradeHop, TradeToHostHop: tradeHostHop, - PoolId: uint64(i * 100), - SwapPrice: sdk.OneDec(), - - MinSwapAmount: sdk.ZeroInt(), - MaxSwapAmount: sdk.NewInt(1_000_000_000), + TradeConfig: tradeConfig, } routes = append(routes, route) @@ -83,8 +88,8 @@ func (s *KeeperTestSuite) TestGetTradeRoute() { func (s *KeeperTestSuite) TestRemoveTradeRoute() { routes := s.CreateTradeRoutes() for _, route := range routes { - s.App.StakeibcKeeper.RemoveTradeRoute(s.Ctx, route.RewardDenomOnHostZone, route.HostDenomOnHostZone) - _, found := s.App.StakeibcKeeper.GetTradeRoute(s.Ctx, route.RewardDenomOnHostZone, route.HostDenomOnHostZone) + s.App.StakeibcKeeper.RemoveTradeRoute(s.Ctx, route.RewardDenomOnRewardZone, route.HostDenomOnHostZone) + _, found := s.App.StakeibcKeeper.GetTradeRoute(s.Ctx, route.RewardDenomOnRewardZone, route.HostDenomOnHostZone) s.Require().False(found, "route should not have been found") } } diff --git a/x/stakeibc/types/errors.go b/x/stakeibc/types/errors.go index a8ecc95c80..76c75791a0 100644 --- a/x/stakeibc/types/errors.go +++ b/x/stakeibc/types/errors.go @@ -63,4 +63,5 @@ var ( ErrInvalidDenom = errorsmod.Register(ModuleName, 1556, "Invalid denom") ErrTradeRouteAlreadyExists = errorsmod.Register(ModuleName, 1557, "Trade route already exists") ErrClientStateNotTendermint = errorsmod.Register(ModuleName, 1558, "Client state not tendermint") + ErrTradeRouteNotFound = errorsmod.Register(ModuleName, 1559, "trade route not found") ) diff --git a/x/stakeibc/types/message_create_trade_route.go b/x/stakeibc/types/message_create_trade_route.go index 15dc3e5e86..a2e0653aee 100644 --- a/x/stakeibc/types/message_create_trade_route.go +++ b/x/stakeibc/types/message_create_trade_route.go @@ -8,6 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) @@ -87,10 +88,18 @@ func (msg *MsgCreateTradeRoute) ValidateBasic() error { if msg.PoolId < 1 { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid pool id") } - if msg.MinSwapAmount > msg.MaxSwapAmount { + if msg.MaxSwapAmount.GT(sdkmath.ZeroInt()) && msg.MinSwapAmount.GT(msg.MaxSwapAmount) { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "min swap amount cannot be greater than max swap amount") } + maxAllowedSwapLossRate, err := sdk.NewDecFromStr(msg.MaxAllowedSwapLossRate) + if err != nil { + return errorsmod.Wrapf(err, "unable to cast max allowed swap loss rate to a decimal") + } + if maxAllowedSwapLossRate.LT(sdk.ZeroDec()) || maxAllowedSwapLossRate.GT(sdk.OneDec()) { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "max allowed swap loss rate must be between 0 and 1") + } + return nil } diff --git a/x/stakeibc/types/message_delete_trade_route.go b/x/stakeibc/types/message_delete_trade_route.go index af22642c4d..1dda70b895 100644 --- a/x/stakeibc/types/message_delete_trade_route.go +++ b/x/stakeibc/types/message_delete_trade_route.go @@ -2,6 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" errorsmod "cosmossdk.io/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -9,30 +10,17 @@ import ( const TypeMsgDeleteTradeRoute = "delete_trade_route" -var _ sdk.Msg = &MsgDeleteTradeRoute{} - -func NewMsgDeleteTradeRoute(creator string, hostDenom string, rewardDenom string) *MsgDeleteTradeRoute { - return &MsgDeleteTradeRoute{ - Creator: creator, - HostDenom: hostDenom, - RewardDenom: rewardDenom, - } -} - -func (msg *MsgDeleteTradeRoute) Route() string { - return RouterKey -} +var ( + _ sdk.Msg = &MsgDeleteTradeRoute{} + _ legacytx.LegacyMsg = &MsgDeleteTradeRoute{} +) func (msg *MsgDeleteTradeRoute) Type() string { return TypeMsgDeleteTradeRoute } -func (msg *MsgDeleteTradeRoute) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} +func (msg *MsgDeleteTradeRoute) Route() string { + return RouterKey } func (msg *MsgDeleteTradeRoute) GetSignBytes() []byte { @@ -40,11 +28,14 @@ func (msg *MsgDeleteTradeRoute) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } +func (msg *MsgDeleteTradeRoute) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + func (msg *MsgDeleteTradeRoute) ValidateBasic() error { - // check valid creator address - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") } if msg.HostDenom == "" { diff --git a/x/stakeibc/types/message_update_trade_route.go b/x/stakeibc/types/message_update_trade_route.go index a25913b6c8..3b1675dc95 100644 --- a/x/stakeibc/types/message_update_trade_route.go +++ b/x/stakeibc/types/message_update_trade_route.go @@ -2,47 +2,26 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const TypeMsgUpdateTradeRoute = "update_trade_route" -var _ sdk.Msg = &MsgDeleteTradeRoute{} - -func NewMsgUpdateTradeRoute( - creator string, - hostDenom string, - rewardDenom string, - poolId uint64, - minSwapAmount sdk.Int, - maxSwapAmount sdk.Int, -) *MsgUpdateTradeRoute { - return &MsgUpdateTradeRoute{ - Creator: creator, - HostDenom: hostDenom, - RewardDenom: rewardDenom, - PoolId: poolId, - MinSwapAmount: minSwapAmount, - MaxSwapAmount: maxSwapAmount, - } -} - -func (msg *MsgUpdateTradeRoute) Route() string { - return RouterKey -} +var ( + _ sdk.Msg = &MsgUpdateTradeRoute{} + _ legacytx.LegacyMsg = &MsgUpdateTradeRoute{} +) func (msg *MsgUpdateTradeRoute) Type() string { return TypeMsgUpdateTradeRoute } -func (msg *MsgUpdateTradeRoute) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} +func (msg *MsgUpdateTradeRoute) Route() string { + return RouterKey } func (msg *MsgUpdateTradeRoute) GetSignBytes() []byte { @@ -50,11 +29,35 @@ func (msg *MsgUpdateTradeRoute) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } +func (msg *MsgUpdateTradeRoute) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} func (msg *MsgUpdateTradeRoute) ValidateBasic() error { - // check valid creator address - _, err := sdk.AccAddressFromBech32(msg.Creator) + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + if msg.HostDenom == "" { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "missing host denom") + } + if msg.RewardDenom == "" { + return errorsmod.Wrapf(sdkerrors.ErrNotFound, "missing reward denom") + } + + if msg.PoolId < 1 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid pool id") + } + if msg.MaxSwapAmount.GT(sdkmath.ZeroInt()) && msg.MinSwapAmount.GT(msg.MaxSwapAmount) { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "min swap amount cannot be greater than max swap amount") + } + + maxAllowedSwapLossRate, err := sdk.NewDecFromStr(msg.MaxAllowedSwapLossRate) if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(err, "unable to cast max allowed swap loss rate to a decimal") + } + if maxAllowedSwapLossRate.LT(sdk.ZeroDec()) || maxAllowedSwapLossRate.GT(sdk.OneDec()) { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "max allowed swap loss rate must be between 0 and 1") } return nil diff --git a/x/stakeibc/types/trade_route.go b/x/stakeibc/types/trade_route.go index fe1ac218a3..0a50dbfa83 100644 --- a/x/stakeibc/types/trade_route.go +++ b/x/stakeibc/types/trade_route.go @@ -1,5 +1,5 @@ package types func (t TradeRoute) GetKey() []byte { - return TradeRouteKeyFromDenoms(t.RewardDenomOnHostZone, t.HostDenomOnHostZone) + return TradeRouteKeyFromDenoms(t.RewardDenomOnRewardZone, t.HostDenomOnHostZone) } diff --git a/x/stakeibc/types/trade_route.pb.go b/x/stakeibc/types/trade_route.pb.go index 5039ac2e93..ea64bcdd48 100644 --- a/x/stakeibc/types/trade_route.pb.go +++ b/x/stakeibc/types/trade_route.pb.go @@ -88,11 +88,81 @@ func (m *TradeHop) GetToAccount() ICAAccount { return ICAAccount{} } +// Stores pool information needed to execute the swap along a trade route +type TradeConfig struct { + // Currently Osmosis is the only trade chain so this is an osmosis pool id + PoolId uint64 `protobuf:"varint,9,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` + // Spot price in the pool to convert the reward denom to the host denom + // output_tokens = swap_price * input tokens + // This value may be slightly stale as it is updated by an ICQ + SwapPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=swap_price,json=swapPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_price"` + // unix time in seconds that the price was last updated + PriceUpdateTimestamp uint64 `protobuf:"varint,11,opt,name=price_update_timestamp,json=priceUpdateTimestamp,proto3" json:"price_update_timestamp,omitempty"` + // Threshold defining the percentage of tokens that could be lost in the trade + // This captures both the loss from slippage and from a stale price on stride + // 0.05 means the output from the trade can be no less than a 5% deviation + // from the current value + MaxAllowedSwapLossRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=max_allowed_swap_loss_rate,json=maxAllowedSwapLossRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_allowed_swap_loss_rate"` + // min and max set boundaries of reward denom on trade chain we will swap + // min also decides when reward token transfers are worth it (transfer fees) + MinSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=min_swap_amount,json=minSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_swap_amount"` + MaxSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,14,opt,name=max_swap_amount,json=maxSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_swap_amount"` +} + +func (m *TradeConfig) Reset() { *m = TradeConfig{} } +func (m *TradeConfig) String() string { return proto.CompactTextString(m) } +func (*TradeConfig) ProtoMessage() {} +func (*TradeConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_c252b142ecf88017, []int{1} +} +func (m *TradeConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TradeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TradeConfig.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 *TradeConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_TradeConfig.Merge(m, src) +} +func (m *TradeConfig) XXX_Size() int { + return m.Size() +} +func (m *TradeConfig) XXX_DiscardUnknown() { + xxx_messageInfo_TradeConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_TradeConfig proto.InternalMessageInfo + +func (m *TradeConfig) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func (m *TradeConfig) GetPriceUpdateTimestamp() uint64 { + if m != nil { + return m.PriceUpdateTimestamp + } + return 0 +} + // TradeRoute represents a round trip including info on transfer and how to do // the swap. It makes the assumption that the reward token is always foreign to // the host so therefore the first two hops are to unwind the ibc denom enroute // to the trade chain and the last hop is the return so funds start/end in the // withdrawl ICA on hostZone +// The structure is key'd on reward denom and host denom in their native forms +// (i.e. reward_denom_on_reward_zone and host_denom_on_host_zone) type TradeRoute struct { // ibc denom for the reward on the host zone RewardDenomOnHostZone string `protobuf:"bytes,1,opt,name=reward_denom_on_host_zone,json=rewardDenomOnHostZone,proto3" json:"reward_denom_on_host_zone,omitempty"` @@ -107,30 +177,16 @@ type TradeRoute struct { HostToRewardHop TradeHop `protobuf:"bytes,6,opt,name=host_to_reward_hop,json=hostToRewardHop,proto3" json:"host_to_reward_hop"` RewardToTradeHop TradeHop `protobuf:"bytes,7,opt,name=reward_to_trade_hop,json=rewardToTradeHop,proto3" json:"reward_to_trade_hop"` TradeToHostHop TradeHop `protobuf:"bytes,8,opt,name=trade_to_host_hop,json=tradeToHostHop,proto3" json:"trade_to_host_hop"` - // Currently Osmosis is the only trade chain so this is an osmosis pool id - PoolId uint64 `protobuf:"varint,9,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` - // Spot price in the pool to convert the reward denom to the host denom - // output_tokens = swap_price * input tokens - // This value may be slightly stale as it is updated by an ICQ - SwapPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=swap_price,json=swapPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_price"` - // unix time in seconds that the price was last updated - PriceUpdateTimestamp uint64 `protobuf:"varint,11,opt,name=price_update_timestamp,json=priceUpdateTimestamp,proto3" json:"price_update_timestamp,omitempty"` - // Threshold defining the percentage of tokens that could be lost in the trade - // This captures both the loss from slippage and from a stale price on stride - // 0.05 means the output from the trade can be no less than a 5% deviation - // from the current value - MaxAllowedSwapLossRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=max_allowed_swap_loss_rate,json=maxAllowedSwapLossRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_allowed_swap_loss_rate"` - // min and max set boundaries of reward denom on trade chain we will swap - // min also decides when reward token transfers are worth it (transfer fees) - MinSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,13,opt,name=min_swap_amount,json=minSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_swap_amount"` - MaxSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,14,opt,name=max_swap_amount,json=maxSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_swap_amount"` + // specifies the configuration needed to execute the swap + // such as pool_id, slippage, min trade amount, etc. + TradeConfig TradeConfig `protobuf:"bytes,9,opt,name=trade_config,json=tradeConfig,proto3" json:"trade_config"` } func (m *TradeRoute) Reset() { *m = TradeRoute{} } func (m *TradeRoute) String() string { return proto.CompactTextString(m) } func (*TradeRoute) ProtoMessage() {} func (*TradeRoute) Descriptor() ([]byte, []int) { - return fileDescriptor_c252b142ecf88017, []int{1} + return fileDescriptor_c252b142ecf88017, []int{2} } func (m *TradeRoute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -215,70 +271,66 @@ func (m *TradeRoute) GetTradeToHostHop() TradeHop { return TradeHop{} } -func (m *TradeRoute) GetPoolId() uint64 { +func (m *TradeRoute) GetTradeConfig() TradeConfig { if m != nil { - return m.PoolId + return m.TradeConfig } - return 0 -} - -func (m *TradeRoute) GetPriceUpdateTimestamp() uint64 { - if m != nil { - return m.PriceUpdateTimestamp - } - return 0 + return TradeConfig{} } func init() { proto.RegisterType((*TradeHop)(nil), "stride.stakeibc.TradeHop") + proto.RegisterType((*TradeConfig)(nil), "stride.stakeibc.TradeConfig") proto.RegisterType((*TradeRoute)(nil), "stride.stakeibc.TradeRoute") } func init() { proto.RegisterFile("stride/stakeibc/trade_route.proto", fileDescriptor_c252b142ecf88017) } var fileDescriptor_c252b142ecf88017 = []byte{ - // 657 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcf, 0x4e, 0xdb, 0x4c, - 0x10, 0xc0, 0x63, 0xe0, 0x03, 0x32, 0xfc, 0xfb, 0x30, 0x14, 0x4c, 0x90, 0x02, 0xe5, 0x50, 0x71, - 0xc1, 0x51, 0x29, 0x42,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3, 0x7f, 0xe9, 0xe5, 0xfd, 0x6b, 0xef, 0x6e, 0xe3, - 0xf4, 0xa2, 0x6c, 0x9d, 0x5d, 0x94, 0xad, 0x1f, 0x17, 0x65, 0xeb, 0xd3, 0x65, 0xb9, 0x70, 0x76, - 0x59, 0x2e, 0x7c, 0xbb, 0x2c, 0x17, 0x0e, 0x37, 0x6f, 0x08, 0x0f, 0xe8, 0xa8, 0x6c, 0x34, 0x78, - 0x4b, 0x56, 0xb2, 0x47, 0xf2, 0xfd, 0xe3, 0xed, 0x4a, 0xff, 0xc6, 0xa3, 0xab, 0x0b, 0xb4, 0x46, - 0xe9, 0x29, 0x7c, 0xf2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x05, 0x21, 0xfb, 0x8a, 0x94, 0x05, 0x00, + // 689 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x4f, 0x13, 0x41, + 0x14, 0xc0, 0xbb, 0x50, 0x81, 0x4e, 0xf9, 0x23, 0x0b, 0xc2, 0x52, 0x4c, 0x41, 0x0e, 0x86, 0x0b, + 0xdb, 0x88, 0x84, 0x18, 0xc3, 0xc1, 0x42, 0x4d, 0xa8, 0x69, 0xd4, 0x2c, 0xd5, 0x03, 0x1e, 0x26, + 0xd3, 0xdd, 0xa1, 0xdd, 0xd0, 0xdd, 0xb7, 0xd9, 0x99, 0xda, 0xea, 0xa7, 0xf0, 0xc3, 0xf8, 0x09, + 0x3c, 0x71, 0x24, 0x9e, 0x8c, 0x07, 0x34, 0xf4, 0x8b, 0x98, 0x79, 0xb3, 0x0b, 0x2d, 0x70, 0xa8, + 0xc6, 0x13, 0xcc, 0xbe, 0xf7, 0xfb, 0xcd, 0x7b, 0xdb, 0x7d, 0x8f, 0x3c, 0x12, 0x32, 0xf6, 0x3d, + 0x5e, 0x12, 0x92, 0x9d, 0x72, 0xbf, 0xe1, 0x96, 0x64, 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6a, 0xac, + 0x21, 0x4a, 0xc9, 0xee, 0xfd, 0xf8, 0x64, 0xb7, 0xd4, 0x1b, 0xd8, 0xe5, 0xea, 0x13, 0x6e, 0x4c, + 0xe0, 0x86, 0x7d, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0x88, 0xb2, 0xc0, 0xbe, 0xeb, 0x05, 0x00, 0x00, } @@ -332,7 +384,7 @@ func (m *TradeHop) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TradeRoute) Marshal() (dAtA []byte, err error) { +func (m *TradeConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -342,12 +394,12 @@ func (m *TradeRoute) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TradeRoute) MarshalTo(dAtA []byte) (int, error) { +func (m *TradeConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TradeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -402,6 +454,39 @@ func (m *TradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x48 } + return len(dAtA) - i, nil +} + +func (m *TradeRoute) 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 *TradeRoute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TradeConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTradeRoute(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a { size, err := m.TradeToHostHop.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -498,6 +583,29 @@ func (m *TradeHop) Size() (n int) { return n } +func (m *TradeConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovTradeRoute(uint64(m.PoolId)) + } + l = m.SwapPrice.Size() + n += 1 + l + sovTradeRoute(uint64(l)) + if m.PriceUpdateTimestamp != 0 { + n += 1 + sovTradeRoute(uint64(m.PriceUpdateTimestamp)) + } + l = m.MaxAllowedSwapLossRate.Size() + n += 1 + l + sovTradeRoute(uint64(l)) + l = m.MinSwapAmount.Size() + n += 1 + l + sovTradeRoute(uint64(l)) + l = m.MaxSwapAmount.Size() + n += 1 + l + sovTradeRoute(uint64(l)) + return n +} + func (m *TradeRoute) Size() (n int) { if m == nil { return 0 @@ -530,19 +638,7 @@ func (m *TradeRoute) Size() (n int) { n += 1 + l + sovTradeRoute(uint64(l)) l = m.TradeToHostHop.Size() n += 1 + l + sovTradeRoute(uint64(l)) - if m.PoolId != 0 { - n += 1 + sovTradeRoute(uint64(m.PoolId)) - } - l = m.SwapPrice.Size() - n += 1 + l + sovTradeRoute(uint64(l)) - if m.PriceUpdateTimestamp != 0 { - n += 1 + sovTradeRoute(uint64(m.PriceUpdateTimestamp)) - } - l = m.MaxAllowedSwapLossRate.Size() - n += 1 + l + sovTradeRoute(uint64(l)) - l = m.MinSwapAmount.Size() - n += 1 + l + sovTradeRoute(uint64(l)) - l = m.MaxSwapAmount.Size() + l = m.TradeConfig.Size() n += 1 + l + sovTradeRoute(uint64(l)) return n } @@ -701,7 +797,7 @@ func (m *TradeHop) Unmarshal(dAtA []byte) error { } return nil } -func (m *TradeRoute) Unmarshal(dAtA []byte) error { +func (m *TradeConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -724,15 +820,34 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TradeRoute: wiretype end group for non-group") + return fmt.Errorf("proto: TradeConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TradeRoute: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TradeConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTradeRoute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardDenomOnHostZone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SwapPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -760,11 +875,32 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardDenomOnHostZone = string(dAtA[iNdEx:postIndex]) + if err := m.SwapPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PriceUpdateTimestamp", wireType) + } + m.PriceUpdateTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTradeRoute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PriceUpdateTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardDenomOnRewardZone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxAllowedSwapLossRate", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -792,11 +928,13 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardDenomOnRewardZone = string(dAtA[iNdEx:postIndex]) + if err := m.MaxAllowedSwapLossRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 3: + case 13: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardDenomOnTradeZone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinSwapAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -824,11 +962,13 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardDenomOnTradeZone = string(dAtA[iNdEx:postIndex]) + if err := m.MinSwapAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 4: + case 14: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostDenomOnTradeZone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MaxSwapAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -856,11 +996,63 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HostDenomOnTradeZone = string(dAtA[iNdEx:postIndex]) + if err := m.MaxSwapAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: + default: + iNdEx = preIndex + skippy, err := skipTradeRoute(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTradeRoute + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TradeRoute) 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 ErrIntOverflowTradeRoute + } + 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: TradeRoute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TradeRoute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostDenomOnHostZone", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardDenomOnHostZone", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -888,13 +1080,13 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HostDenomOnHostZone = string(dAtA[iNdEx:postIndex]) + m.RewardDenomOnHostZone = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostToRewardHop", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardDenomOnRewardZone", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -904,30 +1096,29 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTradeRoute } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTradeRoute } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.HostToRewardHop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardDenomOnRewardZone = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardToTradeHop", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardDenomOnTradeZone", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -937,30 +1128,29 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTradeRoute } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTradeRoute } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RewardToTradeHop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardDenomOnTradeZone = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TradeToHostHop", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HostDenomOnTradeZone", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -970,47 +1160,27 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTradeRoute } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTradeRoute } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TradeToHostHop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.HostDenomOnTradeZone = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) - } - m.PoolId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTradeRoute - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PoolId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SwapPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HostDenomOnHostZone", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1038,15 +1208,13 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.SwapPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.HostDenomOnHostZone = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PriceUpdateTimestamp", wireType) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostToRewardHop", wireType) } - m.PriceUpdateTimestamp = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -1056,16 +1224,30 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.PriceUpdateTimestamp |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 12: + if msglen < 0 { + return ErrInvalidLengthTradeRoute + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTradeRoute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.HostToRewardHop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAllowedSwapLossRate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardToTradeHop", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -1075,31 +1257,30 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTradeRoute } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTradeRoute } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MaxAllowedSwapLossRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RewardToTradeHop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 13: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinSwapAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TradeToHostHop", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -1109,31 +1290,30 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTradeRoute } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTradeRoute } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MinSwapAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TradeToHostHop.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 14: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxSwapAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TradeConfig", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTradeRoute @@ -1143,23 +1323,22 @@ func (m *TradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTradeRoute } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTradeRoute } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MaxSwapAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TradeConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/stakeibc/types/tx.pb.go b/x/stakeibc/types/tx.pb.go index 05f6374d02..7f6a07b450 100644 --- a/x/stakeibc/types/tx.pb.go +++ b/x/stakeibc/types/tx.pb.go @@ -1554,6 +1554,7 @@ func (m *MsgResumeHostZoneResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgResumeHostZoneResponse proto.InternalMessageInfo +// Creates a new trade route type MsgCreateTradeRoute struct { // authority is the address that controls the module (defaults to x/gov unless // overwritten). @@ -1584,9 +1585,12 @@ type MsgCreateTradeRoute struct { // "0.05" means the output from the trade can be no less than a 5% deviation // from the current value MaxAllowedSwapLossRate string `protobuf:"bytes,14,opt,name=max_allowed_swap_loss_rate,json=maxAllowedSwapLossRate,proto3" json:"max_allowed_swap_loss_rate,omitempty"` - // min and max set boundaries of reward denom on trade chain we will swap - MinSwapAmount uint64 `protobuf:"varint,15,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` - MaxSwapAmount uint64 `protobuf:"varint,16,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` + // minimum amount of reward tokens to initate a swap + // if not provided, defaults to 0 + MinSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,15,opt,name=min_swap_amount,json=minSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_swap_amount"` + // maximum amount of reward tokens in a single swap + // if not provided, defaults to 10e24 + MaxSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,16,opt,name=max_swap_amount,json=maxSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_swap_amount"` } func (m *MsgCreateTradeRoute) Reset() { *m = MsgCreateTradeRoute{} } @@ -1720,20 +1724,6 @@ func (m *MsgCreateTradeRoute) GetMaxAllowedSwapLossRate() string { return "" } -func (m *MsgCreateTradeRoute) GetMinSwapAmount() uint64 { - if m != nil { - return m.MinSwapAmount - } - return 0 -} - -func (m *MsgCreateTradeRoute) GetMaxSwapAmount() uint64 { - if m != nil { - return m.MaxSwapAmount - } - return 0 -} - type MsgCreateTradeRouteResponse struct { } @@ -1770,10 +1760,15 @@ func (m *MsgCreateTradeRouteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateTradeRouteResponse proto.InternalMessageInfo +// Deletes a trade route type MsgDeleteTradeRoute struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - HostDenom string `protobuf:"bytes,2,opt,name=host_denom,json=hostDenom,proto3" json:"host_denom,omitempty"` - RewardDenom string `protobuf:"bytes,3,opt,name=reward_denom,json=rewardDenom,proto3" json:"reward_denom,omitempty"` + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // The reward denom of the route in it's native form (e.g. usdc) + RewardDenom string `protobuf:"bytes,2,opt,name=reward_denom,json=rewardDenom,proto3" json:"reward_denom,omitempty"` + // The host zone's denom in it's native form (e.g. dydx) + HostDenom string `protobuf:"bytes,3,opt,name=host_denom,json=hostDenom,proto3" json:"host_denom,omitempty"` } func (m *MsgDeleteTradeRoute) Reset() { *m = MsgDeleteTradeRoute{} } @@ -1809,23 +1804,23 @@ func (m *MsgDeleteTradeRoute) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteTradeRoute proto.InternalMessageInfo -func (m *MsgDeleteTradeRoute) GetCreator() string { +func (m *MsgDeleteTradeRoute) GetAuthority() string { if m != nil { - return m.Creator + return m.Authority } return "" } -func (m *MsgDeleteTradeRoute) GetHostDenom() string { +func (m *MsgDeleteTradeRoute) GetRewardDenom() string { if m != nil { - return m.HostDenom + return m.RewardDenom } return "" } -func (m *MsgDeleteTradeRoute) GetRewardDenom() string { +func (m *MsgDeleteTradeRoute) GetHostDenom() string { if m != nil { - return m.RewardDenom + return m.HostDenom } return "" } @@ -1866,13 +1861,28 @@ func (m *MsgDeleteTradeRouteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteTradeRouteResponse proto.InternalMessageInfo +// Updates the config of a trade route type MsgUpdateTradeRoute struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - HostDenom string `protobuf:"bytes,2,opt,name=host_denom,json=hostDenom,proto3" json:"host_denom,omitempty"` - RewardDenom string `protobuf:"bytes,3,opt,name=reward_denom,json=rewardDenom,proto3" json:"reward_denom,omitempty"` - PoolId uint64 `protobuf:"varint,4,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` - MinSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=min_swap_amount,json=minSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_swap_amount"` - MaxSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_swap_amount"` + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // The reward denom of the route in it's native form (e.g. usdc) + RewardDenom string `protobuf:"bytes,2,opt,name=reward_denom,json=rewardDenom,proto3" json:"reward_denom,omitempty"` + // The host zone's denom in it's native form (e.g. dydx) + HostDenom string `protobuf:"bytes,3,opt,name=host_denom,json=hostDenom,proto3" json:"host_denom,omitempty"` + // The osmosis pool ID + PoolId uint64 `protobuf:"varint,4,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` + // Threshold defining the percentage of tokens that could be lost in the trade + // This captures both the loss from slippage and from a stale price on stride + // "0.05" means the output from the trade can be no less than a 5% deviation + // from the current value + MaxAllowedSwapLossRate string `protobuf:"bytes,5,opt,name=max_allowed_swap_loss_rate,json=maxAllowedSwapLossRate,proto3" json:"max_allowed_swap_loss_rate,omitempty"` + // minimum amount of reward tokens to initate a swap + // if not provided, defaults to 0 + MinSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=min_swap_amount,json=minSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_swap_amount"` + // maximum amount of reward tokens in a single swap + // if not provided, defaults to 10e24 + MaxSwapAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=max_swap_amount,json=maxSwapAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_swap_amount"` } func (m *MsgUpdateTradeRoute) Reset() { *m = MsgUpdateTradeRoute{} } @@ -1908,23 +1918,23 @@ func (m *MsgUpdateTradeRoute) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateTradeRoute proto.InternalMessageInfo -func (m *MsgUpdateTradeRoute) GetCreator() string { +func (m *MsgUpdateTradeRoute) GetAuthority() string { if m != nil { - return m.Creator + return m.Authority } return "" } -func (m *MsgUpdateTradeRoute) GetHostDenom() string { +func (m *MsgUpdateTradeRoute) GetRewardDenom() string { if m != nil { - return m.HostDenom + return m.RewardDenom } return "" } -func (m *MsgUpdateTradeRoute) GetRewardDenom() string { +func (m *MsgUpdateTradeRoute) GetHostDenom() string { if m != nil { - return m.RewardDenom + return m.HostDenom } return "" } @@ -1936,6 +1946,13 @@ func (m *MsgUpdateTradeRoute) GetPoolId() uint64 { return 0 } +func (m *MsgUpdateTradeRoute) GetMaxAllowedSwapLossRate() string { + if m != nil { + return m.MaxAllowedSwapLossRate + } + return "" +} + type MsgUpdateTradeRouteResponse struct { } @@ -2016,137 +2033,137 @@ func init() { func init() { proto.RegisterFile("stride/stakeibc/tx.proto", fileDescriptor_9b7e09c9ad51cd54) } var fileDescriptor_9b7e09c9ad51cd54 = []byte{ - // 2074 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcf, 0x6f, 0x24, 0x47, - 0x15, 0xf6, 0xd8, 0x5e, 0xff, 0x78, 0xb6, 0xd7, 0x76, 0xdb, 0xeb, 0x1d, 0xf7, 0xc6, 0x33, 0x76, - 0x7b, 0x13, 0x8c, 0x13, 0xcf, 0x60, 0x3b, 0x0a, 0x60, 0x40, 0xc2, 0x1e, 0x07, 0x32, 0x62, 0x1d, - 0x50, 0xdb, 0x61, 0xa5, 0x95, 0x50, 0x53, 0xd3, 0x5d, 0x3b, 0xd3, 0xda, 0xee, 0xae, 0x49, 0x57, - 0x8f, 0x3d, 0xcb, 0x01, 0x45, 0x48, 0x48, 0x08, 0x09, 0x09, 0x84, 0x94, 0x23, 0xca, 0x81, 0x03, - 0x02, 0x0e, 0x11, 0xca, 0x1f, 0x11, 0x89, 0x4b, 0x94, 0x03, 0x42, 0x1c, 0x0c, 0xda, 0x3d, 0x84, - 0xb3, 0xff, 0x02, 0x54, 0x3f, 0xa6, 0xa6, 0xbb, 0xa7, 0xc7, 0xe3, 0x75, 0xcc, 0x5e, 0x6c,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0e, 0xfa, 0xef, - 0xce, 0x6e, 0xff, 0xdd, 0xe8, 0x3b, 0x49, 0xff, 0xd6, 0x35, 0x26, 0xc5, 0xd7, 0x9d, 0x7a, 0xba, - 0x18, 0x7d, 0x92, 0x33, 0x86, 0xc9, 0x5e, 0x77, 0xf6, 0xc3, 0x85, 0x15, 0xf1, 0x9e, 0x47, 0x4b, - 0x66, 0x11, 0x4f, 0xa3, 0xb2, 0x8b, 0x78, 0x3f, 0x49, 0xc5, 0xfc, 0xf4, 0xe8, 0xa9, 0xfb, 0xfd, - 0xcf, 0xf7, 0x20, 0x3f, 0xfd, 0x84, 0x12, 0xf3, 0xd3, 0x23, 0x92, 0xee, 0xf7, 0xdf, 0x82, 0x41, - 0x7e, 0xfa, 0x09, 0x83, 0x83, 0x07, 0x9f, 0x3e, 0x2b, 0xe4, 0x3e, 0x7b, 0x56, 0xc8, 0xfd, 0xe7, - 0x59, 0x21, 0xf7, 0xdb, 0xe7, 0x85, 0xa1, 0xcf, 0x9e, 0x17, 0x86, 0xfe, 0xf9, 0xbc, 0x30, 0xf4, - 0x68, 0x27, 0x26, 0x4b, 0x8e, 0xb9, 0xc5, 0xad, 0x07, 0xa8, 0x46, 0xcb, 0x52, 0x99, 0x9e, 0x6e, - 0xbf, 0x15, 0x57, 0xa7, 0x5c, 0xa6, 0xd4, 0xc6, 0xf8, 0x7f, 0x19, 0x77, 0xff, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x19, 0xe0, 0xb2, 0xad, 0x53, 0x1d, 0x00, 0x00, + // 2070 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4f, 0x6f, 0x24, 0x47, + 0x15, 0xf7, 0xac, 0x77, 0xd7, 0xb3, 0xcf, 0xf6, 0xda, 0x6e, 0x7b, 0xbd, 0xe3, 0xde, 0x78, 0xc6, + 0x6e, 0x6f, 0xc0, 0x38, 0xf1, 0x0c, 0xb6, 0xa3, 0x00, 0x06, 0x24, 0xec, 0x71, 0x20, 0x23, 0xd6, + 0x01, 0xb5, 0x9d, 0xac, 0xb4, 0x12, 0x6a, 0x6a, 0xba, 0x6b, 0x67, 0x5a, 0xdb, 0xdd, 0x35, 0xe9, + 0xea, 0xb1, 0x67, 0x39, 0xa0, 0x08, 0x09, 0x09, 0x21, 0x90, 0x40, 0x48, 0x39, 0xa2, 0x1c, 0x38, + 0x20, 0xb8, 0x44, 0x28, 0x1f, 0x22, 0x08, 0x09, 0x45, 0x39, 0x21, 0x0e, 0x06, 0xed, 0x1e, 0xc2, + 0xd9, 0x9f, 0x00, 0xd5, 0x9f, 0xa9, 0xe9, 0xee, 0xe9, 0xf1, 0xd8, 0x8e, 0xb3, 0xca, 0xc5, 0x76, + 0x55, 0xfd, 0xea, 0xbd, 0xdf, 0x7b, 0xf5, 0xea, 0xd5, 0x7b, 0x6d, 0x28, 0xd0, 0x28, 0x74, 0x1d, + 0x5c, 0xa1, 0x11, 0x7a, 0x82, 0xdd, 0xba, 0x5d, 0x89, 0x3a, 0xe5, 0x56, 0x48, 0x22, 0xa2, 0x4d, + 0x89, 0x95, 0x72, 0x77, 0x45, 0x5f, 0x4e, 0x43, 0x5d, 0x1b, 0x59, 0xc8, 0xb6, 0x49, 0x3b, 0x88, + 0xc4, 0x1e, 0xbd, 0x94, 0x86, 0x1c, 0x21, 0xcf, 0x75, 0x50, 0x44, 0x42, 0x09, 0x98, 0x6b, 0x90, + 0x06, 0xe1, 0x7f, 0x56, 0xd8, 0x5f, 0x72, 0x76, 0xc1, 0x26, 0xd4, 0x27, 0xd4, 0x12, 0x0b, 0x62, + 0x20, 0x97, 0x8a, 0x62, 0x54, 0xa9, 0x23, 0x8a, 0x2b, 0x47, 0x1b, 0x75, 0x1c, 0xa1, 0x8d, 0x8a, + 0x4d, 0xdc, 0x40, 0xae, 0xdf, 0x95, 0xeb, 0x3e, 0x6d, 0x54, 0x8e, 0x36, 0xd8, 0x2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0xf5, 0xa0, 0x9a, 0x01, 0x93, 0xfc, 0x92, 0xa6, 0xc8, 0x8c, 0xb3, 0xc9, 0xaa, 0xba, 0x03, + 0x45, 0x11, 0xee, 0x56, 0x44, 0xac, 0x10, 0x1f, 0xa3, 0xd0, 0xb1, 0x92, 0x45, 0x97, 0xf0, 0x96, + 0x2e, 0x50, 0x87, 0xc4, 0xe4, 0x98, 0x6a, 0xbc, 0xd0, 0xfa, 0x1e, 0x2c, 0xf6, 0x64, 0x44, 0x8c, + 0x77, 0x4a, 0x84, 0x78, 0x92, 0x16, 0xba, 0x22, 0xb8, 0x69, 0x09, 0x09, 0x35, 0x10, 0xa5, 0x56, + 0x8f, 0x43, 0x56, 0x49, 0xc4, 0x2b, 0x2d, 0x73, 0x91, 0x21, 0xbb, 0x3c, 0x0e, 0xfb, 0xca, 0x9f, + 0x1f, 0xc2, 0x4a, 0x57, 0x44, 0x97, 0x4c, 0x96, 0x2c, 0x51, 0x84, 0x15, 0x05, 0x54, 0x52, 0xea, + 0x17, 0xf6, 0x03, 0x58, 0x96, 0x22, 0x88, 0x25, 0x08, 0x66, 0x88, 0x1a, 0xe3, 0xa2, 0x5e, 0xe2, + 0xc0, 0x43, 0xc2, 0x4e, 0xb5, 0x5f, 0x50, 0x05, 0xe6, 0x24, 0x2b, 0x5e, 0x19, 0x5a, 0x24, 0xe0, + 0xf2, 0x0a, 0x79, 0xbe, 0x77, 0x46, 0xac, 0xf1, 0x4a, 0xf1, 0x47, 0x01, 0xbf, 0x7c, 0x5b, 0x30, + 0x9f, 0xde, 0x20, 0xc6, 0x85, 0x5b, 0x7c, 0xcb, 0x6c, 0x62, 0x8b, 0x70, 0x86, 0xb6, 0x01, 0x77, + 0xd2, 0x9b, 0x38, 0x2b, 0x51, 0x4c, 0x9a, 0x5a, 0x62, 0x0f, 0x37, 0x99, 0x35, 0x62, 0xbd, 0x22, + 0xb7, 0xb7, 0x61, 0x5c, 0x34, 0x62, 0xaa, 0xe4, 0xed, 0xc2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xbc, 0x26, 0xe1, + 0x25, 0x4d, 0xfd, 0x26, 0xff, 0xb7, 0xec, 0xd6, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x50, 0xbd, + 0x80, 0xd7, 0x84, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4086,18 +4103,28 @@ func (m *MsgCreateTradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.MaxSwapAmount != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MaxSwapAmount)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x80 + { + size := m.MaxSwapAmount.Size() + i -= size + if _, err := m.MaxSwapAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } - if m.MinSwapAmount != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MinSwapAmount)) - i-- - dAtA[i] = 0x78 + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + { + size := m.MinSwapAmount.Size() + i -= size + if _, err := m.MinSwapAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x7a if len(m.MaxAllowedSwapLossRate) > 0 { i -= len(m.MaxAllowedSwapLossRate) copy(dAtA[i:], m.MaxAllowedSwapLossRate) @@ -4240,24 +4267,24 @@ func (m *MsgDeleteTradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.RewardDenom) > 0 { - i -= len(m.RewardDenom) - copy(dAtA[i:], m.RewardDenom) - i = encodeVarintTx(dAtA, i, uint64(len(m.RewardDenom))) - i-- - dAtA[i] = 0x1a - } if len(m.HostDenom) > 0 { i -= len(m.HostDenom) copy(dAtA[i:], m.HostDenom) i = encodeVarintTx(dAtA, i, uint64(len(m.HostDenom))) i-- + dAtA[i] = 0x1a + } + if len(m.RewardDenom) > 0 { + i -= len(m.RewardDenom) + copy(dAtA[i:], m.RewardDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardDenom))) + i-- dAtA[i] = 0x12 } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0xa } @@ -4316,7 +4343,7 @@ func (m *MsgUpdateTradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a { size := m.MinSwapAmount.Size() i -= size @@ -4326,30 +4353,37 @@ func (m *MsgUpdateTradeRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 + if len(m.MaxAllowedSwapLossRate) > 0 { + i -= len(m.MaxAllowedSwapLossRate) + copy(dAtA[i:], m.MaxAllowedSwapLossRate) + i = encodeVarintTx(dAtA, i, uint64(len(m.MaxAllowedSwapLossRate))) + i-- + dAtA[i] = 0x2a + } if m.PoolId != 0 { i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) i-- dAtA[i] = 0x20 } - if len(m.RewardDenom) > 0 { - i -= len(m.RewardDenom) - copy(dAtA[i:], m.RewardDenom) - i = encodeVarintTx(dAtA, i, uint64(len(m.RewardDenom))) - i-- - dAtA[i] = 0x1a - } if len(m.HostDenom) > 0 { i -= len(m.HostDenom) copy(dAtA[i:], m.HostDenom) i = encodeVarintTx(dAtA, i, uint64(len(m.HostDenom))) i-- + dAtA[i] = 0x1a + } + if len(m.RewardDenom) > 0 { + i -= len(m.RewardDenom) + copy(dAtA[i:], m.RewardDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardDenom))) + i-- dAtA[i] = 0x12 } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0xa } @@ -4954,12 +4988,10 @@ func (m *MsgCreateTradeRoute) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.MinSwapAmount != 0 { - n += 1 + sovTx(uint64(m.MinSwapAmount)) - } - if m.MaxSwapAmount != 0 { - n += 2 + sovTx(uint64(m.MaxSwapAmount)) - } + l = m.MinSwapAmount.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.MaxSwapAmount.Size() + n += 2 + l + sovTx(uint64(l)) return n } @@ -4978,15 +5010,15 @@ func (m *MsgDeleteTradeRoute) Size() (n int) { } var l int _ = l - l = len(m.Creator) + l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.HostDenom) + l = len(m.RewardDenom) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.RewardDenom) + l = len(m.HostDenom) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -5008,21 +5040,25 @@ func (m *MsgUpdateTradeRoute) Size() (n int) { } var l int _ = l - l = len(m.Creator) + l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.HostDenom) + l = len(m.RewardDenom) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.RewardDenom) + l = len(m.HostDenom) if l > 0 { n += 1 + l + sovTx(uint64(l)) } if m.PoolId != 0 { n += 1 + sovTx(uint64(m.PoolId)) } + l = len(m.MaxAllowedSwapLossRate) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = m.MinSwapAmount.Size() n += 1 + l + sovTx(uint64(l)) l = m.MaxSwapAmount.Size() @@ -8962,10 +8998,10 @@ func (m *MsgCreateTradeRoute) Unmarshal(dAtA []byte) error { m.MaxAllowedSwapLossRate = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 15: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinSwapAmount", wireType) } - m.MinSwapAmount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8975,16 +9011,31 @@ func (m *MsgCreateTradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinSwapAmount |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinSwapAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 16: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxSwapAmount", wireType) } - m.MaxSwapAmount = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -8994,11 +9045,26 @@ func (m *MsgCreateTradeRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxSwapAmount |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxSwapAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -9101,7 +9167,7 @@ func (m *MsgDeleteTradeRoute) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9129,11 +9195,11 @@ func (m *MsgDeleteTradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Creator = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9161,11 +9227,11 @@ func (m *MsgDeleteTradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HostDenom = string(dAtA[iNdEx:postIndex]) + m.RewardDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HostDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9193,7 +9259,7 @@ func (m *MsgDeleteTradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardDenom = string(dAtA[iNdEx:postIndex]) + m.HostDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -9297,7 +9363,7 @@ func (m *MsgUpdateTradeRoute) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9325,11 +9391,11 @@ func (m *MsgUpdateTradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Creator = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9357,11 +9423,11 @@ func (m *MsgUpdateTradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HostDenom = string(dAtA[iNdEx:postIndex]) + m.RewardDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardDenom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HostDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9389,7 +9455,7 @@ func (m *MsgUpdateTradeRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardDenom = string(dAtA[iNdEx:postIndex]) + m.HostDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -9411,6 +9477,38 @@ func (m *MsgUpdateTradeRoute) Unmarshal(dAtA []byte) error { } } case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAllowedSwapLossRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MaxAllowedSwapLossRate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinSwapAmount", wireType) } @@ -9444,7 +9542,7 @@ func (m *MsgUpdateTradeRoute) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxSwapAmount", wireType) }