diff --git a/config.yml b/config.yml index 314158cb5..770e65a91 100644 --- a/config.yml +++ b/config.yml @@ -2,8 +2,11 @@ version: 1 accounts: - name: treasury coins: + - 100000000uatom + - 100000000uusdt - 9000000000000000uelys - 100000000ueden + mnemonic: olympic slide park figure frost benefit deer reform fly pull price airport submit monitor silk insect uphold convince pupil project ignore roof warfare slight - name: seed coins: - 9000000000000000uelys @@ -300,10 +303,22 @@ genesis: display: "BTC" bandTicker: "BTC" elysTicker: "BTC" + decimal: 9 - denom: "wei" display: "ETH" bandTicker: "ETH" elysTicker: "ETH" + decimal: 18 + - denom: "uatom" + display: "ATOM" + bandTicker: "ATOM" + elysTicker: "ATOM" + decimal: 6 + - denom: "uusdt" + display: "USDT" + bandTicker: "USDT" + elysTicker: "USDT" + decimal: 6 params: ask_count: "4" band_channel_source: "channel-0" @@ -323,6 +338,16 @@ genesis: - feeder: "elys12tzylat4udvjj56uuhu3vj2n4vgp7cf9fwna9w" is_active: true prices: + - asset: USDT + price: "1.00" + provider: elys12tzylat4udvjj56uuhu3vj2n4vgp7cf9fwna9w + source: elys + timestamp: "1694743319" + - asset: USDC + price: "1.00" + provider: elys12tzylat4udvjj56uuhu3vj2n4vgp7cf9fwna9w + source: elys + timestamp: "1694743319" burner: params: epochIdentifier: day diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 1d03fd3a9..1717056b1 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -77678,6 +77678,15 @@ definitions: signatures required by gogoproto. weight: type: string + elys.amm.AssetAmountDepth: + type: object + properties: + asset: + type: string + amount: + type: string + depth: + type: string elys.amm.DenomLiquidity: type: object properties: @@ -77685,6 +77694,26 @@ definitions: type: string liquidity: type: string + elys.amm.ExternalLiquidity: + type: object + properties: + poolId: + type: string + format: uint64 + amountDepthInfo: + type: array + items: + type: object + properties: + asset: + type: string + amount: + type: string + depth: + type: string + description: >- + ExternalLiquidity defines price, volume, and time information for an + exchange rate. elys.amm.MsgCreatePoolResponse: type: object properties: @@ -77708,6 +77737,8 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + elys.amm.MsgFeedMultipleExternalLiquidityResponse: + type: object elys.amm.MsgJoinPoolResponse: type: object properties: diff --git a/proto/elys/amm/tx.proto b/proto/elys/amm/tx.proto index 1a3a76add..f6e547df4 100644 --- a/proto/elys/amm/tx.proto +++ b/proto/elys/amm/tx.proto @@ -17,6 +17,7 @@ service Msg { rpc ExitPool (MsgExitPool ) returns (MsgExitPoolResponse ); rpc SwapExactAmountIn (MsgSwapExactAmountIn ) returns (MsgSwapExactAmountInResponse ); rpc SwapExactAmountOut (MsgSwapExactAmountOut) returns (MsgSwapExactAmountOutResponse); + rpc FeedMultipleExternalLiquidity(MsgFeedMultipleExternalLiquidity) returns (MsgFeedMultipleExternalLiquidityResponse); } message MsgCreatePool { string sender = 1; @@ -74,3 +75,28 @@ message MsgSwapExactAmountOutResponse { string tokenInAmount = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; } +message MsgFeedMultipleExternalLiquidity { + string sender = 1; + repeated ExternalLiquidity liquidity = 2 [(gogoproto.nullable) = false]; +} +message MsgFeedMultipleExternalLiquidityResponse {} + +message AssetAmountDepth { + string asset = 1; + string amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string depth = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// ExternalLiquidity defines price, volume, and time information for an exchange rate. +message ExternalLiquidity { + uint64 poolId = 1; + repeated AssetAmountDepth amountDepthInfo = 2 [ + (gogoproto.nullable) = false + ]; +} diff --git a/x/amm/client/cli/query_pool.go b/x/amm/client/cli/query_pool.go index f947468ff..65bf04d88 100644 --- a/x/amm/client/cli/query_pool.go +++ b/x/amm/client/cli/query_pool.go @@ -12,8 +12,9 @@ import ( func CmdListPool() *cobra.Command { cmd := &cobra.Command{ - Use: "list-pool", - Short: "list all pool", + Use: "list-pool", + Short: "list all pool", + Example: "elysd query amm list-pool", RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) diff --git a/x/amm/client/cli/tx_create_pool.go b/x/amm/client/cli/tx_create_pool.go index a9fa8380f..8348b4df3 100644 --- a/x/amm/client/cli/tx_create_pool.go +++ b/x/amm/client/cli/tx_create_pool.go @@ -16,9 +16,10 @@ var _ = strconv.Itoa(0) func CmdCreatePool() *cobra.Command { cmd := &cobra.Command{ - Use: "create-pool [weights] [initial-deposit] [swap-fee] [exit-fee]", - Short: "create a new pool and provide the liquidity to it", - Args: cobra.ExactArgs(6), + Use: "create-pool [weights] [initial-deposit] [swap-fee] [exit-fee]", + Short: "create a new pool and provide the liquidity to it", + Example: `elysd tx amm create-pool 100ueden,100uelys 1000000ueden,1000000uelys 0.00 0.00 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000`, + Args: cobra.ExactArgs(4), RunE: func(cmd *cobra.Command, args []string) (err error) { argWeights, err := sdk.ParseCoinsNormalized(args[0]) if err != nil { diff --git a/x/amm/keeper/msg_server_feed_multiple_external_liquidity.go b/x/amm/keeper/msg_server_feed_multiple_external_liquidity.go new file mode 100644 index 000000000..26c3d9a7f --- /dev/null +++ b/x/amm/keeper/msg_server_feed_multiple_external_liquidity.go @@ -0,0 +1,82 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/amm/types" + oracletypes "github.com/elys-network/elys/x/oracle/types" +) + +func AssetsValue(ctx sdk.Context, oracleKeeper types.OracleKeeper, amountDepthInfo []types.AssetAmountDepth) (sdk.Dec, sdk.Dec, error) { + totalValue := sdk.ZeroDec() + totalDepth := sdk.ZeroDec() + if len(amountDepthInfo) == 0 { + return sdk.ZeroDec(), sdk.ZeroDec(), nil + } + for _, asset := range amountDepthInfo { + price, found := oracleKeeper.GetAssetPrice(ctx, asset.Asset) + if !found { + return sdk.ZeroDec(), sdk.ZeroDec(), fmt.Errorf("asset price not set: %s", asset.Asset) + } else { + v := price.Price.Mul(asset.Amount) + totalValue = totalValue.Add(v) + } + totalDepth = totalDepth.Add(asset.Depth) + } + avgDepth := totalDepth.Quo(sdk.NewDec(int64(len(amountDepthInfo)))) + return totalValue, avgDepth, nil +} + +func LiquidityRatioFromPriceDepth(depth sdk.Dec) sdk.Dec { + if depth == sdk.OneDec() { + return sdk.OneDec() + } + sqrt, err := sdk.OneDec().Sub(depth).ApproxSqrt() + if err != nil { + panic(err) + } + return sdk.OneDec().Sub(sqrt) +} + +func (k msgServer) FeedMultipleExternalLiquidity(goCtx context.Context, msg *types.MsgFeedMultipleExternalLiquidity) (*types.MsgFeedMultipleExternalLiquidityResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + feeder, found := k.oracleKeeper.GetPriceFeeder(ctx, msg.Sender) + if !found { + return nil, oracletypes.ErrNotAPriceFeeder + } + + if !feeder.IsActive { + return nil, oracletypes.ErrPriceFeederNotActive + } + + for _, el := range msg.Liquidity { + pool, found := k.GetPool(ctx, el.PoolId) + if !found { + return nil, types.ErrInvalidPoolId + } + + tvl, err := pool.TVL(ctx, k.oracleKeeper) + if err != nil { + return nil, err + } + + elValue, elDepth, err := AssetsValue(ctx, k.oracleKeeper, el.AmountDepthInfo) + if err != nil { + return nil, err + } + + elRatio := elValue.Quo(tvl) + elRatio = elRatio.Quo(LiquidityRatioFromPriceDepth(elDepth)) + if elRatio.LT(sdk.OneDec()) { + elRatio = sdk.OneDec() + } + + pool.PoolParams.ExternalLiquidityRatio = elRatio + k.SetPool(ctx, pool) + } + + return &types.MsgFeedMultipleExternalLiquidityResponse{}, nil +} diff --git a/x/amm/keeper/msg_server_feed_multiple_external_liquidity_test.go b/x/amm/keeper/msg_server_feed_multiple_external_liquidity_test.go new file mode 100644 index 000000000..21969eaa9 --- /dev/null +++ b/x/amm/keeper/msg_server_feed_multiple_external_liquidity_test.go @@ -0,0 +1,27 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/amm/keeper" +) + +func (suite *KeeperTestSuite) TestLiquidityRatioFromPriceDepth() { + depth := sdk.NewDecWithPrec(1, 2) // 1% + suite.Require().Equal("0.005012562893380046", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(2, 2) // 2% + suite.Require().Equal("0.010050506338833466", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(5, 2) // 5% + suite.Require().Equal("0.025320565519103610", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(10, 2) // 10% + suite.Require().Equal("0.051316701949486201", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(30, 2) // 30% + suite.Require().Equal("0.163339973465924452", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(50, 2) // 50% + suite.Require().Equal("0.292893218813452476", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(70, 2) // 70% + suite.Require().Equal("0.452277442494833887", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(90, 2) // 90% + suite.Require().Equal("0.683772233983162067", keeper.LiquidityRatioFromPriceDepth(depth).String()) + depth = sdk.NewDecWithPrec(100, 2) // 100% + suite.Require().Equal("1.000000000000000000", keeper.LiquidityRatioFromPriceDepth(depth).String()) +} diff --git a/x/amm/types/codec.go b/x/amm/types/codec.go index c394d3ac6..fc0fc8929 100644 --- a/x/amm/types/codec.go +++ b/x/amm/types/codec.go @@ -12,6 +12,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgJoinPool{}, "amm/JoinPool", nil) cdc.RegisterConcrete(&MsgExitPool{}, "amm/ExitPool", nil) cdc.RegisterConcrete(&MsgSwapExactAmountIn{}, "amm/SwapExactAmountIn", nil) + cdc.RegisterConcrete(&MsgFeedMultipleExternalLiquidity{}, "amm/FeedMultipleExternalLiquidity", nil) cdc.RegisterConcrete(&MsgSwapExactAmountOut{}, "amm/SwapExactAmountOut", nil) // this line is used by starport scaffolding # 2 } @@ -19,18 +20,11 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreatePool{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgJoinPool{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgExitPool{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSwapExactAmountIn{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSwapExactAmountOut{}, + &MsgFeedMultipleExternalLiquidity{}, ) // this line is used by starport scaffolding # 3 diff --git a/x/amm/types/expected_keepers.go b/x/amm/types/expected_keepers.go index c335e18a6..df40c1e05 100644 --- a/x/amm/types/expected_keepers.go +++ b/x/amm/types/expected_keepers.go @@ -5,6 +5,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" atypes "github.com/elys-network/elys/x/assetprofile/types" + oracletypes "github.com/elys-network/elys/x/oracle/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -30,7 +31,9 @@ type BankKeeper interface { // OracleKeeper defines the expected interface needed to retrieve price info type OracleKeeper interface { + GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) GetAssetPriceFromDenom(ctx sdk.Context, denom string) sdk.Dec + GetPriceFeeder(ctx sdk.Context, feeder string) (val oracletypes.PriceFeeder, found bool) } // AssetProfileKeeper defines the expected interfaces diff --git a/x/amm/types/message_feed_multiple_external_liquidity.go b/x/amm/types/message_feed_multiple_external_liquidity.go new file mode 100644 index 000000000..e871dbb0b --- /dev/null +++ b/x/amm/types/message_feed_multiple_external_liquidity.go @@ -0,0 +1,45 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgFeedMultipleExternalLiquidity = "feed_multiple_external_liquidity" + +var _ sdk.Msg = &MsgFeedMultipleExternalLiquidity{} + +func NewMsgFeedMultipleExternalLiquidity(sender string) *MsgFeedMultipleExternalLiquidity { + return &MsgFeedMultipleExternalLiquidity{ + Sender: sender, + } +} + +func (msg *MsgFeedMultipleExternalLiquidity) Route() string { + return RouterKey +} + +func (msg *MsgFeedMultipleExternalLiquidity) Type() string { + return TypeMsgSwapExactAmountOut +} + +func (msg *MsgFeedMultipleExternalLiquidity) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} + +func (msg *MsgFeedMultipleExternalLiquidity) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgFeedMultipleExternalLiquidity) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + } + return nil +} diff --git a/x/amm/types/query.pb.gw.go b/x/amm/types/query.pb.gw.go index 3b891ece9..2babba22a 100644 --- a/x/amm/types/query.pb.gw.go +++ b/x/amm/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -234,14 +232,12 @@ func local_request_Query_DenomLiquidityAll_0(ctx context.Context, marshaler runt // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -249,7 +245,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -263,8 +258,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Pool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -272,7 +265,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Pool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -286,8 +278,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_PoolAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -295,7 +285,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_PoolAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -309,8 +298,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DenomLiquidity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -318,7 +305,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DenomLiquidity_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -332,8 +318,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DenomLiquidityAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -341,7 +325,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DenomLiquidityAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/amm/types/tx.pb.go b/x/amm/types/tx.pb.go index 0ec345bb4..4cc4a4ed2 100644 --- a/x/amm/types/tx.pb.go +++ b/x/amm/types/tx.pb.go @@ -549,6 +549,195 @@ func (m *MsgSwapExactAmountOutResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSwapExactAmountOutResponse proto.InternalMessageInfo +type MsgFeedMultipleExternalLiquidity struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Liquidity []ExternalLiquidity `protobuf:"bytes,2,rep,name=liquidity,proto3" json:"liquidity"` +} + +func (m *MsgFeedMultipleExternalLiquidity) Reset() { *m = MsgFeedMultipleExternalLiquidity{} } +func (m *MsgFeedMultipleExternalLiquidity) String() string { return proto.CompactTextString(m) } +func (*MsgFeedMultipleExternalLiquidity) ProtoMessage() {} +func (*MsgFeedMultipleExternalLiquidity) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7ddafd861f6b7f, []int{10} +} +func (m *MsgFeedMultipleExternalLiquidity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFeedMultipleExternalLiquidity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFeedMultipleExternalLiquidity.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 *MsgFeedMultipleExternalLiquidity) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFeedMultipleExternalLiquidity.Merge(m, src) +} +func (m *MsgFeedMultipleExternalLiquidity) XXX_Size() int { + return m.Size() +} +func (m *MsgFeedMultipleExternalLiquidity) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFeedMultipleExternalLiquidity.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFeedMultipleExternalLiquidity proto.InternalMessageInfo + +func (m *MsgFeedMultipleExternalLiquidity) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgFeedMultipleExternalLiquidity) GetLiquidity() []ExternalLiquidity { + if m != nil { + return m.Liquidity + } + return nil +} + +type MsgFeedMultipleExternalLiquidityResponse struct { +} + +func (m *MsgFeedMultipleExternalLiquidityResponse) Reset() { + *m = MsgFeedMultipleExternalLiquidityResponse{} +} +func (m *MsgFeedMultipleExternalLiquidityResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFeedMultipleExternalLiquidityResponse) ProtoMessage() {} +func (*MsgFeedMultipleExternalLiquidityResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7ddafd861f6b7f, []int{11} +} +func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFeedMultipleExternalLiquidityResponse.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 *MsgFeedMultipleExternalLiquidityResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFeedMultipleExternalLiquidityResponse.Merge(m, src) +} +func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFeedMultipleExternalLiquidityResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFeedMultipleExternalLiquidityResponse proto.InternalMessageInfo + +type AssetAmountDepth struct { + Asset string `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"amount"` + Depth github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=depth,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"depth"` +} + +func (m *AssetAmountDepth) Reset() { *m = AssetAmountDepth{} } +func (m *AssetAmountDepth) String() string { return proto.CompactTextString(m) } +func (*AssetAmountDepth) ProtoMessage() {} +func (*AssetAmountDepth) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7ddafd861f6b7f, []int{12} +} +func (m *AssetAmountDepth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AssetAmountDepth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AssetAmountDepth.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 *AssetAmountDepth) XXX_Merge(src proto.Message) { + xxx_messageInfo_AssetAmountDepth.Merge(m, src) +} +func (m *AssetAmountDepth) XXX_Size() int { + return m.Size() +} +func (m *AssetAmountDepth) XXX_DiscardUnknown() { + xxx_messageInfo_AssetAmountDepth.DiscardUnknown(m) +} + +var xxx_messageInfo_AssetAmountDepth proto.InternalMessageInfo + +func (m *AssetAmountDepth) GetAsset() string { + if m != nil { + return m.Asset + } + return "" +} + +// ExternalLiquidity defines price, volume, and time information for an exchange rate. +type ExternalLiquidity struct { + PoolId uint64 `protobuf:"varint,1,opt,name=poolId,proto3" json:"poolId,omitempty"` + AmountDepthInfo []AssetAmountDepth `protobuf:"bytes,2,rep,name=amountDepthInfo,proto3" json:"amountDepthInfo"` +} + +func (m *ExternalLiquidity) Reset() { *m = ExternalLiquidity{} } +func (m *ExternalLiquidity) String() string { return proto.CompactTextString(m) } +func (*ExternalLiquidity) ProtoMessage() {} +func (*ExternalLiquidity) Descriptor() ([]byte, []int) { + return fileDescriptor_ed7ddafd861f6b7f, []int{13} +} +func (m *ExternalLiquidity) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExternalLiquidity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExternalLiquidity.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 *ExternalLiquidity) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExternalLiquidity.Merge(m, src) +} +func (m *ExternalLiquidity) XXX_Size() int { + return m.Size() +} +func (m *ExternalLiquidity) XXX_DiscardUnknown() { + xxx_messageInfo_ExternalLiquidity.DiscardUnknown(m) +} + +var xxx_messageInfo_ExternalLiquidity proto.InternalMessageInfo + +func (m *ExternalLiquidity) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func (m *ExternalLiquidity) GetAmountDepthInfo() []AssetAmountDepth { + if m != nil { + return m.AmountDepthInfo + } + return nil +} + func init() { proto.RegisterType((*MsgCreatePool)(nil), "elys.amm.MsgCreatePool") proto.RegisterType((*MsgCreatePoolResponse)(nil), "elys.amm.MsgCreatePoolResponse") @@ -560,60 +749,74 @@ func init() { proto.RegisterType((*MsgSwapExactAmountInResponse)(nil), "elys.amm.MsgSwapExactAmountInResponse") proto.RegisterType((*MsgSwapExactAmountOut)(nil), "elys.amm.MsgSwapExactAmountOut") proto.RegisterType((*MsgSwapExactAmountOutResponse)(nil), "elys.amm.MsgSwapExactAmountOutResponse") + proto.RegisterType((*MsgFeedMultipleExternalLiquidity)(nil), "elys.amm.MsgFeedMultipleExternalLiquidity") + proto.RegisterType((*MsgFeedMultipleExternalLiquidityResponse)(nil), "elys.amm.MsgFeedMultipleExternalLiquidityResponse") + proto.RegisterType((*AssetAmountDepth)(nil), "elys.amm.AssetAmountDepth") + proto.RegisterType((*ExternalLiquidity)(nil), "elys.amm.ExternalLiquidity") } func init() { proto.RegisterFile("elys/amm/tx.proto", fileDescriptor_ed7ddafd861f6b7f) } var fileDescriptor_ed7ddafd861f6b7f = []byte{ - // 764 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x4f, 0xdb, 0x4a, - 0x14, 0x8d, 0x93, 0xbc, 0xc0, 0xbb, 0xbc, 0x3c, 0x95, 0xe1, 0xa3, 0x21, 0x05, 0x07, 0xb9, 0x15, - 0xcd, 0x06, 0x5b, 0xd0, 0x6e, 0x68, 0xbb, 0x28, 0x01, 0x2a, 0xa5, 0x52, 0x14, 0xe4, 0xa2, 0x2e, - 0x68, 0x55, 0xe4, 0x24, 0xa3, 0x10, 0x81, 0x67, 0xa2, 0xcc, 0x18, 0xc2, 0xae, 0xaa, 0xba, 0xae, - 0xba, 0xec, 0x4f, 0xe8, 0x4f, 0x61, 0xc9, 0xb2, 0x62, 0x81,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9, 0xa3, 0x24, 0xeb, 0x5f, 0x52, 0x90, - 0xaa, 0xb0, 0x26, 0x7a, 0x05, 0x10, 0xba, 0xb6, 0xee, 0xdf, 0x28, 0x1a, 0xb9, 0x35, 0xf2, 0x85, - 0x5b, 0x12, 0xc1, 0x2a, 0x5f, 0xc2, 0x64, 0x70, 0x4b, 0xcc, 0x45, 0x8a, 0xfd, 0x70, 0x7e, 0x69, - 0x68, 0x38, 0xcc, 0x10, 0x9c, 0x6f, 0x51, 0x06, 0x3f, 0x3c, 0xc0, 0x10, 0x3b, 0x0b, 0xde, 0xc1, - 0x74, 0x7c, 0x2b, 0xeb, 0x11, 0x4c, 0x2c, 0x9f, 0x5f, 0xb9, 0x3b, 0x1f, 0x90, 0x7f, 0x00, 0x34, - 0xe4, 0x55, 0x2d, 0xdc, 0x85, 0xae, 0x7a, 0x3c, 0xff, 0xf8, 0x37, 0x05, 0x3e, 0x7f, 0xa9, 0x74, - 0xde, 0xd3, 0xb5, 0x8b, 0x9e, 0xae, 0xfd, 0xec, 0xe9, 0xda, 0xd7, 0x6b, 0x3d, 0x71, 0x71, 0xad, - 0x27, 0x7e, 0x5c, 0xeb, 0x89, 0xfd, 0x62, 0xc8, 0x61, 0x41, 0xb6, 0x4a, 0x30, 0x3f, 0xa5, 0x9d, - 0x23, 0xf9, 0x60, 0x75, 0xfb, 0x1f, 0x47, 0xc2, 0xe7, 0x5a, 0x46, 0x7e, 0x8e, 0x3c, 0xf9, 0x15, - 0x00, 0x00, 0xff, 0xff, 0xfd, 0xf7, 0xea, 0x97, 0x35, 0x09, 0x00, 0x00, + // 924 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x3a, 0x8e, 0x9b, 0xbe, 0x10, 0x68, 0xa6, 0x69, 0x71, 0x97, 0xc6, 0x8e, 0x16, 0x54, + 0xac,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0xce, 0x6f, 0x65, 0x58, 0xee, 0xf0, 0x3e, 0x3a, 0x00, + 0xc8, 0xbc, 0x48, 0xde, 0x1d, 0x11, 0xe5, 0x1e, 0x04, 0x66, 0x7d, 0x8a, 0x21, 0xdd, 0x80, 0x5f, + 0xc0, 0x6a, 0xfa, 0x00, 0xb8, 0x95, 0x73, 0x4e, 0x96, 0xcd, 0xad, 0x89, 0xcb, 0x59, 0x86, 0xf4, + 0xea, 0xca, 0x33, 0x24, 0xcb, 0x63, 0x0c, 0x85, 0x31, 0xff, 0x0d, 0x6c, 0x14, 0xa7, 0x74, 0x2d, + 0x87, 0x29, 0xd8, 0xcd, 0x7b, 0xb3, 0xed, 0x29, 0xf9, 0x77, 0x80, 0x26, 0x4c, 0xa1, 0xfa, 0x2c, + 0xf4, 0x61, 0x24, 0xcc, 0x0f, 0x5f, 0xe3, 0x90, 0xf2, 0xff, 0x04, 0x5b, 0xb3, 0x0f, 0xda, 0xfd, + 0x1c, 0xd3, 0x4c, 0x5f, 0x73, 0x67, 0x7e, 0xdf, 0x24, 0x81, 0x66, 0xf3, 0xc5, 0x65, 0xcd, 0x78, + 0x79, 0x59, 0x33, 0xfe, 0xb9, 0xac, 0x19, 0xbf, 0x5f, 0xd5, 0x96, 0x5e, 0x5e, 0xd5, 0x96, 0xfe, + 0xbe, 0xaa, 0x2d, 0x3d, 0x6d, 0x64, 0xf6, 0xb4, 0xe4, 0x7d, 0x40, 0x89, 0x38, 0x63, 0xe1, 0xa9, + 0xfa, 0x70, 0x86, 0xf1, 0xc3, 0x5b, 0xee, 0xec, 0xe3, 0x8a, 0x7a, 0xea, 0x7e, 0xf4, 0x6f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xe9, 0x6b, 0x9f, 0x9d, 0x91, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -633,6 +836,7 @@ type MsgClient interface { ExitPool(ctx context.Context, in *MsgExitPool, opts ...grpc.CallOption) (*MsgExitPoolResponse, error) SwapExactAmountIn(ctx context.Context, in *MsgSwapExactAmountIn, opts ...grpc.CallOption) (*MsgSwapExactAmountInResponse, error) SwapExactAmountOut(ctx context.Context, in *MsgSwapExactAmountOut, opts ...grpc.CallOption) (*MsgSwapExactAmountOutResponse, error) + FeedMultipleExternalLiquidity(ctx context.Context, in *MsgFeedMultipleExternalLiquidity, opts ...grpc.CallOption) (*MsgFeedMultipleExternalLiquidityResponse, error) } type msgClient struct { @@ -688,6 +892,15 @@ func (c *msgClient) SwapExactAmountOut(ctx context.Context, in *MsgSwapExactAmou return out, nil } +func (c *msgClient) FeedMultipleExternalLiquidity(ctx context.Context, in *MsgFeedMultipleExternalLiquidity, opts ...grpc.CallOption) (*MsgFeedMultipleExternalLiquidityResponse, error) { + out := new(MsgFeedMultipleExternalLiquidityResponse) + err := c.cc.Invoke(ctx, "/elys.amm.Msg/FeedMultipleExternalLiquidity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { CreatePool(context.Context, *MsgCreatePool) (*MsgCreatePoolResponse, error) @@ -695,6 +908,7 @@ type MsgServer interface { ExitPool(context.Context, *MsgExitPool) (*MsgExitPoolResponse, error) SwapExactAmountIn(context.Context, *MsgSwapExactAmountIn) (*MsgSwapExactAmountInResponse, error) SwapExactAmountOut(context.Context, *MsgSwapExactAmountOut) (*MsgSwapExactAmountOutResponse, error) + FeedMultipleExternalLiquidity(context.Context, *MsgFeedMultipleExternalLiquidity) (*MsgFeedMultipleExternalLiquidityResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -716,6 +930,9 @@ func (*UnimplementedMsgServer) SwapExactAmountIn(ctx context.Context, req *MsgSw func (*UnimplementedMsgServer) SwapExactAmountOut(ctx context.Context, req *MsgSwapExactAmountOut) (*MsgSwapExactAmountOutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SwapExactAmountOut not implemented") } +func (*UnimplementedMsgServer) FeedMultipleExternalLiquidity(ctx context.Context, req *MsgFeedMultipleExternalLiquidity) (*MsgFeedMultipleExternalLiquidityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeedMultipleExternalLiquidity not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -811,6 +1028,24 @@ func _Msg_SwapExactAmountOut_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Msg_FeedMultipleExternalLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFeedMultipleExternalLiquidity) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FeedMultipleExternalLiquidity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/elys.amm.Msg/FeedMultipleExternalLiquidity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FeedMultipleExternalLiquidity(ctx, req.(*MsgFeedMultipleExternalLiquidity)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.amm.Msg", HandlerType: (*MsgServer)(nil), @@ -835,6 +1070,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SwapExactAmountOut", Handler: _Msg_SwapExactAmountOut_Handler, }, + { + MethodName: "FeedMultipleExternalLiquidity", + Handler: _Msg_FeedMultipleExternalLiquidity_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "elys/amm/tx.proto", @@ -1327,77 +1566,236 @@ func (m *MsgSwapExactAmountOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgFeedMultipleExternalLiquidity) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgCreatePool) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgFeedMultipleExternalLiquidity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFeedMultipleExternalLiquidity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.PoolParams != nil { - l = m.PoolParams.Size() - n += 1 + l + sovTx(uint64(l)) - } - if len(m.PoolAssets) > 0 { - for _, e := range m.PoolAssets { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.Liquidity) > 0 { + for iNdEx := len(m.Liquidity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Liquidity[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - return n + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgCreatePoolResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgFeedMultipleExternalLiquidityResponse) 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 *MsgFeedMultipleExternalLiquidityResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFeedMultipleExternalLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.PoolID != 0 { - n += 1 + sovTx(uint64(m.PoolID)) - } - return n + return len(dAtA) - i, nil } -func (m *MsgJoinPool) Size() (n int) { - if m == nil { - return 0 +func (m *AssetAmountDepth) 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 *AssetAmountDepth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssetAmountDepth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.PoolId != 0 { - n += 1 + sovTx(uint64(m.PoolId)) + { + size := m.Depth.Size() + i -= size + if _, err := m.Depth.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) } - if len(m.MaxAmountsIn) > 0 { - for _, e := range m.MaxAmountsIn { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x1a + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintTx(dAtA, i, uint64(size)) } - l = m.ShareAmountOut.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgJoinPoolResponse) Size() (n int) { + i-- + dAtA[i] = 0x12 + if len(m.Asset) > 0 { + i -= len(m.Asset) + copy(dAtA[i:], m.Asset) + i = encodeVarintTx(dAtA, i, uint64(len(m.Asset))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExternalLiquidity) 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 *ExternalLiquidity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExternalLiquidity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AmountDepthInfo) > 0 { + for iNdEx := len(m.AmountDepthInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AmountDepthInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.PoolId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreatePool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PoolParams != nil { + l = m.PoolParams.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.PoolAssets) > 0 { + for _, e := range m.PoolAssets { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgCreatePoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolID != 0 { + n += 1 + sovTx(uint64(m.PoolID)) + } + return n +} + +func (m *MsgJoinPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PoolId != 0 { + n += 1 + sovTx(uint64(m.PoolId)) + } + if len(m.MaxAmountsIn) > 0 { + for _, e := range m.MaxAmountsIn { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = m.ShareAmountOut.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgJoinPoolResponse) Size() (n int) { if m == nil { return 0 } @@ -1525,6 +1923,69 @@ func (m *MsgSwapExactAmountOutResponse) Size() (n int) { return n } +func (m *MsgFeedMultipleExternalLiquidity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Liquidity) > 0 { + for _, e := range m.Liquidity { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgFeedMultipleExternalLiquidityResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *AssetAmountDepth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Asset) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Depth.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *ExternalLiquidity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovTx(uint64(m.PoolId)) + } + if len(m.AmountDepthInfo) > 0 { + for _, e := range m.AmountDepthInfo { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2858,6 +3319,425 @@ func (m *MsgSwapExactAmountOutResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgFeedMultipleExternalLiquidity) 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 ErrIntOverflowTx + } + 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: MsgFeedMultipleExternalLiquidity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFeedMultipleExternalLiquidity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Liquidity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Liquidity = append(m.Liquidity, ExternalLiquidity{}) + if err := m.Liquidity[len(m.Liquidity)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgFeedMultipleExternalLiquidityResponse) 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 ErrIntOverflowTx + } + 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: MsgFeedMultipleExternalLiquidityResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFeedMultipleExternalLiquidityResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AssetAmountDepth) 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 ErrIntOverflowTx + } + 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: AssetAmountDepth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AssetAmountDepth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Asset", 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.Asset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depth", 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 + } + if err := m.Depth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExternalLiquidity) 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 ErrIntOverflowTx + } + 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: ExternalLiquidity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExternalLiquidity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountDepthInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AmountDepthInfo = append(m.AmountDepthInfo, AssetAmountDepth{}) + if err := m.AmountDepthInfo[len(m.AmountDepthInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/incentive/types/expected_keepers.go b/x/incentive/types/expected_keepers.go index 7ed4191fe..cf4ebe9c4 100644 --- a/x/incentive/types/expected_keepers.go +++ b/x/incentive/types/expected_keepers.go @@ -6,6 +6,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ammtypes "github.com/elys-network/elys/x/amm/types" ctypes "github.com/elys-network/elys/x/commitment/types" + oracletypes "github.com/elys-network/elys/x/oracle/types" ) // CommitmentKeeper @@ -105,7 +106,9 @@ type AmmKeeper interface { // OracleKeeper defines the expected interface needed to retrieve price info type OracleKeeper interface { + GetAssetPrice(ctx sdk.Context, asset string) (oracletypes.Price, bool) GetAssetPriceFromDenom(ctx sdk.Context, denom string) sdk.Dec + GetPriceFeeder(ctx sdk.Context, feeder string) (val oracletypes.PriceFeeder, found bool) } // AccountedPoolKeeper