Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- type MsgClient
- type MsgCreateStableswapPool
- func (msg MsgCreateStableswapPool) CreatePool(ctx sdk.Context, poolId uint64) (types.PoolI, error)
- func (*MsgCreateStableswapPool) Descriptor() ([]byte, []int)
- func (m *MsgCreateStableswapPool) GetFuturePoolGovernor() string
- func (m *MsgCreateStableswapPool) GetInitialPoolLiquidity() github_com_cosmos_cosmos_sdk_types.Coins
- func (m *MsgCreateStableswapPool) GetPoolParams() *PoolParams
- func (m *MsgCreateStableswapPool) GetSender() string
- func (msg MsgCreateStableswapPool) GetSignBytes() []byte
- func (msg MsgCreateStableswapPool) GetSigners() []sdk.AccAddress
- func (msg MsgCreateStableswapPool) InitialLiquidity() sdk.Coins
- func (m *MsgCreateStableswapPool) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateStableswapPool) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateStableswapPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (msg MsgCreateStableswapPool) PoolCreator() sdk.AccAddress
- func (*MsgCreateStableswapPool) ProtoMessage()
- func (m *MsgCreateStableswapPool) Reset()
- func (msg MsgCreateStableswapPool) Route() string
- func (m *MsgCreateStableswapPool) Size() (n int)
- func (m *MsgCreateStableswapPool) String() string
- func (msg MsgCreateStableswapPool) Type() string
- func (m *MsgCreateStableswapPool) Unmarshal(dAtA []byte) error
- func (msg MsgCreateStableswapPool) Validate(ctx sdk.Context) error
- func (msg MsgCreateStableswapPool) ValidateBasic() error
- func (m *MsgCreateStableswapPool) XXX_DiscardUnknown()
- func (m *MsgCreateStableswapPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateStableswapPool) XXX_Merge(src proto.Message)
- func (m *MsgCreateStableswapPool) XXX_Size() int
- func (m *MsgCreateStableswapPool) XXX_Unmarshal(b []byte) error
- type MsgCreateStableswapPoolResponse
- func (*MsgCreateStableswapPoolResponse) Descriptor() ([]byte, []int)
- func (m *MsgCreateStableswapPoolResponse) GetPoolID() uint64
- func (m *MsgCreateStableswapPoolResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateStableswapPoolResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateStableswapPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateStableswapPoolResponse) ProtoMessage()
- func (m *MsgCreateStableswapPoolResponse) Reset()
- func (m *MsgCreateStableswapPoolResponse) Size() (n int)
- func (m *MsgCreateStableswapPoolResponse) String() string
- func (m *MsgCreateStableswapPoolResponse) Unmarshal(dAtA []byte) error
- func (m *MsgCreateStableswapPoolResponse) XXX_DiscardUnknown()
- func (m *MsgCreateStableswapPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateStableswapPoolResponse) XXX_Merge(src proto.Message)
- func (m *MsgCreateStableswapPoolResponse) XXX_Size() int
- func (m *MsgCreateStableswapPoolResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type MsgStableSwapAdjustScalingFactors
- func (*MsgStableSwapAdjustScalingFactors) Descriptor() ([]byte, []int)
- func (m *MsgStableSwapAdjustScalingFactors) GetPoolID() uint64
- func (m *MsgStableSwapAdjustScalingFactors) GetScalingFactors() []uint64
- func (m *MsgStableSwapAdjustScalingFactors) GetSender() string
- func (msg MsgStableSwapAdjustScalingFactors) GetSignBytes() []byte
- func (msg MsgStableSwapAdjustScalingFactors) GetSigners() []sdk.AccAddress
- func (m *MsgStableSwapAdjustScalingFactors) Marshal() (dAtA []byte, err error)
- func (m *MsgStableSwapAdjustScalingFactors) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgStableSwapAdjustScalingFactors) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgStableSwapAdjustScalingFactors) ProtoMessage()
- func (m *MsgStableSwapAdjustScalingFactors) Reset()
- func (msg MsgStableSwapAdjustScalingFactors) Route() string
- func (m *MsgStableSwapAdjustScalingFactors) Size() (n int)
- func (m *MsgStableSwapAdjustScalingFactors) String() string
- func (msg MsgStableSwapAdjustScalingFactors) Type() string
- func (m *MsgStableSwapAdjustScalingFactors) Unmarshal(dAtA []byte) error
- func (msg MsgStableSwapAdjustScalingFactors) ValidateBasic() error
- func (m *MsgStableSwapAdjustScalingFactors) XXX_DiscardUnknown()
- func (m *MsgStableSwapAdjustScalingFactors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgStableSwapAdjustScalingFactors) XXX_Merge(src proto.Message)
- func (m *MsgStableSwapAdjustScalingFactors) XXX_Size() int
- func (m *MsgStableSwapAdjustScalingFactors) XXX_Unmarshal(b []byte) error
- type MsgStableSwapAdjustScalingFactorsResponse
- func (*MsgStableSwapAdjustScalingFactorsResponse) Descriptor() ([]byte, []int)
- func (m *MsgStableSwapAdjustScalingFactorsResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgStableSwapAdjustScalingFactorsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgStableSwapAdjustScalingFactorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgStableSwapAdjustScalingFactorsResponse) ProtoMessage()
- func (m *MsgStableSwapAdjustScalingFactorsResponse) Reset()
- func (m *MsgStableSwapAdjustScalingFactorsResponse) Size() (n int)
- func (m *MsgStableSwapAdjustScalingFactorsResponse) String() string
- func (m *MsgStableSwapAdjustScalingFactorsResponse) Unmarshal(dAtA []byte) error
- func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_DiscardUnknown()
- func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Merge(src proto.Message)
- func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Size() int
- func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Unmarshal(b []byte) error
- type Pool
- func (pa Pool) CalcExitPoolShares(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error)
- func (pa Pool) CalcInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error)
- func (pa *Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, newLiquidity sdk.Coins, err error)
- func (pa Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error)
- func (pa Pool) Copy() Pool
- func (*Pool) Descriptor() ([]byte, []int)
- func (pa *Pool) ExitPool(ctx sdk.Context, exitingShares sdk.Int, exitFee sdk.Dec) (exitingCoins sdk.Coins, err error)
- func (pa Pool) GetAddress() sdk.AccAddress
- func (pa Pool) GetExitFee(ctx sdk.Context) sdk.Dec
- func (pa Pool) GetId() uint64
- func (pa Pool) GetScalingFactorByLiquidityIndex(liquidityIndex int) uint64
- func (pa Pool) GetScalingFactors() []uint64
- func (pa Pool) GetSwapFee(ctx sdk.Context) sdk.Dec
- func (pa Pool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins
- func (pa Pool) GetTotalShares() sdk.Int
- func (pa Pool) IsActive(ctx sdk.Context) bool
- func (pa *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, swapFee sdk.Dec) (numShares sdk.Int, err error)
- func (m *Pool) Marshal() (dAtA []byte, err error)
- func (m *Pool) MarshalTo(dAtA []byte) (int, error)
- func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (pa Pool) NumAssets() int
- func (pa *Pool) PokePool(blockTime time.Time)
- func (*Pool) ProtoMessage()
- func (m *Pool) Reset()
- func (m *Pool) Size() (n int)
- func (pa Pool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom string) (sdk.Dec, error)
- func (pa Pool) String() string
- func (pa *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec) (tokenIn sdk.Coin, err error)
- func (pa *Pool) SwapOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error)
- func (m *Pool) Unmarshal(dAtA []byte) error
- func (m *Pool) XXX_DiscardUnknown()
- func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Pool) XXX_Merge(src proto.Message)
- func (m *Pool) XXX_Size() int
- func (m *Pool) XXX_Unmarshal(b []byte) error
- type PoolParams
- func (*PoolParams) Descriptor() ([]byte, []int)
- func (m *PoolParams) Marshal() (dAtA []byte, err error)
- func (m *PoolParams) MarshalTo(dAtA []byte) (int, error)
- func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PoolParams) ProtoMessage()
- func (m *PoolParams) Reset()
- func (m *PoolParams) Size() (n int)
- func (m *PoolParams) String() string
- func (m *PoolParams) Unmarshal(dAtA []byte) error
- func (params PoolParams) Validate() error
- func (m *PoolParams) XXX_DiscardUnknown()
- func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PoolParams) XXX_Merge(src proto.Message)
- func (m *PoolParams) XXX_Size() int
- func (m *PoolParams) XXX_Unmarshal(b []byte) error
- type UnimplementedMsgServer
- func (*UnimplementedMsgServer) CreateStableswapPool(ctx context.Context, req *MsgCreateStableswapPool) (*MsgCreateStableswapPoolResponse, error)
- func (*UnimplementedMsgServer) StableSwapAdjustScalingFactors(ctx context.Context, req *MsgStableSwapAdjustScalingFactors) (*MsgStableSwapAdjustScalingFactorsResponse, error)
Constants ¶
const ( TypeMsgCreateStableswapPool = "create_stableswap_pool" TypeMsgStableSwapAdjustScalingFactors = "stable_swap_adjust_scaling_factors" )
Variables ¶
var ( ErrInvalidLengthStableswapPool = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStableswapPool = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupStableswapPool = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var ( // ModuleCdc references the global x/bank module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding as Amino is // still used for that purpose. // // The actual codec used for serialization should be provided to x/staking and // defined at the application level. ModuleCdc = codec.NewAminoCodec(amino) )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the necessary x/gamm interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterMsgServer ¶
Types ¶
type MsgClient ¶
type MsgClient interface { CreateStableswapPool(ctx context.Context, in *MsgCreateStableswapPool, opts ...grpc.CallOption) (*MsgCreateStableswapPoolResponse, error) StableSwapAdjustScalingFactors(ctx context.Context, in *MsgStableSwapAdjustScalingFactors, opts ...grpc.CallOption) (*MsgStableSwapAdjustScalingFactorsResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgCreateStableswapPool ¶
type MsgCreateStableswapPool struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` PoolParams *PoolParams `protobuf:"bytes,2,opt,name=poolParams,proto3" json:"poolParams,omitempty" yaml:"pool_params"` InitialPoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `` /* 167-byte string literal not displayed */ FuturePoolGovernor string `` /* 145-byte string literal not displayed */ }
func NewMsgCreateStableswapPool ¶
func NewMsgCreateStableswapPool( sender sdk.AccAddress, poolParams PoolParams, initialLiquidity sdk.Coins, futurePoolGovernor string, ) MsgCreateStableswapPool
func (MsgCreateStableswapPool) CreatePool ¶
func (*MsgCreateStableswapPool) Descriptor ¶
func (*MsgCreateStableswapPool) Descriptor() ([]byte, []int)
func (*MsgCreateStableswapPool) GetFuturePoolGovernor ¶
func (m *MsgCreateStableswapPool) GetFuturePoolGovernor() string
func (*MsgCreateStableswapPool) GetInitialPoolLiquidity ¶
func (m *MsgCreateStableswapPool) GetInitialPoolLiquidity() github_com_cosmos_cosmos_sdk_types.Coins
func (*MsgCreateStableswapPool) GetPoolParams ¶
func (m *MsgCreateStableswapPool) GetPoolParams() *PoolParams
func (*MsgCreateStableswapPool) GetSender ¶
func (m *MsgCreateStableswapPool) GetSender() string
func (MsgCreateStableswapPool) GetSignBytes ¶
func (msg MsgCreateStableswapPool) GetSignBytes() []byte
func (MsgCreateStableswapPool) GetSigners ¶
func (msg MsgCreateStableswapPool) GetSigners() []sdk.AccAddress
func (MsgCreateStableswapPool) InitialLiquidity ¶
func (msg MsgCreateStableswapPool) InitialLiquidity() sdk.Coins
func (*MsgCreateStableswapPool) Marshal ¶
func (m *MsgCreateStableswapPool) Marshal() (dAtA []byte, err error)
func (*MsgCreateStableswapPool) MarshalTo ¶
func (m *MsgCreateStableswapPool) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateStableswapPool) MarshalToSizedBuffer ¶
func (m *MsgCreateStableswapPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (MsgCreateStableswapPool) PoolCreator ¶
func (msg MsgCreateStableswapPool) PoolCreator() sdk.AccAddress
func (*MsgCreateStableswapPool) ProtoMessage ¶
func (*MsgCreateStableswapPool) ProtoMessage()
func (*MsgCreateStableswapPool) Reset ¶
func (m *MsgCreateStableswapPool) Reset()
func (MsgCreateStableswapPool) Route ¶
func (msg MsgCreateStableswapPool) Route() string
func (*MsgCreateStableswapPool) Size ¶
func (m *MsgCreateStableswapPool) Size() (n int)
func (*MsgCreateStableswapPool) String ¶
func (m *MsgCreateStableswapPool) String() string
func (MsgCreateStableswapPool) Type ¶
func (msg MsgCreateStableswapPool) Type() string
func (*MsgCreateStableswapPool) Unmarshal ¶
func (m *MsgCreateStableswapPool) Unmarshal(dAtA []byte) error
func (MsgCreateStableswapPool) Validate ¶
func (msg MsgCreateStableswapPool) Validate(ctx sdk.Context) error
func (MsgCreateStableswapPool) ValidateBasic ¶
func (msg MsgCreateStableswapPool) ValidateBasic() error
func (*MsgCreateStableswapPool) XXX_DiscardUnknown ¶
func (m *MsgCreateStableswapPool) XXX_DiscardUnknown()
func (*MsgCreateStableswapPool) XXX_Marshal ¶
func (m *MsgCreateStableswapPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateStableswapPool) XXX_Merge ¶
func (m *MsgCreateStableswapPool) XXX_Merge(src proto.Message)
func (*MsgCreateStableswapPool) XXX_Size ¶
func (m *MsgCreateStableswapPool) XXX_Size() int
func (*MsgCreateStableswapPool) XXX_Unmarshal ¶
func (m *MsgCreateStableswapPool) XXX_Unmarshal(b []byte) error
type MsgCreateStableswapPoolResponse ¶
type MsgCreateStableswapPoolResponse struct {
PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
}
func (*MsgCreateStableswapPoolResponse) Descriptor ¶
func (*MsgCreateStableswapPoolResponse) Descriptor() ([]byte, []int)
func (*MsgCreateStableswapPoolResponse) GetPoolID ¶
func (m *MsgCreateStableswapPoolResponse) GetPoolID() uint64
func (*MsgCreateStableswapPoolResponse) Marshal ¶
func (m *MsgCreateStableswapPoolResponse) Marshal() (dAtA []byte, err error)
func (*MsgCreateStableswapPoolResponse) MarshalTo ¶
func (m *MsgCreateStableswapPoolResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateStableswapPoolResponse) MarshalToSizedBuffer ¶
func (m *MsgCreateStableswapPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateStableswapPoolResponse) ProtoMessage ¶
func (*MsgCreateStableswapPoolResponse) ProtoMessage()
func (*MsgCreateStableswapPoolResponse) Reset ¶
func (m *MsgCreateStableswapPoolResponse) Reset()
func (*MsgCreateStableswapPoolResponse) Size ¶
func (m *MsgCreateStableswapPoolResponse) Size() (n int)
func (*MsgCreateStableswapPoolResponse) String ¶
func (m *MsgCreateStableswapPoolResponse) String() string
func (*MsgCreateStableswapPoolResponse) Unmarshal ¶
func (m *MsgCreateStableswapPoolResponse) Unmarshal(dAtA []byte) error
func (*MsgCreateStableswapPoolResponse) XXX_DiscardUnknown ¶
func (m *MsgCreateStableswapPoolResponse) XXX_DiscardUnknown()
func (*MsgCreateStableswapPoolResponse) XXX_Marshal ¶
func (m *MsgCreateStableswapPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateStableswapPoolResponse) XXX_Merge ¶
func (m *MsgCreateStableswapPoolResponse) XXX_Merge(src proto.Message)
func (*MsgCreateStableswapPoolResponse) XXX_Size ¶
func (m *MsgCreateStableswapPoolResponse) XXX_Size() int
func (*MsgCreateStableswapPoolResponse) XXX_Unmarshal ¶
func (m *MsgCreateStableswapPoolResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { CreateStableswapPool(context.Context, *MsgCreateStableswapPool) (*MsgCreateStableswapPoolResponse, error) StableSwapAdjustScalingFactors(context.Context, *MsgStableSwapAdjustScalingFactors) (*MsgStableSwapAdjustScalingFactorsResponse, error) }
MsgServer is the server API for Msg service.
type MsgStableSwapAdjustScalingFactors ¶
type MsgStableSwapAdjustScalingFactors struct { // Sender must be the pool's scaling_factor_governor in order for the tx to // succeed Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` PoolID uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` ScalingFactors []uint64 `` /* 144-byte string literal not displayed */ }
func NewMsgStableSwapAdjustScalingFactors ¶
func NewMsgStableSwapAdjustScalingFactors( sender string, poolID uint64, ) MsgStableSwapAdjustScalingFactors
Implement sdk.Msg
func (*MsgStableSwapAdjustScalingFactors) Descriptor ¶
func (*MsgStableSwapAdjustScalingFactors) Descriptor() ([]byte, []int)
func (*MsgStableSwapAdjustScalingFactors) GetPoolID ¶
func (m *MsgStableSwapAdjustScalingFactors) GetPoolID() uint64
func (*MsgStableSwapAdjustScalingFactors) GetScalingFactors ¶
func (m *MsgStableSwapAdjustScalingFactors) GetScalingFactors() []uint64
func (*MsgStableSwapAdjustScalingFactors) GetSender ¶
func (m *MsgStableSwapAdjustScalingFactors) GetSender() string
func (MsgStableSwapAdjustScalingFactors) GetSignBytes ¶
func (msg MsgStableSwapAdjustScalingFactors) GetSignBytes() []byte
func (MsgStableSwapAdjustScalingFactors) GetSigners ¶
func (msg MsgStableSwapAdjustScalingFactors) GetSigners() []sdk.AccAddress
func (*MsgStableSwapAdjustScalingFactors) Marshal ¶
func (m *MsgStableSwapAdjustScalingFactors) Marshal() (dAtA []byte, err error)
func (*MsgStableSwapAdjustScalingFactors) MarshalTo ¶
func (m *MsgStableSwapAdjustScalingFactors) MarshalTo(dAtA []byte) (int, error)
func (*MsgStableSwapAdjustScalingFactors) MarshalToSizedBuffer ¶
func (m *MsgStableSwapAdjustScalingFactors) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgStableSwapAdjustScalingFactors) ProtoMessage ¶
func (*MsgStableSwapAdjustScalingFactors) ProtoMessage()
func (*MsgStableSwapAdjustScalingFactors) Reset ¶
func (m *MsgStableSwapAdjustScalingFactors) Reset()
func (MsgStableSwapAdjustScalingFactors) Route ¶
func (msg MsgStableSwapAdjustScalingFactors) Route() string
func (*MsgStableSwapAdjustScalingFactors) Size ¶
func (m *MsgStableSwapAdjustScalingFactors) Size() (n int)
func (*MsgStableSwapAdjustScalingFactors) String ¶
func (m *MsgStableSwapAdjustScalingFactors) String() string
func (MsgStableSwapAdjustScalingFactors) Type ¶
func (msg MsgStableSwapAdjustScalingFactors) Type() string
func (*MsgStableSwapAdjustScalingFactors) Unmarshal ¶
func (m *MsgStableSwapAdjustScalingFactors) Unmarshal(dAtA []byte) error
func (MsgStableSwapAdjustScalingFactors) ValidateBasic ¶
func (msg MsgStableSwapAdjustScalingFactors) ValidateBasic() error
func (*MsgStableSwapAdjustScalingFactors) XXX_DiscardUnknown ¶
func (m *MsgStableSwapAdjustScalingFactors) XXX_DiscardUnknown()
func (*MsgStableSwapAdjustScalingFactors) XXX_Marshal ¶
func (m *MsgStableSwapAdjustScalingFactors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgStableSwapAdjustScalingFactors) XXX_Merge ¶
func (m *MsgStableSwapAdjustScalingFactors) XXX_Merge(src proto.Message)
func (*MsgStableSwapAdjustScalingFactors) XXX_Size ¶
func (m *MsgStableSwapAdjustScalingFactors) XXX_Size() int
func (*MsgStableSwapAdjustScalingFactors) XXX_Unmarshal ¶
func (m *MsgStableSwapAdjustScalingFactors) XXX_Unmarshal(b []byte) error
type MsgStableSwapAdjustScalingFactorsResponse ¶
type MsgStableSwapAdjustScalingFactorsResponse struct { }
func (*MsgStableSwapAdjustScalingFactorsResponse) Descriptor ¶
func (*MsgStableSwapAdjustScalingFactorsResponse) Descriptor() ([]byte, []int)
func (*MsgStableSwapAdjustScalingFactorsResponse) Marshal ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) Marshal() (dAtA []byte, err error)
func (*MsgStableSwapAdjustScalingFactorsResponse) MarshalTo ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgStableSwapAdjustScalingFactorsResponse) MarshalToSizedBuffer ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgStableSwapAdjustScalingFactorsResponse) ProtoMessage ¶
func (*MsgStableSwapAdjustScalingFactorsResponse) ProtoMessage()
func (*MsgStableSwapAdjustScalingFactorsResponse) Reset ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) Reset()
func (*MsgStableSwapAdjustScalingFactorsResponse) Size ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) Size() (n int)
func (*MsgStableSwapAdjustScalingFactorsResponse) String ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) String() string
func (*MsgStableSwapAdjustScalingFactorsResponse) Unmarshal ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) Unmarshal(dAtA []byte) error
func (*MsgStableSwapAdjustScalingFactorsResponse) XXX_DiscardUnknown ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_DiscardUnknown()
func (*MsgStableSwapAdjustScalingFactorsResponse) XXX_Marshal ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgStableSwapAdjustScalingFactorsResponse) XXX_Merge ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Merge(src proto.Message)
func (*MsgStableSwapAdjustScalingFactorsResponse) XXX_Size ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Size() int
func (*MsgStableSwapAdjustScalingFactorsResponse) XXX_Unmarshal ¶
func (m *MsgStableSwapAdjustScalingFactorsResponse) XXX_Unmarshal(b []byte) error
type Pool ¶
type Pool struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` PoolParams PoolParams `protobuf:"bytes,3,opt,name=poolParams,proto3" json:"poolParams" yaml:"stableswap_pool_params"` // This string specifies who will govern the pool in the future. // Valid forms of this are: // {token name},{duration} // {duration} // where {token name} if specified is the token which determines the // governor, and if not specified is the LP token for this pool.duration is // a time specified as 0w,1w,2w, etc. which specifies how long the token // would need to be locked up to count in governance. 0w means no lockup. FuturePoolGovernor string `` /* 145-byte string literal not displayed */ TotalShares types.Coin `protobuf:"bytes,5,opt,name=totalShares,proto3" json:"totalShares" yaml:"total_shares"` // assets in the pool PoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=poolLiquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"poolLiquidity"` // for calculation amognst assets with different precisions ScalingFactor []uint64 `` /* 141-byte string literal not displayed */ // scaling_factor_governor is the address can adjust pool scaling factors ScalingFactorGovernor string `` /* 157-byte string literal not displayed */ }
Pool is the stableswap Pool struct
func NewStableswapPool ¶
func NewStableswapPool(poolId uint64, stableswapPoolParams PoolParams, initialLiquidity sdk.Coins, futureGovernor string, blockTime time.Time) (Pool, error)
NewStableswapPool returns a stableswap pool Invariants that are assumed to be satisfied and not checked: * len(initialLiquidity) = 2 * FutureGovernor is valid * poolID doesn't already exist
func (Pool) CalcExitPoolShares ¶
func (Pool) CalcInAmtGivenOut ¶
func (*Pool) CalcJoinPoolShares ¶
func (Pool) CalcOutAmtGivenIn ¶
func (pa Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, swapFee sdk.Dec) (tokenOut sdk.Coin, err error)
TODO: These should all get moved to amm.go
func (*Pool) Descriptor ¶
func (Pool) GetAddress ¶
func (pa Pool) GetAddress() sdk.AccAddress
func (Pool) GetScalingFactorByLiquidityIndex ¶
CONTRACT: scaling factors follow the same index with pool liquidity denoms
func (Pool) GetScalingFactors ¶
func (Pool) GetTotalPoolLiquidity ¶
Returns the coins in the pool owned by all LP shareholders
func (Pool) GetTotalShares ¶
func (*Pool) ProtoMessage ¶
func (*Pool) ProtoMessage()
func (*Pool) SwapInAmtGivenOut ¶
func (*Pool) SwapOutAmtGivenIn ¶
func (*Pool) XXX_DiscardUnknown ¶
func (m *Pool) XXX_DiscardUnknown()
func (*Pool) XXX_Unmarshal ¶
type PoolParams ¶
type PoolParams struct { SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swapFee" yaml:"swap_fee"` ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exitFee" yaml:"exit_fee"` }
PoolParams defined the parameters that will be managed by the pool governance in the future. This params are not managed by the chain governance. Instead they will be managed by the token holders of the pool. The pool's token holders are specified in future_pool_governor.
func (*PoolParams) Descriptor ¶
func (*PoolParams) Descriptor() ([]byte, []int)
func (*PoolParams) Marshal ¶
func (m *PoolParams) Marshal() (dAtA []byte, err error)
func (*PoolParams) MarshalToSizedBuffer ¶
func (m *PoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PoolParams) ProtoMessage ¶
func (*PoolParams) ProtoMessage()
func (*PoolParams) Reset ¶
func (m *PoolParams) Reset()
func (*PoolParams) Size ¶
func (m *PoolParams) Size() (n int)
func (*PoolParams) String ¶
func (m *PoolParams) String() string
func (*PoolParams) Unmarshal ¶
func (m *PoolParams) Unmarshal(dAtA []byte) error
func (PoolParams) Validate ¶
func (params PoolParams) Validate() error
func (*PoolParams) XXX_DiscardUnknown ¶
func (m *PoolParams) XXX_DiscardUnknown()
func (*PoolParams) XXX_Marshal ¶
func (m *PoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PoolParams) XXX_Merge ¶
func (m *PoolParams) XXX_Merge(src proto.Message)
func (*PoolParams) XXX_Size ¶
func (m *PoolParams) XXX_Size() int
func (*PoolParams) XXX_Unmarshal ¶
func (m *PoolParams) XXX_Unmarshal(b []byte) error
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) CreateStableswapPool ¶
func (*UnimplementedMsgServer) CreateStableswapPool(ctx context.Context, req *MsgCreateStableswapPool) (*MsgCreateStableswapPoolResponse, error)
func (*UnimplementedMsgServer) StableSwapAdjustScalingFactors ¶
func (*UnimplementedMsgServer) StableSwapAdjustScalingFactors(ctx context.Context, req *MsgStableSwapAdjustScalingFactors) (*MsgStableSwapAdjustScalingFactorsResponse, error)