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) (poolmanagertypes.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 (msg MsgCreateStableswapPool) GetPoolType() poolmanagertypes.PoolType
- func (m *MsgCreateStableswapPool) GetScalingFactorController() string
- func (m *MsgCreateStableswapPool) GetScalingFactors() []uint64
- 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 (p *Pool) AsSerializablePool() poolmanagertypes.PoolI
- func (p Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, exitingShares osmomath.Int, exitFee osmomath.Dec) (exitingCoins sdk.Coins, err error)
- func (p Pool) CalcInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, ...) (tokenIn sdk.Coin, err error)
- func (p Pool) CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, spreadFactor osmomath.Dec) (numShares osmomath.Int, tokensJoined sdk.Coins, err error)
- func (p *Pool) CalcJoinPoolShares(ctx sdk.Context, tokensIn sdk.Coins, spreadFactor osmomath.Dec) (numShares osmomath.Int, newLiquidity sdk.Coins, err error)
- func (p Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, ...) (tokenOut sdk.Coin, err error)
- func (p Pool) Copy() Pool
- func (*Pool) Descriptor() ([]byte, []int)
- func (p *Pool) ExitPool(ctx sdk.Context, exitingShares osmomath.Int, exitFee osmomath.Dec) (exitingCoins sdk.Coins, err error)
- func (p Pool) GetAddress() sdk.AccAddress
- func (p Pool) GetExitFee(ctx sdk.Context) osmomath.Dec
- func (p Pool) GetId() uint64
- func (p *Pool) GetPoolDenoms(ctx sdk.Context) []string
- func (p Pool) GetScalingFactorByDenom(denom string) uint64
- func (p Pool) GetScalingFactors() []uint64
- func (p Pool) GetSpreadFactor(ctx sdk.Context) osmomath.Dec
- func (p Pool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins
- func (p Pool) GetTotalShares() osmomath.Int
- func (p Pool) GetType() poolmanagertypes.PoolType
- func (p Pool) IsActive(ctx sdk.Context) bool
- func (p *Pool) JoinPool(ctx sdk.Context, tokensIn sdk.Coins, spreadFactor osmomath.Dec) (osmomath.Int, error)
- func (p *Pool) JoinPoolNoSwap(ctx sdk.Context, tokensIn sdk.Coins, spreadFactor osmomath.Dec) (osmomath.Int, 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 (p Pool) NumAssets() int
- func (*Pool) ProtoMessage()
- func (m *Pool) Reset()
- func (p *Pool) SetScalingFactors(ctx sdk.Context, scalingFactors []uint64, sender string) error
- func (m *Pool) Size() (n int)
- func (p Pool) SpotPrice(ctx sdk.Context, quoteAssetDenom string, baseAssetDenom string) (osmomath.BigDec, error)
- func (p Pool) String() string
- func (p *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, ...) (tokenIn sdk.Coin, err error)
- func (p *Pool) SwapOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, ...) (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" )
const PoolTypeName string = "Stableswap"
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=pool_params,json=poolParams,proto3" json:"pool_params,omitempty" yaml:"pool_params"` InitialPoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `` /* 167-byte string literal not displayed */ ScalingFactors []uint64 `` /* 144-byte string literal not displayed */ FuturePoolGovernor string `` /* 145-byte string literal not displayed */ ScalingFactorController string `` /* 165-byte string literal not displayed */ }
===================== MsgCreatePool
func NewMsgCreateStableswapPool ¶
func NewMsgCreateStableswapPool( sender sdk.AccAddress, poolParams PoolParams, initialLiquidity sdk.Coins, scalingFactors []uint64, futurePoolGovernor string, ) MsgCreateStableswapPool
func (MsgCreateStableswapPool) CreatePool ¶
func (msg MsgCreateStableswapPool) CreatePool(ctx sdk.Context, poolId uint64) (poolmanagertypes.PoolI, error)
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) GetPoolType ¶
func (msg MsgCreateStableswapPool) GetPoolType() poolmanagertypes.PoolType
func (*MsgCreateStableswapPool) GetScalingFactorController ¶
func (m *MsgCreateStableswapPool) GetScalingFactorController() string
func (*MsgCreateStableswapPool) GetScalingFactors ¶
func (m *MsgCreateStableswapPool) GetScalingFactors() []uint64
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"`
}
Returns a poolID with custom poolName.
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 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 */ }
Sender must be the pool's scaling_factor_governor in order for the tx to succeed. Adjusts stableswap scaling factors.
func NewMsgStableSwapAdjustScalingFactors ¶
func NewMsgStableSwapAdjustScalingFactors( sender string, poolID uint64, scalingFactors []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=pool_params,json=poolParams,proto3" json:"pool_params" 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=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` // assets in the pool PoolLiquidity github_com_cosmos_cosmos_sdk_types.Coins `` /* 144-byte string literal not displayed */ // for calculation amognst assets with different precisions ScalingFactors []uint64 `` /* 145-byte string literal not displayed */ // scaling_factor_controller is the address can adjust pool scaling factors ScalingFactorController string `` /* 165-byte string literal not displayed */ }
Pool is the stableswap Pool struct
func NewStableswapPool ¶
func NewStableswapPool(poolId uint64, stableswapPoolParams PoolParams, initialLiquidity sdk.Coins, scalingFactors []uint64, scalingFactorController string, futureGovernor string, ) (Pool, error)
NewStableswapPool returns a stableswap pool Invariants that are assumed to be satisfied and not checked: * poolID doesn't already exist
func (*Pool) AsSerializablePool ¶
func (p *Pool) AsSerializablePool() poolmanagertypes.PoolI
func (Pool) CalcExitPoolCoinsFromShares ¶
func (Pool) CalcInAmtGivenOut ¶
func (p Pool) CalcInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, spreadFactor osmomath.Dec) (tokenIn sdk.Coin, err error)
CalcInAmtGivenOut calculates input amount needed to receive given output
func (Pool) CalcJoinPoolNoSwapShares ¶
func (p Pool) CalcJoinPoolNoSwapShares(ctx sdk.Context, tokensIn sdk.Coins, spreadFactor osmomath.Dec) (numShares osmomath.Int, tokensJoined sdk.Coins, err error)
CalcJoinPoolNoSwapShares calculates the number of shares created to execute an all-asset pool join with the provided amount of `tokensIn`. The input tokens must contain the same tokens as in the pool.
Returns the number of shares created, the amount of coins actually joined into the pool as not all may tokens may be joinable. If an all-asset join is not possible, returns an error.
func (*Pool) CalcJoinPoolShares ¶
func (Pool) CalcOutAmtGivenIn ¶
func (p Pool) CalcOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, spreadFactor osmomath.Dec) (tokenOut sdk.Coin, err error)
TODO: These should all get moved to amm.go CalcOutAmtGivenIn calculates expected output amount given input token
func (*Pool) Descriptor ¶
func (Pool) GetAddress ¶
func (p Pool) GetAddress() sdk.AccAddress
func (*Pool) GetPoolDenoms ¶ added in v20.4.0
GetPoolDenoms implements types.CFMMPoolI.
func (Pool) GetScalingFactorByDenom ¶
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) GetType ¶
func (p Pool) GetType() poolmanagertypes.PoolType
func (*Pool) JoinPoolNoSwap ¶
func (*Pool) ProtoMessage ¶
func (*Pool) ProtoMessage()
func (*Pool) SetScalingFactors ¶
SetScalingFactors sets scaling factors for pool to the given amount It should only be able to be successfully called by the pool's ScalingFactorGovernor TODO: move commented test for this function from x/gamm/keeper/pool_service_test.go once a pool_test.go file has been created for stableswap
func (Pool) SpotPrice ¶
func (p Pool) SpotPrice(ctx sdk.Context, quoteAssetDenom string, baseAssetDenom string) (osmomath.BigDec, error)
SpotPrice calculates the approximate amount of `baseDenom` one would receive for an input dx of `quoteDenom` (to simplify calculations, we approximate dx = 1)
func (*Pool) SwapInAmtGivenOut ¶
func (p *Pool) SwapInAmtGivenOut(ctx sdk.Context, tokenOut sdk.Coins, tokenInDenom string, spreadFactor osmomath.Dec) (tokenIn sdk.Coin, err error)
SwapInAmtGivenOut executes a swap given a desired output amount
func (*Pool) SwapOutAmtGivenIn ¶
func (p *Pool) SwapOutAmtGivenIn(ctx sdk.Context, tokenIn sdk.Coins, tokenOutDenom string, spreadFactor osmomath.Dec) (tokenOut sdk.Coin, err error)
SwapOutAmtGivenIn executes a swap given a desired input amount
func (*Pool) XXX_DiscardUnknown ¶
func (m *Pool) XXX_DiscardUnknown()
func (*Pool) XXX_Unmarshal ¶
type PoolParams ¶
type PoolParams struct { SwapFee cosmossdk_io_math.LegacyDec `` /* 127-byte string literal not displayed */ // N.B.: exit fee is disabled during pool creation in x/poolmanager. While old // pools can maintain a non-zero fee. No new pool can be created with non-zero // fee anymore ExitFee cosmossdk_io_math.LegacyDec `` /* 127-byte string literal not displayed */ }
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)