types

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 40 Imported by: 1

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	OneShareExponent = 18

	BalancerGasFeeForSwap = 10_000
)
View Source
const (
	InvalidInputDenomsErrFormat                  = "input denoms must already exist in the pool (%s)"
	FormatRepeatingPoolAssetsNotAllowedErrFormat = "repeating pool assets not allowed, found %s"
	FormatNoPoolAssetFoundErrFormat              = "can't find the PoolAsset (%s)"
	ErrMsgFormatSharesLargerThanMax              = "%s resulted shares is larger than the max amount of %s"
)
View Source
const (
	TypeEvtPoolJoined   = "pool_joined"
	TypeEvtPoolExited   = "pool_exited"
	TypeEvtPoolCreated  = "pool_created"
	TypeEvtTokenSwapped = "token_swapped"

	AttributeValueCategory = ModuleName
	AttributeKeyPoolId     = "pool_id"
	AttributeKeyTokensIn   = "tokens_in"
	AttributeKeyTokensOut  = "tokens_out"
)
View Source
const (
	TLastSwapRequestIndex  = "last-swap-request-index"
	TSwapExactAmountInKey  = "batch/swap-exact-amount-in"
	TSwapExactAmountOutKey = "batch/swap-exact-amount-out"
)
View Source
const (
	// ModuleName defines the module name
	ModuleName = "amm"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey defines the module's message routing key
	RouterKey = ModuleName

	// TStoreKey defines the transient store key
	TStoreKey = "transient_amm"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default global index

View Source
const (
	// DenomLiquidityKeyPrefix is the prefix to retrieve all DenomLiquidity
	DenomLiquidityKeyPrefix = "DenomLiquidity/value/"
)
View Source
const (
	// PoolKeyPrefix is the prefix to retrieve all Pool
	PoolKeyPrefix = "Pool/value/"
)
View Source
const TypeMsgCreatePool = "create_pool"
View Source
const TypeMsgExitPool = "exit_pool"
View Source
const TypeMsgFeedMultipleExternalLiquidity = "feed_multiple_external_liquidity"
View Source
const TypeMsgJoinPool = "join_pool"
View Source
const TypeMsgSwapExactAmountIn = "swap_exact_amount_in"
View Source
const TypeMsgSwapExactAmountOut = "swap_exact_amount_out"

Variables

View Source
var (
	// OneShare represents the amount of subshares in a single pool share.
	OneShare = math.NewIntWithDecimal(1, OneShareExponent)

	// InitPoolSharesSupply is the amount of new shares to initialize a pool with.
	InitPoolSharesSupply = OneShare.MulRaw(100)

	// Scaling factor for every weight. The pool weight is:
	// weight_in_MsgCreateBalancerPool * GuaranteedWeightPrecision
	//
	// This is done so that smooth weight changes have enough precision to actually be smooth.
	GuaranteedWeightPrecision int64 = 1 << 30
)
View Source
var (
	ErrInvalidLengthDenomLiquidity        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDenomLiquidity          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDenomLiquidity = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrLimitMaxAmount      = sdkerrors.Register(ModuleName, 6, "calculated amount is larger than max amount")
	ErrLimitMinAmount      = sdkerrors.Register(ModuleName, 7, "calculated amount is lesser than min amount")
	ErrInvalidMathApprox   = sdkerrors.Register(ModuleName, 8, "invalid calculated result")
	ErrInvalidPool         = sdkerrors.Register(ModuleName, 10, "attempting to create an invalid pool")
	ErrDenomNotFoundInPool = sdkerrors.Register(ModuleName, 11, "denom does not exist in pool")

	ErrEmptyRoutes     = sdkerrors.Register(ModuleName, 21, "routes not defined")
	ErrNegativeSwapFee = sdkerrors.Register(ModuleName, 23, "swap fee is negative")
	ErrNegativeExitFee = sdkerrors.Register(ModuleName, 24, "exit fee is negative")
	ErrTooMuchSwapFee  = sdkerrors.Register(ModuleName, 25, "swap fee should be lesser than 1 (100%)")
	ErrTooMuchExitFee  = sdkerrors.Register(ModuleName, 26, "exit fee should be lesser than 1 (100%)")

	ErrTooManyTokensOut = sdkerrors.Register(ModuleName, 31, "tx is trying to get more tokens out of the pool than exist")

	ErrInvalidPoolId      = sdkerrors.Register(ModuleName, 91, "invalid pool id")
	ErrInvalidSwapMsgType = sdkerrors.Register(ModuleName, 92, "unexpected swap message type")
)

x/amm module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeyPoolCreationFee = []byte("PoolCreationFee")
	// TODO: Determine the default value
	DefaultPoolCreationFee uint64 = 0
)
View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPool        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPool          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPool = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPoolAsset        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPoolAsset          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPoolAsset = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPoolParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPoolParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPoolParams = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthProposal        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProposal          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSwapRoute        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSwapRoute          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSwapRoute = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func AbsDifferenceWithSign

func AbsDifferenceWithSign(a, b sdk.Dec) (sdk.Dec, bool)

AbsDifferenceWithSign returns | a - b |, (a - b).sign() a is mutated and returned.

func CalcExitPool

func CalcExitPool(ctx sdk.Context, oracleKeeper OracleKeeper, pool Pool, accountedPoolKeeper AccountedPoolKeeper, exitingShares sdk.Int, tokenOutDenom string) (sdk.Coins, error)

CalcExitPool returns how many tokens should come out, when exiting k LP shares against a "standard" CFMM

func CalcExitValueWithoutSlippage added in v0.11.0

func CalcExitValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accPoolKeeper AccountedPoolKeeper, pool Pool, exitingShares sdk.Int, tokenOutDenom string) (sdk.Dec, error)

func DenomLiquidityKey

func DenomLiquidityKey(denom string) []byte

DenomLiquidityKey returns the store key to retrieve a DenomLiquidity from the index fields

func EmitAddLiquidityEvent

func EmitAddLiquidityEvent(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, liquidity sdk.Coins)

func EmitRemoveLiquidityEvent

func EmitRemoveLiquidityEvent(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, liquidity sdk.Coins)

func EmitSwapEvent

func EmitSwapEvent(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins)

func EnsureDenomInPool

func EnsureDenomInPool(poolAssetsByDenom map[string]PoolAsset, tokensIn sdk.Coins) error

ensureDenomInPool check to make sure the input denoms exist in the provided pool asset map

func FirstPoolIdFromSwapExactAmountIn added in v0.11.0

func FirstPoolIdFromSwapExactAmountIn(m *MsgSwapExactAmountIn) uint64

func FirstPoolIdFromSwapExactAmountOut added in v0.11.0

func FirstPoolIdFromSwapExactAmountOut(m *MsgSwapExactAmountOut) uint64

func GetMaximalNoSwapLPAmount

func GetMaximalNoSwapLPAmount(pool Pool, shareOutAmount sdk.Int) (neededLpLiquidity sdk.Coins, err error)

getMaximalNoSwapLPAmount returns the coins(lp liquidity) needed to get the specified amount of shares in the pool. Steps to getting the needed lp liquidity coins needed for the share of the pools are 1. calculate how much percent of the pool does given share account for(# of input shares / # of current total shares) 2. since we know how much % of the pool we want, iterate through all pool liquidity to calculate how much coins we need for each pool asset.

func GetPoolAssetsByDenom

func GetPoolAssetsByDenom(poolAssets []PoolAsset) (map[string]PoolAsset, error)

GetPoolAssetsByDenom return a mapping from pool asset denom to the pool asset itself. There must be no duplicates. Returns error, if any found.

func GetPoolShareDenom

func GetPoolShareDenom(poolId uint64) string

func KeyPrefix

func KeyPrefix(p string) []byte

func MaximalExactRatioJoin

func MaximalExactRatioJoin(p *Pool, tokensIn sdk.Coins) (numShares sdk.Int, remCoins sdk.Coins, err error)

MaximalExactRatioJoin calculates the maximal amount of tokens that can be joined whilst maintaining pool asset's ratio returning the number of shares that'd be and how many coins would be left over.

e.g) suppose we have a pool of 10 foo tokens and 10 bar tokens, with the total amount of 100 shares.
	 if `tokensIn` provided is 1 foo token and 2 bar tokens, `MaximalExactRatioJoin`
	 would be returning (10 shares, 1 bar token, nil)

This can be used when `tokensIn` are not guaranteed the same ratio as assets in the pool. Calculation for this is done in the following steps.

  1. iterate through all the tokens provided as an argument, calculate how much ratio it accounts for the asset in the pool
  2. get the minimal share ratio that would work as the benchmark for all tokens.
  3. calculate the number of shares that could be joined (total share * min share ratio), return the remaining coins

func NewAddLiquidityEvent

func NewAddLiquidityEvent(sender sdk.AccAddress, poolId uint64, liquidity sdk.Coins) sdk.Event

func NewPoolAddress

func NewPoolAddress(poolId uint64) sdk.AccAddress

func NewPoolRebalanceTreasury

func NewPoolRebalanceTreasury(poolId uint64) sdk.AccAddress

func NewPoolRevenueAddress

func NewPoolRevenueAddress(poolId uint64) sdk.AccAddress

func NewRemoveLiquidityEvent

func NewRemoveLiquidityEvent(sender sdk.AccAddress, poolId uint64, liquidity sdk.Coins) sdk.Event

func NewSwapEvent

func NewSwapEvent(sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins) sdk.Event

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func PoolKey

func PoolKey(poolId uint64) []byte

PoolKey returns the store key to retrieve a Pool from the index fields

func Pow

func Pow(base sdk.Dec, exp sdk.Dec) sdk.Dec

Pow computes base^(exp) However since the exponent is not an integer, we must do an approximation algorithm. TODO: In the future, lets add some optimized routines for common exponents, e.g. for common wIn / wOut ratios Many simple exponents like 2:1 pools.

func PowApprox

func PowApprox(base sdk.Dec, exp sdk.Dec, precision sdk.Dec) sdk.Dec

Contract: 0 < base <= 2 0 <= exp < 1.

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func TKeyPrefixSwapExactAmountIn added in v0.11.0

func TKeyPrefixSwapExactAmountIn(m *MsgSwapExactAmountIn, index uint64) []byte

func TKeyPrefixSwapExactAmountInPrefix added in v0.11.0

func TKeyPrefixSwapExactAmountInPrefix(m *MsgSwapExactAmountIn) []byte

func TKeyPrefixSwapExactAmountOut added in v0.11.0

func TKeyPrefixSwapExactAmountOut(m *MsgSwapExactAmountOut, index uint64) []byte

func TKeyPrefixSwapExactAmountOutPrefix added in v0.11.0

func TKeyPrefixSwapExactAmountOutPrefix(m *MsgSwapExactAmountOut) []byte

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
	SetAccount(ctx sdk.Context, acc authtypes.AccountI)
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type AccountedPoolKeeper added in v0.11.0

type AccountedPoolKeeper interface {
	GetAccountedBalance(sdk.Context, uint64, string) sdk.Int
}

AccountedPoolKeeper defines the expected interfaces

type AmmHooks

type AmmHooks interface {
	// AfterPoolCreated is called after CreatePool
	AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, pool Pool)

	// AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
	AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool Pool, enterCoins sdk.Coins, shareOutAmount sdk.Int)

	// AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut
	AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool Pool, shareInAmount sdk.Int, exitCoins sdk.Coins)

	// AfterSwap is called after SwapExactAmountIn and SwapExactAmountOut
	AfterSwap(ctx sdk.Context, sender sdk.AccAddress, pool Pool, input sdk.Coins, output sdk.Coins)
}

type AssetAmountDepth added in v0.12.0

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 (*AssetAmountDepth) Descriptor added in v0.12.0

func (*AssetAmountDepth) Descriptor() ([]byte, []int)

func (*AssetAmountDepth) GetAsset added in v0.12.0

func (m *AssetAmountDepth) GetAsset() string

func (*AssetAmountDepth) Marshal added in v0.12.0

func (m *AssetAmountDepth) Marshal() (dAtA []byte, err error)

func (*AssetAmountDepth) MarshalTo added in v0.12.0

func (m *AssetAmountDepth) MarshalTo(dAtA []byte) (int, error)

func (*AssetAmountDepth) MarshalToSizedBuffer added in v0.12.0

func (m *AssetAmountDepth) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AssetAmountDepth) ProtoMessage added in v0.12.0

func (*AssetAmountDepth) ProtoMessage()

func (*AssetAmountDepth) Reset added in v0.12.0

func (m *AssetAmountDepth) Reset()

func (*AssetAmountDepth) Size added in v0.12.0

func (m *AssetAmountDepth) Size() (n int)

func (*AssetAmountDepth) String added in v0.12.0

func (m *AssetAmountDepth) String() string

func (*AssetAmountDepth) Unmarshal added in v0.12.0

func (m *AssetAmountDepth) Unmarshal(dAtA []byte) error

func (*AssetAmountDepth) XXX_DiscardUnknown added in v0.12.0

func (m *AssetAmountDepth) XXX_DiscardUnknown()

func (*AssetAmountDepth) XXX_Marshal added in v0.12.0

func (m *AssetAmountDepth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AssetAmountDepth) XXX_Merge added in v0.12.0

func (m *AssetAmountDepth) XXX_Merge(src proto.Message)

func (*AssetAmountDepth) XXX_Size added in v0.12.0

func (m *AssetAmountDepth) XXX_Size() int

func (*AssetAmountDepth) XXX_Unmarshal added in v0.12.0

func (m *AssetAmountDepth) XXX_Unmarshal(b []byte) error

type AssetProfileKeeper

type AssetProfileKeeper interface {
	// SetEntry set a specific entry in the store from its index
	SetEntry(ctx sdk.Context, entry atypes.Entry)
	// GetEntry returns a entry from its index
	GetEntry(ctx sdk.Context, baseDenom string) (val atypes.Entry, found bool)
}

AssetProfileKeeper defines the expected interfaces

type AssetWeight

type AssetWeight struct {
	Asset  string
	Weight sdk.Dec
}

func NormalizedWeights

func NormalizedWeights(poolAssets []PoolAsset) (poolWeights []AssetWeight)

func OraclePoolNormalizedWeights

func OraclePoolNormalizedWeights(ctx sdk.Context, oracleKeeper OracleKeeper, poolAssets []PoolAsset) ([]AssetWeight, error)

type BankKeeper

type BankKeeper interface {
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type DenomLiquidity

type DenomLiquidity struct {
	Denom     string                                 `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	Liquidity github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=liquidity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"liquidity"`
}

func (*DenomLiquidity) Descriptor

func (*DenomLiquidity) Descriptor() ([]byte, []int)

func (*DenomLiquidity) GetDenom

func (m *DenomLiquidity) GetDenom() string

func (*DenomLiquidity) Marshal

func (m *DenomLiquidity) Marshal() (dAtA []byte, err error)

func (*DenomLiquidity) MarshalTo

func (m *DenomLiquidity) MarshalTo(dAtA []byte) (int, error)

func (*DenomLiquidity) MarshalToSizedBuffer

func (m *DenomLiquidity) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DenomLiquidity) ProtoMessage

func (*DenomLiquidity) ProtoMessage()

func (*DenomLiquidity) Reset

func (m *DenomLiquidity) Reset()

func (*DenomLiquidity) Size

func (m *DenomLiquidity) Size() (n int)

func (*DenomLiquidity) String

func (m *DenomLiquidity) String() string

func (*DenomLiquidity) Unmarshal

func (m *DenomLiquidity) Unmarshal(dAtA []byte) error

func (*DenomLiquidity) XXX_DiscardUnknown

func (m *DenomLiquidity) XXX_DiscardUnknown()

func (*DenomLiquidity) XXX_Marshal

func (m *DenomLiquidity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DenomLiquidity) XXX_Merge

func (m *DenomLiquidity) XXX_Merge(src proto.Message)

func (*DenomLiquidity) XXX_Size

func (m *DenomLiquidity) XXX_Size() int

func (*DenomLiquidity) XXX_Unmarshal

func (m *DenomLiquidity) XXX_Unmarshal(b []byte) error

type ExternalLiquidity added in v0.12.0

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"`
}

ExternalLiquidity defines price, volume, and time information for an exchange rate.

func (*ExternalLiquidity) Descriptor added in v0.12.0

func (*ExternalLiquidity) Descriptor() ([]byte, []int)

func (*ExternalLiquidity) GetAmountDepthInfo added in v0.12.0

func (m *ExternalLiquidity) GetAmountDepthInfo() []AssetAmountDepth

func (*ExternalLiquidity) GetPoolId added in v0.12.0

func (m *ExternalLiquidity) GetPoolId() uint64

func (*ExternalLiquidity) Marshal added in v0.12.0

func (m *ExternalLiquidity) Marshal() (dAtA []byte, err error)

func (*ExternalLiquidity) MarshalTo added in v0.12.0

func (m *ExternalLiquidity) MarshalTo(dAtA []byte) (int, error)

func (*ExternalLiquidity) MarshalToSizedBuffer added in v0.12.0

func (m *ExternalLiquidity) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ExternalLiquidity) ProtoMessage added in v0.12.0

func (*ExternalLiquidity) ProtoMessage()

func (*ExternalLiquidity) Reset added in v0.12.0

func (m *ExternalLiquidity) Reset()

func (*ExternalLiquidity) Size added in v0.12.0

func (m *ExternalLiquidity) Size() (n int)

func (*ExternalLiquidity) String added in v0.12.0

func (m *ExternalLiquidity) String() string

func (*ExternalLiquidity) Unmarshal added in v0.12.0

func (m *ExternalLiquidity) Unmarshal(dAtA []byte) error

func (*ExternalLiquidity) XXX_DiscardUnknown added in v0.12.0

func (m *ExternalLiquidity) XXX_DiscardUnknown()

func (*ExternalLiquidity) XXX_Marshal added in v0.12.0

func (m *ExternalLiquidity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExternalLiquidity) XXX_Merge added in v0.12.0

func (m *ExternalLiquidity) XXX_Merge(src proto.Message)

func (*ExternalLiquidity) XXX_Size added in v0.12.0

func (m *ExternalLiquidity) XXX_Size() int

func (*ExternalLiquidity) XXX_Unmarshal added in v0.12.0

func (m *ExternalLiquidity) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	Params             Params           `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	PoolList           []Pool           `protobuf:"bytes,2,rep,name=poolList,proto3" json:"poolList"`
	DenomLiquidityList []DenomLiquidity `protobuf:"bytes,3,rep,name=denomLiquidityList,proto3" json:"denomLiquidityList"`
}

GenesisState defines the amm module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default genesis state

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetDenomLiquidityList

func (m *GenesisState) GetDenomLiquidityList() []DenomLiquidity

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPoolList

func (m *GenesisState) GetPoolList() []Pool

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type InternalSwapRequest added in v0.11.0

type InternalSwapRequest struct {
	InAmount sdk.Coin
	OutToken string
}

type MsgClient

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 MsgCreatePool

type MsgCreatePool struct {
	Sender     string      `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	PoolParams *PoolParams `protobuf:"bytes,2,opt,name=poolParams,proto3" json:"poolParams,omitempty"`
	PoolAssets []PoolAsset `protobuf:"bytes,3,rep,name=poolAssets,proto3" json:"poolAssets"`
}

func NewMsgCreatePool

func NewMsgCreatePool(sender string, poolParams *PoolParams, poolAssets []PoolAsset) *MsgCreatePool

func (*MsgCreatePool) CreatePool

func (msg *MsgCreatePool) CreatePool(ctx sdk.Context, poolID uint64) (*Pool, error)

func (*MsgCreatePool) Descriptor

func (*MsgCreatePool) Descriptor() ([]byte, []int)

func (*MsgCreatePool) GetPoolAssets

func (m *MsgCreatePool) GetPoolAssets() []PoolAsset

func (*MsgCreatePool) GetPoolParams

func (m *MsgCreatePool) GetPoolParams() *PoolParams

func (*MsgCreatePool) GetSender

func (m *MsgCreatePool) GetSender() string

func (*MsgCreatePool) GetSignBytes

func (msg *MsgCreatePool) GetSignBytes() []byte

func (*MsgCreatePool) GetSigners

func (msg *MsgCreatePool) GetSigners() []sdk.AccAddress

func (*MsgCreatePool) InitialLiquidity

func (msg *MsgCreatePool) InitialLiquidity() sdk.Coins

func (*MsgCreatePool) Marshal

func (m *MsgCreatePool) Marshal() (dAtA []byte, err error)

func (*MsgCreatePool) MarshalTo

func (m *MsgCreatePool) MarshalTo(dAtA []byte) (int, error)

func (*MsgCreatePool) MarshalToSizedBuffer

func (m *MsgCreatePool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCreatePool) ProtoMessage

func (*MsgCreatePool) ProtoMessage()

func (*MsgCreatePool) Reset

func (m *MsgCreatePool) Reset()

func (*MsgCreatePool) Route

func (msg *MsgCreatePool) Route() string

func (*MsgCreatePool) Size

func (m *MsgCreatePool) Size() (n int)

func (*MsgCreatePool) String

func (m *MsgCreatePool) String() string

func (*MsgCreatePool) Type

func (msg *MsgCreatePool) Type() string

func (*MsgCreatePool) Unmarshal

func (m *MsgCreatePool) Unmarshal(dAtA []byte) error

func (*MsgCreatePool) ValidateBasic

func (msg *MsgCreatePool) ValidateBasic() error

func (*MsgCreatePool) XXX_DiscardUnknown

func (m *MsgCreatePool) XXX_DiscardUnknown()

func (*MsgCreatePool) XXX_Marshal

func (m *MsgCreatePool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCreatePool) XXX_Merge

func (m *MsgCreatePool) XXX_Merge(src proto.Message)

func (*MsgCreatePool) XXX_Size

func (m *MsgCreatePool) XXX_Size() int

func (*MsgCreatePool) XXX_Unmarshal

func (m *MsgCreatePool) XXX_Unmarshal(b []byte) error

type MsgCreatePoolResponse

type MsgCreatePoolResponse struct {
	PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
}

func (*MsgCreatePoolResponse) Descriptor

func (*MsgCreatePoolResponse) Descriptor() ([]byte, []int)

func (*MsgCreatePoolResponse) GetPoolID

func (m *MsgCreatePoolResponse) GetPoolID() uint64

func (*MsgCreatePoolResponse) Marshal

func (m *MsgCreatePoolResponse) Marshal() (dAtA []byte, err error)

func (*MsgCreatePoolResponse) MarshalTo

func (m *MsgCreatePoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgCreatePoolResponse) MarshalToSizedBuffer

func (m *MsgCreatePoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgCreatePoolResponse) ProtoMessage

func (*MsgCreatePoolResponse) ProtoMessage()

func (*MsgCreatePoolResponse) Reset

func (m *MsgCreatePoolResponse) Reset()

func (*MsgCreatePoolResponse) Size

func (m *MsgCreatePoolResponse) Size() (n int)

func (*MsgCreatePoolResponse) String

func (m *MsgCreatePoolResponse) String() string

func (*MsgCreatePoolResponse) Unmarshal

func (m *MsgCreatePoolResponse) Unmarshal(dAtA []byte) error

func (*MsgCreatePoolResponse) XXX_DiscardUnknown

func (m *MsgCreatePoolResponse) XXX_DiscardUnknown()

func (*MsgCreatePoolResponse) XXX_Marshal

func (m *MsgCreatePoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgCreatePoolResponse) XXX_Merge

func (m *MsgCreatePoolResponse) XXX_Merge(src proto.Message)

func (*MsgCreatePoolResponse) XXX_Size

func (m *MsgCreatePoolResponse) XXX_Size() int

func (*MsgCreatePoolResponse) XXX_Unmarshal

func (m *MsgCreatePoolResponse) XXX_Unmarshal(b []byte) error

type MsgExitPool

type MsgExitPool struct {
	Sender        string                                 `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	PoolId        uint64                                 `protobuf:"varint,2,opt,name=poolId,proto3" json:"poolId,omitempty"`
	MinAmountsOut []types.Coin                           `protobuf:"bytes,3,rep,name=minAmountsOut,proto3" json:"minAmountsOut"`
	ShareAmountIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=shareAmountIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shareAmountIn"`
	TokenOutDenom string                                 `protobuf:"bytes,5,opt,name=tokenOutDenom,proto3" json:"tokenOutDenom,omitempty"`
}

func NewMsgExitPool

func NewMsgExitPool(sender string, poolId uint64, minAmountsOut sdk.Coins, shareAmountIn sdk.Int) *MsgExitPool

func (*MsgExitPool) Descriptor

func (*MsgExitPool) Descriptor() ([]byte, []int)

func (*MsgExitPool) GetMinAmountsOut

func (m *MsgExitPool) GetMinAmountsOut() []types.Coin

func (*MsgExitPool) GetPoolId

func (m *MsgExitPool) GetPoolId() uint64

func (*MsgExitPool) GetSender

func (m *MsgExitPool) GetSender() string

func (*MsgExitPool) GetSignBytes

func (msg *MsgExitPool) GetSignBytes() []byte

func (*MsgExitPool) GetSigners

func (msg *MsgExitPool) GetSigners() []sdk.AccAddress

func (*MsgExitPool) GetTokenOutDenom

func (m *MsgExitPool) GetTokenOutDenom() string

func (*MsgExitPool) Marshal

func (m *MsgExitPool) Marshal() (dAtA []byte, err error)

func (*MsgExitPool) MarshalTo

func (m *MsgExitPool) MarshalTo(dAtA []byte) (int, error)

func (*MsgExitPool) MarshalToSizedBuffer

func (m *MsgExitPool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExitPool) ProtoMessage

func (*MsgExitPool) ProtoMessage()

func (*MsgExitPool) Reset

func (m *MsgExitPool) Reset()

func (*MsgExitPool) Route

func (msg *MsgExitPool) Route() string

func (*MsgExitPool) Size

func (m *MsgExitPool) Size() (n int)

func (*MsgExitPool) String

func (m *MsgExitPool) String() string

func (*MsgExitPool) Type

func (msg *MsgExitPool) Type() string

func (*MsgExitPool) Unmarshal

func (m *MsgExitPool) Unmarshal(dAtA []byte) error

func (*MsgExitPool) ValidateBasic

func (msg *MsgExitPool) ValidateBasic() error

func (*MsgExitPool) XXX_DiscardUnknown

func (m *MsgExitPool) XXX_DiscardUnknown()

func (*MsgExitPool) XXX_Marshal

func (m *MsgExitPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExitPool) XXX_Merge

func (m *MsgExitPool) XXX_Merge(src proto.Message)

func (*MsgExitPool) XXX_Size

func (m *MsgExitPool) XXX_Size() int

func (*MsgExitPool) XXX_Unmarshal

func (m *MsgExitPool) XXX_Unmarshal(b []byte) error

type MsgExitPoolResponse

type MsgExitPoolResponse struct {
	TokenOut []types.Coin `protobuf:"bytes,2,rep,name=tokenOut,proto3" json:"tokenOut"`
}

func (*MsgExitPoolResponse) Descriptor

func (*MsgExitPoolResponse) Descriptor() ([]byte, []int)

func (*MsgExitPoolResponse) GetTokenOut

func (m *MsgExitPoolResponse) GetTokenOut() []types.Coin

func (*MsgExitPoolResponse) Marshal

func (m *MsgExitPoolResponse) Marshal() (dAtA []byte, err error)

func (*MsgExitPoolResponse) MarshalTo

func (m *MsgExitPoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgExitPoolResponse) MarshalToSizedBuffer

func (m *MsgExitPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExitPoolResponse) ProtoMessage

func (*MsgExitPoolResponse) ProtoMessage()

func (*MsgExitPoolResponse) Reset

func (m *MsgExitPoolResponse) Reset()

func (*MsgExitPoolResponse) Size

func (m *MsgExitPoolResponse) Size() (n int)

func (*MsgExitPoolResponse) String

func (m *MsgExitPoolResponse) String() string

func (*MsgExitPoolResponse) Unmarshal

func (m *MsgExitPoolResponse) Unmarshal(dAtA []byte) error

func (*MsgExitPoolResponse) XXX_DiscardUnknown

func (m *MsgExitPoolResponse) XXX_DiscardUnknown()

func (*MsgExitPoolResponse) XXX_Marshal

func (m *MsgExitPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExitPoolResponse) XXX_Merge

func (m *MsgExitPoolResponse) XXX_Merge(src proto.Message)

func (*MsgExitPoolResponse) XXX_Size

func (m *MsgExitPoolResponse) XXX_Size() int

func (*MsgExitPoolResponse) XXX_Unmarshal

func (m *MsgExitPoolResponse) XXX_Unmarshal(b []byte) error

type MsgFeedMultipleExternalLiquidity added in v0.12.0

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 NewMsgFeedMultipleExternalLiquidity added in v0.12.0

func NewMsgFeedMultipleExternalLiquidity(sender string) *MsgFeedMultipleExternalLiquidity

func (*MsgFeedMultipleExternalLiquidity) Descriptor added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) Descriptor() ([]byte, []int)

func (*MsgFeedMultipleExternalLiquidity) GetLiquidity added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) GetSender added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) GetSignBytes added in v0.12.0

func (msg *MsgFeedMultipleExternalLiquidity) GetSignBytes() []byte

func (*MsgFeedMultipleExternalLiquidity) GetSigners added in v0.12.0

func (msg *MsgFeedMultipleExternalLiquidity) GetSigners() []sdk.AccAddress

func (*MsgFeedMultipleExternalLiquidity) Marshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) Marshal() (dAtA []byte, err error)

func (*MsgFeedMultipleExternalLiquidity) MarshalTo added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) MarshalTo(dAtA []byte) (int, error)

func (*MsgFeedMultipleExternalLiquidity) MarshalToSizedBuffer added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgFeedMultipleExternalLiquidity) ProtoMessage added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) ProtoMessage()

func (*MsgFeedMultipleExternalLiquidity) Reset added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) Route added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) Size added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) Size() (n int)

func (*MsgFeedMultipleExternalLiquidity) String added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) Type added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) Unmarshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) Unmarshal(dAtA []byte) error

func (*MsgFeedMultipleExternalLiquidity) ValidateBasic added in v0.12.0

func (msg *MsgFeedMultipleExternalLiquidity) ValidateBasic() error

func (*MsgFeedMultipleExternalLiquidity) XXX_DiscardUnknown added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) XXX_DiscardUnknown()

func (*MsgFeedMultipleExternalLiquidity) XXX_Marshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgFeedMultipleExternalLiquidity) XXX_Merge added in v0.12.0

func (*MsgFeedMultipleExternalLiquidity) XXX_Size added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) XXX_Size() int

func (*MsgFeedMultipleExternalLiquidity) XXX_Unmarshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidity) XXX_Unmarshal(b []byte) error

type MsgFeedMultipleExternalLiquidityResponse added in v0.12.0

type MsgFeedMultipleExternalLiquidityResponse struct {
}

func (*MsgFeedMultipleExternalLiquidityResponse) Descriptor added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) Descriptor() ([]byte, []int)

func (*MsgFeedMultipleExternalLiquidityResponse) Marshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidityResponse) Marshal() (dAtA []byte, err error)

func (*MsgFeedMultipleExternalLiquidityResponse) MarshalTo added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidityResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgFeedMultipleExternalLiquidityResponse) MarshalToSizedBuffer added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgFeedMultipleExternalLiquidityResponse) ProtoMessage added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) Reset added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) Size added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) String added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) Unmarshal added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) XXX_DiscardUnknown added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_DiscardUnknown()

func (*MsgFeedMultipleExternalLiquidityResponse) XXX_Marshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgFeedMultipleExternalLiquidityResponse) XXX_Merge added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) XXX_Size added in v0.12.0

func (*MsgFeedMultipleExternalLiquidityResponse) XXX_Unmarshal added in v0.12.0

func (m *MsgFeedMultipleExternalLiquidityResponse) XXX_Unmarshal(b []byte) error

type MsgJoinPool

type MsgJoinPool struct {
	Sender         string                                 `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	PoolId         uint64                                 `protobuf:"varint,2,opt,name=poolId,proto3" json:"poolId,omitempty"`
	MaxAmountsIn   []types.Coin                           `protobuf:"bytes,3,rep,name=maxAmountsIn,proto3" json:"maxAmountsIn"`
	ShareAmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=shareAmountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shareAmountOut"`
	NoRemaining    bool                                   `protobuf:"varint,5,opt,name=noRemaining,proto3" json:"noRemaining,omitempty"`
}

func NewMsgJoinPool

func NewMsgJoinPool(sender string, poolId uint64, maxAmountsIn sdk.Coins, shareAmountOut sdk.Int, noRemaining bool) *MsgJoinPool

func (*MsgJoinPool) Descriptor

func (*MsgJoinPool) Descriptor() ([]byte, []int)

func (*MsgJoinPool) GetMaxAmountsIn

func (m *MsgJoinPool) GetMaxAmountsIn() []types.Coin

func (*MsgJoinPool) GetNoRemaining added in v0.12.0

func (m *MsgJoinPool) GetNoRemaining() bool

func (*MsgJoinPool) GetPoolId

func (m *MsgJoinPool) GetPoolId() uint64

func (*MsgJoinPool) GetSender

func (m *MsgJoinPool) GetSender() string

func (*MsgJoinPool) GetSignBytes

func (msg *MsgJoinPool) GetSignBytes() []byte

func (*MsgJoinPool) GetSigners

func (msg *MsgJoinPool) GetSigners() []sdk.AccAddress

func (*MsgJoinPool) Marshal

func (m *MsgJoinPool) Marshal() (dAtA []byte, err error)

func (*MsgJoinPool) MarshalTo

func (m *MsgJoinPool) MarshalTo(dAtA []byte) (int, error)

func (*MsgJoinPool) MarshalToSizedBuffer

func (m *MsgJoinPool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgJoinPool) ProtoMessage

func (*MsgJoinPool) ProtoMessage()

func (*MsgJoinPool) Reset

func (m *MsgJoinPool) Reset()

func (*MsgJoinPool) Route

func (msg *MsgJoinPool) Route() string

func (*MsgJoinPool) Size

func (m *MsgJoinPool) Size() (n int)

func (*MsgJoinPool) String

func (m *MsgJoinPool) String() string

func (*MsgJoinPool) Type

func (msg *MsgJoinPool) Type() string

func (*MsgJoinPool) Unmarshal

func (m *MsgJoinPool) Unmarshal(dAtA []byte) error

func (*MsgJoinPool) ValidateBasic

func (msg *MsgJoinPool) ValidateBasic() error

func (*MsgJoinPool) XXX_DiscardUnknown

func (m *MsgJoinPool) XXX_DiscardUnknown()

func (*MsgJoinPool) XXX_Marshal

func (m *MsgJoinPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgJoinPool) XXX_Merge

func (m *MsgJoinPool) XXX_Merge(src proto.Message)

func (*MsgJoinPool) XXX_Size

func (m *MsgJoinPool) XXX_Size() int

func (*MsgJoinPool) XXX_Unmarshal

func (m *MsgJoinPool) XXX_Unmarshal(b []byte) error

type MsgJoinPoolResponse

type MsgJoinPoolResponse struct {
	ShareAmountOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=shareAmountOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shareAmountOut"`
	TokenIn        []types.Coin                           `protobuf:"bytes,2,rep,name=tokenIn,proto3" json:"tokenIn"`
}

func (*MsgJoinPoolResponse) Descriptor

func (*MsgJoinPoolResponse) Descriptor() ([]byte, []int)

func (*MsgJoinPoolResponse) GetTokenIn

func (m *MsgJoinPoolResponse) GetTokenIn() []types.Coin

func (*MsgJoinPoolResponse) Marshal

func (m *MsgJoinPoolResponse) Marshal() (dAtA []byte, err error)

func (*MsgJoinPoolResponse) MarshalTo

func (m *MsgJoinPoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgJoinPoolResponse) MarshalToSizedBuffer

func (m *MsgJoinPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgJoinPoolResponse) ProtoMessage

func (*MsgJoinPoolResponse) ProtoMessage()

func (*MsgJoinPoolResponse) Reset

func (m *MsgJoinPoolResponse) Reset()

func (*MsgJoinPoolResponse) Size

func (m *MsgJoinPoolResponse) Size() (n int)

func (*MsgJoinPoolResponse) String

func (m *MsgJoinPoolResponse) String() string

func (*MsgJoinPoolResponse) Unmarshal

func (m *MsgJoinPoolResponse) Unmarshal(dAtA []byte) error

func (*MsgJoinPoolResponse) XXX_DiscardUnknown

func (m *MsgJoinPoolResponse) XXX_DiscardUnknown()

func (*MsgJoinPoolResponse) XXX_Marshal

func (m *MsgJoinPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgJoinPoolResponse) XXX_Merge

func (m *MsgJoinPoolResponse) XXX_Merge(src proto.Message)

func (*MsgJoinPoolResponse) XXX_Size

func (m *MsgJoinPoolResponse) XXX_Size() int

func (*MsgJoinPoolResponse) XXX_Unmarshal

func (m *MsgJoinPoolResponse) XXX_Unmarshal(b []byte) error

type MsgSwapExactAmountIn

type MsgSwapExactAmountIn struct {
	Sender            string                                 `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Routes            []SwapAmountInRoute                    `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes"`
	TokenIn           types.Coin                             `protobuf:"bytes,3,opt,name=tokenIn,proto3" json:"tokenIn"`
	TokenOutMinAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 127-byte string literal not displayed */
}

func NewMsgSwapExactAmountIn

func NewMsgSwapExactAmountIn(sender string, tokenIn sdk.Coin, tokenOutMinAmount math.Int, swapRoutePoolIds []uint64, swapRouteDenoms []string) *MsgSwapExactAmountIn

func (*MsgSwapExactAmountIn) Descriptor

func (*MsgSwapExactAmountIn) Descriptor() ([]byte, []int)

func (*MsgSwapExactAmountIn) GetRoutes

func (m *MsgSwapExactAmountIn) GetRoutes() []SwapAmountInRoute

func (*MsgSwapExactAmountIn) GetSender

func (m *MsgSwapExactAmountIn) GetSender() string

func (*MsgSwapExactAmountIn) GetSignBytes

func (msg *MsgSwapExactAmountIn) GetSignBytes() []byte

func (*MsgSwapExactAmountIn) GetSigners

func (msg *MsgSwapExactAmountIn) GetSigners() []sdk.AccAddress

func (*MsgSwapExactAmountIn) GetTokenIn

func (m *MsgSwapExactAmountIn) GetTokenIn() types.Coin

func (*MsgSwapExactAmountIn) Marshal

func (m *MsgSwapExactAmountIn) Marshal() (dAtA []byte, err error)

func (*MsgSwapExactAmountIn) MarshalTo

func (m *MsgSwapExactAmountIn) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapExactAmountIn) MarshalToSizedBuffer

func (m *MsgSwapExactAmountIn) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapExactAmountIn) ProtoMessage

func (*MsgSwapExactAmountIn) ProtoMessage()

func (*MsgSwapExactAmountIn) Reset

func (m *MsgSwapExactAmountIn) Reset()

func (*MsgSwapExactAmountIn) Route

func (msg *MsgSwapExactAmountIn) Route() string

func (*MsgSwapExactAmountIn) Size

func (m *MsgSwapExactAmountIn) Size() (n int)

func (*MsgSwapExactAmountIn) String

func (m *MsgSwapExactAmountIn) String() string

func (*MsgSwapExactAmountIn) Type

func (msg *MsgSwapExactAmountIn) Type() string

func (*MsgSwapExactAmountIn) Unmarshal

func (m *MsgSwapExactAmountIn) Unmarshal(dAtA []byte) error

func (*MsgSwapExactAmountIn) ValidateBasic

func (msg *MsgSwapExactAmountIn) ValidateBasic() error

func (*MsgSwapExactAmountIn) XXX_DiscardUnknown

func (m *MsgSwapExactAmountIn) XXX_DiscardUnknown()

func (*MsgSwapExactAmountIn) XXX_Marshal

func (m *MsgSwapExactAmountIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapExactAmountIn) XXX_Merge

func (m *MsgSwapExactAmountIn) XXX_Merge(src proto.Message)

func (*MsgSwapExactAmountIn) XXX_Size

func (m *MsgSwapExactAmountIn) XXX_Size() int

func (*MsgSwapExactAmountIn) XXX_Unmarshal

func (m *MsgSwapExactAmountIn) XXX_Unmarshal(b []byte) error

type MsgSwapExactAmountInResponse

type MsgSwapExactAmountInResponse struct {
	TokenOutAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=tokenOutAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokenOutAmount"`
}

func (*MsgSwapExactAmountInResponse) Descriptor

func (*MsgSwapExactAmountInResponse) Descriptor() ([]byte, []int)

func (*MsgSwapExactAmountInResponse) Marshal

func (m *MsgSwapExactAmountInResponse) Marshal() (dAtA []byte, err error)

func (*MsgSwapExactAmountInResponse) MarshalTo

func (m *MsgSwapExactAmountInResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapExactAmountInResponse) MarshalToSizedBuffer

func (m *MsgSwapExactAmountInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapExactAmountInResponse) ProtoMessage

func (*MsgSwapExactAmountInResponse) ProtoMessage()

func (*MsgSwapExactAmountInResponse) Reset

func (m *MsgSwapExactAmountInResponse) Reset()

func (*MsgSwapExactAmountInResponse) Size

func (m *MsgSwapExactAmountInResponse) Size() (n int)

func (*MsgSwapExactAmountInResponse) String

func (*MsgSwapExactAmountInResponse) Unmarshal

func (m *MsgSwapExactAmountInResponse) Unmarshal(dAtA []byte) error

func (*MsgSwapExactAmountInResponse) XXX_DiscardUnknown

func (m *MsgSwapExactAmountInResponse) XXX_DiscardUnknown()

func (*MsgSwapExactAmountInResponse) XXX_Marshal

func (m *MsgSwapExactAmountInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapExactAmountInResponse) XXX_Merge

func (m *MsgSwapExactAmountInResponse) XXX_Merge(src proto.Message)

func (*MsgSwapExactAmountInResponse) XXX_Size

func (m *MsgSwapExactAmountInResponse) XXX_Size() int

func (*MsgSwapExactAmountInResponse) XXX_Unmarshal

func (m *MsgSwapExactAmountInResponse) XXX_Unmarshal(b []byte) error

type MsgSwapExactAmountOut

type MsgSwapExactAmountOut struct {
	Sender           string                                 `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Routes           []SwapAmountOutRoute                   `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes"`
	TokenOut         types.Coin                             `protobuf:"bytes,3,opt,name=tokenOut,proto3" json:"tokenOut"`
	TokenInMaxAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=tokenInMaxAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokenInMaxAmount"`
}

func NewMsgSwapExactAmountOut

func NewMsgSwapExactAmountOut(sender string, tokenOut sdk.Coin, tokenInMaxAmount math.Int, swapRoutePoolIds []uint64, swapRouteDenoms []string) *MsgSwapExactAmountOut

func (*MsgSwapExactAmountOut) Descriptor

func (*MsgSwapExactAmountOut) Descriptor() ([]byte, []int)

func (*MsgSwapExactAmountOut) GetRoutes

func (m *MsgSwapExactAmountOut) GetRoutes() []SwapAmountOutRoute

func (*MsgSwapExactAmountOut) GetSender

func (m *MsgSwapExactAmountOut) GetSender() string

func (*MsgSwapExactAmountOut) GetSignBytes

func (msg *MsgSwapExactAmountOut) GetSignBytes() []byte

func (*MsgSwapExactAmountOut) GetSigners

func (msg *MsgSwapExactAmountOut) GetSigners() []sdk.AccAddress

func (*MsgSwapExactAmountOut) GetTokenOut

func (m *MsgSwapExactAmountOut) GetTokenOut() types.Coin

func (*MsgSwapExactAmountOut) Marshal

func (m *MsgSwapExactAmountOut) Marshal() (dAtA []byte, err error)

func (*MsgSwapExactAmountOut) MarshalTo

func (m *MsgSwapExactAmountOut) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapExactAmountOut) MarshalToSizedBuffer

func (m *MsgSwapExactAmountOut) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapExactAmountOut) ProtoMessage

func (*MsgSwapExactAmountOut) ProtoMessage()

func (*MsgSwapExactAmountOut) Reset

func (m *MsgSwapExactAmountOut) Reset()

func (*MsgSwapExactAmountOut) Route

func (msg *MsgSwapExactAmountOut) Route() string

func (*MsgSwapExactAmountOut) Size

func (m *MsgSwapExactAmountOut) Size() (n int)

func (*MsgSwapExactAmountOut) String

func (m *MsgSwapExactAmountOut) String() string

func (*MsgSwapExactAmountOut) Type

func (msg *MsgSwapExactAmountOut) Type() string

func (*MsgSwapExactAmountOut) Unmarshal

func (m *MsgSwapExactAmountOut) Unmarshal(dAtA []byte) error

func (*MsgSwapExactAmountOut) ValidateBasic

func (msg *MsgSwapExactAmountOut) ValidateBasic() error

func (*MsgSwapExactAmountOut) XXX_DiscardUnknown

func (m *MsgSwapExactAmountOut) XXX_DiscardUnknown()

func (*MsgSwapExactAmountOut) XXX_Marshal

func (m *MsgSwapExactAmountOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapExactAmountOut) XXX_Merge

func (m *MsgSwapExactAmountOut) XXX_Merge(src proto.Message)

func (*MsgSwapExactAmountOut) XXX_Size

func (m *MsgSwapExactAmountOut) XXX_Size() int

func (*MsgSwapExactAmountOut) XXX_Unmarshal

func (m *MsgSwapExactAmountOut) XXX_Unmarshal(b []byte) error

type MsgSwapExactAmountOutResponse

type MsgSwapExactAmountOutResponse struct {
	TokenInAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=tokenInAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokenInAmount"`
}

func (*MsgSwapExactAmountOutResponse) Descriptor

func (*MsgSwapExactAmountOutResponse) Descriptor() ([]byte, []int)

func (*MsgSwapExactAmountOutResponse) Marshal

func (m *MsgSwapExactAmountOutResponse) Marshal() (dAtA []byte, err error)

func (*MsgSwapExactAmountOutResponse) MarshalTo

func (m *MsgSwapExactAmountOutResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapExactAmountOutResponse) MarshalToSizedBuffer

func (m *MsgSwapExactAmountOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapExactAmountOutResponse) ProtoMessage

func (*MsgSwapExactAmountOutResponse) ProtoMessage()

func (*MsgSwapExactAmountOutResponse) Reset

func (m *MsgSwapExactAmountOutResponse) Reset()

func (*MsgSwapExactAmountOutResponse) Size

func (m *MsgSwapExactAmountOutResponse) Size() (n int)

func (*MsgSwapExactAmountOutResponse) String

func (*MsgSwapExactAmountOutResponse) Unmarshal

func (m *MsgSwapExactAmountOutResponse) Unmarshal(dAtA []byte) error

func (*MsgSwapExactAmountOutResponse) XXX_DiscardUnknown

func (m *MsgSwapExactAmountOutResponse) XXX_DiscardUnknown()

func (*MsgSwapExactAmountOutResponse) XXX_Marshal

func (m *MsgSwapExactAmountOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSwapExactAmountOutResponse) XXX_Merge

func (m *MsgSwapExactAmountOutResponse) XXX_Merge(src proto.Message)

func (*MsgSwapExactAmountOutResponse) XXX_Size

func (m *MsgSwapExactAmountOutResponse) XXX_Size() int

func (*MsgSwapExactAmountOutResponse) XXX_Unmarshal

func (m *MsgSwapExactAmountOutResponse) XXX_Unmarshal(b []byte) error

type MultiAmmHooks

type MultiAmmHooks []AmmHooks

combine multiple amm hooks, all hook functions are run in array sequence.

func NewMultiAmmHooks

func NewMultiAmmHooks(hooks ...AmmHooks) MultiAmmHooks

Creates hooks for the Amm Module.

func (MultiAmmHooks) AfterExitPool

func (h MultiAmmHooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool Pool, shareInAmount sdk.Int, exitCoins sdk.Coins)

func (MultiAmmHooks) AfterJoinPool

func (h MultiAmmHooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool Pool, enterCoins sdk.Coins, shareOutAmount sdk.Int)

func (MultiAmmHooks) AfterPoolCreated

func (h MultiAmmHooks) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, pool Pool)

func (MultiAmmHooks) AfterSwap

func (h MultiAmmHooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, pool Pool, input sdk.Coins, output sdk.Coins)

type MultihopRoute

type MultihopRoute interface {
	Length() int
	PoolIds() []uint64
	IntermediateDenoms() []string
}

type OracleKeeper

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)
}

OracleKeeper defines the expected interface needed to retrieve price info

type Params

type Params struct {
	PoolCreationFee uint64 `protobuf:"varint,1,opt,name=poolCreationFee,proto3" json:"poolCreationFee,omitempty"`
}

Params defines the parameters for the module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams

func NewParams(
	poolCreationFee uint64,
) Params

NewParams creates a new Params instance

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetPoolCreationFee

func (m *Params) GetPoolCreationFee() uint64

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs get the params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String implements the Stringer interface.

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate validates the set of params

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type Pool

type Pool struct {
	PoolId            uint64                                 `protobuf:"varint,1,opt,name=poolId,proto3" json:"poolId,omitempty"`
	Address           string                                 `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	PoolParams        PoolParams                             `protobuf:"bytes,3,opt,name=poolParams,proto3" json:"poolParams"`
	TotalShares       types.Coin                             `protobuf:"bytes,4,opt,name=totalShares,proto3" json:"totalShares"`
	PoolAssets        []PoolAsset                            `protobuf:"bytes,5,rep,name=poolAssets,proto3" json:"poolAssets"`
	TotalWeight       github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"totalWeight"`
	RebalanceTreasury string                                 `protobuf:"bytes,7,opt,name=rebalanceTreasury,proto3" json:"rebalanceTreasury,omitempty"`
}

func NewBalancerPool

func NewBalancerPool(poolId uint64, balancerPoolParams PoolParams, assets []PoolAsset, blockTime time.Time) (Pool, error)

NewPool returns a weighted CPMM pool with the provided parameters, and initial assets. Invariants that are assumed to be satisfied and not checked: (This is handled in ValidateBasic) * 2 <= len(assets) <= 8 * FutureGovernor is valid * poolID doesn't already exist

func (*Pool) AddTotalShares

func (p *Pool) AddTotalShares(amt sdk.Int)

func (*Pool) CalcExitPoolCoinsFromShares

func (p *Pool) CalcExitPoolCoinsFromShares(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, exitingShares math.Int, tokenOutDenom string) (exitedCoins sdk.Coins, err error)

func (Pool) CalcGivenInSlippage added in v0.11.0

func (p Pool) CalcGivenInSlippage(
	ctx sdk.Context,
	oracleKeeper OracleKeeper,
	snapshot *Pool,
	tokensIn sdk.Coins,
	tokenOutDenom string,
	accPoolKeeper AccountedPoolKeeper,
) (sdk.Dec, error)

func (Pool) CalcGivenOutSlippage added in v0.11.0

func (p Pool) CalcGivenOutSlippage(
	ctx sdk.Context,
	oracleKeeper OracleKeeper,
	snapshot *Pool,
	tokensOut sdk.Coins,
	tokenInDenom string,
	accPoolKeeper AccountedPoolKeeper,
) (sdk.Dec, error)

func (Pool) CalcInAmtGivenOut

func (p Pool) CalcInAmtGivenOut(
	ctx sdk.Context,
	oracle OracleKeeper,
	snapshot *Pool,
	tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec, accountedPool AccountedPoolKeeper) (
	tokenIn sdk.Coin, err error,
)

CalcInAmtGivenOut calculates token to be provided, fee added, given the swapped out amount, using solveConstantFunctionInvariant.

func (*Pool) CalcJoinPoolNoSwapShares

func (p *Pool) CalcJoinPoolNoSwapShares(tokensIn sdk.Coins) (numShares sdk.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, (in case of not being able to fully join), and the remaining tokens in `tokensIn` after joining. If an all-asset join is not possible, returns an error.

Since CalcJoinPoolNoSwapShares is non-mutative, the steps for updating pool shares / liquidity are more complex / don't just alter the state. We should simplify this logic further in the future using multi-join equations.

func (*Pool) CalcJoinValueWithoutSlippage added in v0.11.0

func (p *Pool) CalcJoinValueWithoutSlippage(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (math.LegacyDec, error)

func (Pool) CalcOutAmtGivenIn

func (p Pool) CalcOutAmtGivenIn(
	ctx sdk.Context,
	oracle OracleKeeper,
	snapshot *Pool,
	tokensIn sdk.Coins,
	tokenOutDenom string,
	swapFee sdk.Dec,
	accountedPool AccountedPoolKeeper,
) (sdk.Coin, error)

CalcOutAmtGivenIn calculates tokens to be swapped out given the provided amount and fee deducted, using solveConstantFunctionInvariant.

func (*Pool) CalcSingleAssetJoinPoolShares added in v0.12.0

func (p *Pool) CalcSingleAssetJoinPoolShares(tokensIn sdk.Coins) (numShares sdk.Int, tokensJoined sdk.Coins, err error)

CalcJoinPoolShares calculates the number of shares created to join pool with the provided amount of `tokenIn`. The input tokens must either be: - a single token - contain exactly the same tokens as the pool contains

It returns the number of shares created, the amount of coins actually joined into the pool (in case of not being able to fully join), or an error.

func (*Pool) Descriptor

func (*Pool) Descriptor() ([]byte, []int)

func (*Pool) ExitPool

func (p *Pool) ExitPool(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeepr AccountedPoolKeeper, exitingShares sdk.Int, tokenOutDenom string) (exitingCoins sdk.Coins, err error)

func (*Pool) GetAddress

func (m *Pool) GetAddress() string

func (Pool) GetAllPoolAssets

func (p Pool) GetAllPoolAssets() []PoolAsset

func (Pool) GetPoolAssetAndIndex

func (p Pool) GetPoolAssetAndIndex(denom string) (int, PoolAsset, error)

Returns a pool asset, and its index. If err != nil, then the index will be valid.

func (*Pool) GetPoolAssets

func (m *Pool) GetPoolAssets() []PoolAsset

func (*Pool) GetPoolId

func (m *Pool) GetPoolId() uint64

func (*Pool) GetPoolParams

func (m *Pool) GetPoolParams() PoolParams

func (*Pool) GetRebalanceTreasury

func (m *Pool) GetRebalanceTreasury() string

func (Pool) GetTotalPoolLiquidity

func (p Pool) GetTotalPoolLiquidity() sdk.Coins

func (*Pool) GetTotalShares

func (m *Pool) GetTotalShares() types.Coin

func (*Pool) IncreaseLiquidity

func (p *Pool) IncreaseLiquidity(sharesOut sdk.Int, coinsIn sdk.Coins)

func (*Pool) JoinPool added in v0.12.0

func (p *Pool) JoinPool(ctx sdk.Context, oracleKeeper OracleKeeper, accountedPoolKeeper AccountedPoolKeeper, tokensIn sdk.Coins) (numShares math.Int, err error)

JoinPool calculates the number of shares needed for an all-asset join given tokensIn with swapFee applied. It updates the liquidity if the pool is joined successfully. If not, returns error.

func (*Pool) Marshal

func (m *Pool) Marshal() (dAtA []byte, err error)

func (*Pool) MarshalTo

func (m *Pool) MarshalTo(dAtA []byte) (int, error)

func (*Pool) MarshalToSizedBuffer

func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (Pool) NewPoolAssetsAfterSwap

func (p Pool) NewPoolAssetsAfterSwap(inCoins sdk.Coins, outCoins sdk.Coins) (poolAssets []PoolAsset, err error)

func (*Pool) ProtoMessage

func (*Pool) ProtoMessage()

func (*Pool) Reset

func (m *Pool) Reset()

func (*Pool) SetInitialPoolAssets

func (p *Pool) SetInitialPoolAssets(PoolAssets []PoolAsset) error

SetInitialPoolAssets sets the PoolAssets in the pool. It is only designed to be called at the pool's creation. If the same denom's PoolAsset exists, will return error.

The list of PoolAssets must be sorted. This is done to enable fast searching for a PoolAsset by denomination. TODO: Unify story for validation of []PoolAsset, some is here, some is in CreatePool.ValidateBasic()

func (*Pool) Size

func (m *Pool) Size() (n int)

func (Pool) StackedRatioFromSnapshot added in v0.11.0

func (p Pool) StackedRatioFromSnapshot(ctx sdk.Context, oracleKeeper OracleKeeper, snapshot *Pool) sdk.Dec

func (*Pool) String

func (m *Pool) String() string

func (*Pool) SwapInAmtGivenOut

func (p *Pool) SwapInAmtGivenOut(
	ctx sdk.Context, oracleKeeper OracleKeeper, snapshot *Pool,
	tokensOut sdk.Coins, tokenInDenom string, swapFee sdk.Dec, accPoolKeeper AccountedPoolKeeper) (
	tokenIn sdk.Coin, weightBalanceBonus sdk.Dec, err error,
)

SwapInAmtGivenOut is a mutative method for CalcOutAmtGivenIn, which includes the actual swap.

func (*Pool) SwapOutAmtGivenIn

func (p *Pool) SwapOutAmtGivenIn(
	ctx sdk.Context,
	oracleKeeper OracleKeeper,
	snapshot *Pool,
	tokensIn sdk.Coins,
	tokenOutDenom string,
	swapFee sdk.Dec,
	accPoolKeeper AccountedPoolKeeper,
) (tokenOut sdk.Coin, weightBalanceBonus sdk.Dec, err error)

SwapOutAmtGivenIn is a mutative method for CalcOutAmtGivenIn, which includes the actual swap.

func (*Pool) TVL

func (p *Pool) TVL(ctx sdk.Context, oracleKeeper OracleKeeper) (sdk.Dec, error)

func (*Pool) Unmarshal

func (m *Pool) Unmarshal(dAtA []byte) error

func (*Pool) UpdatePoolAssetBalance

func (p *Pool) UpdatePoolAssetBalance(coin sdk.Coin) error

func (*Pool) UpdatePoolAssetBalances

func (p *Pool) UpdatePoolAssetBalances(coins sdk.Coins) error

func (Pool) Validate

func (pool Pool) Validate(
	poolId uint64,
) error

func (Pool) WeightDistanceFromTarget

func (p Pool) WeightDistanceFromTarget(ctx sdk.Context, oracleKeeper OracleKeeper, poolAssets []PoolAsset) sdk.Dec

func (*Pool) XXX_DiscardUnknown

func (m *Pool) XXX_DiscardUnknown()

func (*Pool) XXX_Marshal

func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pool) XXX_Merge

func (m *Pool) XXX_Merge(src proto.Message)

func (*Pool) XXX_Size

func (m *Pool) XXX_Size() int

func (*Pool) XXX_Unmarshal

func (m *Pool) XXX_Unmarshal(b []byte) error

type PoolAsset

type PoolAsset struct {
	Token  types.Coin                             `protobuf:"bytes,1,opt,name=token,proto3" json:"token"`
	Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight"`
}

func GetPoolAssetByDenom

func GetPoolAssetByDenom(assets []PoolAsset, denom string) (PoolAsset, bool)

func (*PoolAsset) Descriptor

func (*PoolAsset) Descriptor() ([]byte, []int)

func (*PoolAsset) GetToken

func (m *PoolAsset) GetToken() types.Coin

func (*PoolAsset) Marshal

func (m *PoolAsset) Marshal() (dAtA []byte, err error)

func (*PoolAsset) MarshalTo

func (m *PoolAsset) MarshalTo(dAtA []byte) (int, error)

func (*PoolAsset) MarshalToSizedBuffer

func (m *PoolAsset) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PoolAsset) ProtoMessage

func (*PoolAsset) ProtoMessage()

func (*PoolAsset) Reset

func (m *PoolAsset) Reset()

func (*PoolAsset) Size

func (m *PoolAsset) Size() (n int)

func (*PoolAsset) String

func (m *PoolAsset) String() string

func (*PoolAsset) Unmarshal

func (m *PoolAsset) Unmarshal(dAtA []byte) error

func (*PoolAsset) XXX_DiscardUnknown

func (m *PoolAsset) XXX_DiscardUnknown()

func (*PoolAsset) XXX_Marshal

func (m *PoolAsset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PoolAsset) XXX_Merge

func (m *PoolAsset) XXX_Merge(src proto.Message)

func (*PoolAsset) XXX_Size

func (m *PoolAsset) XXX_Size() int

func (*PoolAsset) XXX_Unmarshal

func (m *PoolAsset) XXX_Unmarshal(b []byte) error

type PoolAssetUSDValue added in v0.11.0

type PoolAssetUSDValue struct {
	Asset string
	Value sdk.Dec
}

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"`
	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"`
	UseOracle                   bool                                   `protobuf:"varint,3,opt,name=useOracle,proto3" json:"useOracle,omitempty"`
	WeightBreakingFeeMultiplier github_com_cosmos_cosmos_sdk_types.Dec `` /* 147-byte string literal not displayed */
	ExternalLiquidityRatio      github_com_cosmos_cosmos_sdk_types.Dec `` /* 137-byte string literal not displayed */
	LpFeePortion                github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=lpFeePortion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"lpFeePortion"`
	StakingFeePortion           github_com_cosmos_cosmos_sdk_types.Dec `` /* 127-byte string literal not displayed */
	WeightRecoveryFeePortion    github_com_cosmos_cosmos_sdk_types.Dec `` /* 141-byte string literal not displayed */
	ThresholdWeightDifference   github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	FeeDenom                    string                                 `protobuf:"bytes,10,opt,name=feeDenom,proto3" json:"feeDenom,omitempty"`
}

func (*PoolParams) Descriptor

func (*PoolParams) Descriptor() ([]byte, []int)

func (*PoolParams) GetFeeDenom

func (m *PoolParams) GetFeeDenom() string

func (*PoolParams) GetUseOracle

func (m *PoolParams) GetUseOracle() bool

func (*PoolParams) Marshal

func (m *PoolParams) Marshal() (dAtA []byte, err error)

func (*PoolParams) MarshalTo

func (m *PoolParams) MarshalTo(dAtA []byte) (int, 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(poolWeights []PoolAsset) 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 ProposalCreateBalancerPool

type ProposalCreateBalancerPool struct {
	Title       string      `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string      `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	PoolParams  *PoolParams `protobuf:"bytes,3,opt,name=poolParams,proto3" json:"poolParams,omitempty"`
	PoolAssets  []PoolAsset `protobuf:"bytes,4,rep,name=poolAssets,proto3" json:"poolAssets"`
}

func (*ProposalCreateBalancerPool) Descriptor

func (*ProposalCreateBalancerPool) Descriptor() ([]byte, []int)

func (*ProposalCreateBalancerPool) GetDescription

func (m *ProposalCreateBalancerPool) GetDescription() string

func (*ProposalCreateBalancerPool) GetPoolAssets

func (m *ProposalCreateBalancerPool) GetPoolAssets() []PoolAsset

func (*ProposalCreateBalancerPool) GetPoolParams

func (m *ProposalCreateBalancerPool) GetPoolParams() *PoolParams

func (*ProposalCreateBalancerPool) GetTitle

func (m *ProposalCreateBalancerPool) GetTitle() string

func (*ProposalCreateBalancerPool) Marshal

func (m *ProposalCreateBalancerPool) Marshal() (dAtA []byte, err error)

func (*ProposalCreateBalancerPool) MarshalTo

func (m *ProposalCreateBalancerPool) MarshalTo(dAtA []byte) (int, error)

func (*ProposalCreateBalancerPool) MarshalToSizedBuffer

func (m *ProposalCreateBalancerPool) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProposalCreateBalancerPool) ProtoMessage

func (*ProposalCreateBalancerPool) ProtoMessage()

func (*ProposalCreateBalancerPool) Reset

func (m *ProposalCreateBalancerPool) Reset()

func (*ProposalCreateBalancerPool) Size

func (m *ProposalCreateBalancerPool) Size() (n int)

func (*ProposalCreateBalancerPool) String

func (m *ProposalCreateBalancerPool) String() string

func (*ProposalCreateBalancerPool) Unmarshal

func (m *ProposalCreateBalancerPool) Unmarshal(dAtA []byte) error

func (*ProposalCreateBalancerPool) XXX_DiscardUnknown

func (m *ProposalCreateBalancerPool) XXX_DiscardUnknown()

func (*ProposalCreateBalancerPool) XXX_Marshal

func (m *ProposalCreateBalancerPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProposalCreateBalancerPool) XXX_Merge

func (m *ProposalCreateBalancerPool) XXX_Merge(src proto.Message)

func (*ProposalCreateBalancerPool) XXX_Size

func (m *ProposalCreateBalancerPool) XXX_Size() int

func (*ProposalCreateBalancerPool) XXX_Unmarshal

func (m *ProposalCreateBalancerPool) XXX_Unmarshal(b []byte) error

type ProposalUpdatePoolParams

type ProposalUpdatePoolParams struct {
	Title       string     `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string     `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	PoolId      uint64     `protobuf:"varint,3,opt,name=poolId,proto3" json:"poolId,omitempty" yaml:"pool_id"`
	PoolParams  PoolParams `protobuf:"bytes,4,opt,name=poolParams,proto3" json:"poolParams" yaml:"balancer_pool_params"`
}

func (*ProposalUpdatePoolParams) Descriptor

func (*ProposalUpdatePoolParams) Descriptor() ([]byte, []int)

func (*ProposalUpdatePoolParams) GetDescription

func (m *ProposalUpdatePoolParams) GetDescription() string

func (*ProposalUpdatePoolParams) GetPoolId

func (m *ProposalUpdatePoolParams) GetPoolId() uint64

func (*ProposalUpdatePoolParams) GetPoolParams

func (m *ProposalUpdatePoolParams) GetPoolParams() PoolParams

func (*ProposalUpdatePoolParams) GetTitle

func (m *ProposalUpdatePoolParams) GetTitle() string

func (*ProposalUpdatePoolParams) Marshal

func (m *ProposalUpdatePoolParams) Marshal() (dAtA []byte, err error)

func (*ProposalUpdatePoolParams) MarshalTo

func (m *ProposalUpdatePoolParams) MarshalTo(dAtA []byte) (int, error)

func (*ProposalUpdatePoolParams) MarshalToSizedBuffer

func (m *ProposalUpdatePoolParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProposalUpdatePoolParams) ProtoMessage

func (*ProposalUpdatePoolParams) ProtoMessage()

func (*ProposalUpdatePoolParams) Reset

func (m *ProposalUpdatePoolParams) Reset()

func (*ProposalUpdatePoolParams) Size

func (m *ProposalUpdatePoolParams) Size() (n int)

func (*ProposalUpdatePoolParams) String

func (m *ProposalUpdatePoolParams) String() string

func (*ProposalUpdatePoolParams) Unmarshal

func (m *ProposalUpdatePoolParams) Unmarshal(dAtA []byte) error

func (*ProposalUpdatePoolParams) XXX_DiscardUnknown

func (m *ProposalUpdatePoolParams) XXX_DiscardUnknown()

func (*ProposalUpdatePoolParams) XXX_Marshal

func (m *ProposalUpdatePoolParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProposalUpdatePoolParams) XXX_Merge

func (m *ProposalUpdatePoolParams) XXX_Merge(src proto.Message)

func (*ProposalUpdatePoolParams) XXX_Size

func (m *ProposalUpdatePoolParams) XXX_Size() int

func (*ProposalUpdatePoolParams) XXX_Unmarshal

func (m *ProposalUpdatePoolParams) XXX_Unmarshal(b []byte) error

type QueryAllDenomLiquidityRequest

type QueryAllDenomLiquidityRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (*QueryAllDenomLiquidityRequest) Descriptor

func (*QueryAllDenomLiquidityRequest) Descriptor() ([]byte, []int)

func (*QueryAllDenomLiquidityRequest) GetPagination

func (m *QueryAllDenomLiquidityRequest) GetPagination() *query.PageRequest

func (*QueryAllDenomLiquidityRequest) Marshal

func (m *QueryAllDenomLiquidityRequest) Marshal() (dAtA []byte, err error)

func (*QueryAllDenomLiquidityRequest) MarshalTo

func (m *QueryAllDenomLiquidityRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllDenomLiquidityRequest) MarshalToSizedBuffer

func (m *QueryAllDenomLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllDenomLiquidityRequest) ProtoMessage

func (*QueryAllDenomLiquidityRequest) ProtoMessage()

func (*QueryAllDenomLiquidityRequest) Reset

func (m *QueryAllDenomLiquidityRequest) Reset()

func (*QueryAllDenomLiquidityRequest) Size

func (m *QueryAllDenomLiquidityRequest) Size() (n int)

func (*QueryAllDenomLiquidityRequest) String

func (*QueryAllDenomLiquidityRequest) Unmarshal

func (m *QueryAllDenomLiquidityRequest) Unmarshal(dAtA []byte) error

func (*QueryAllDenomLiquidityRequest) XXX_DiscardUnknown

func (m *QueryAllDenomLiquidityRequest) XXX_DiscardUnknown()

func (*QueryAllDenomLiquidityRequest) XXX_Marshal

func (m *QueryAllDenomLiquidityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllDenomLiquidityRequest) XXX_Merge

func (m *QueryAllDenomLiquidityRequest) XXX_Merge(src proto.Message)

func (*QueryAllDenomLiquidityRequest) XXX_Size

func (m *QueryAllDenomLiquidityRequest) XXX_Size() int

func (*QueryAllDenomLiquidityRequest) XXX_Unmarshal

func (m *QueryAllDenomLiquidityRequest) XXX_Unmarshal(b []byte) error

type QueryAllDenomLiquidityResponse

type QueryAllDenomLiquidityResponse struct {
	DenomLiquidity []DenomLiquidity    `protobuf:"bytes,1,rep,name=denomLiquidity,proto3" json:"denomLiquidity"`
	Pagination     *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (*QueryAllDenomLiquidityResponse) Descriptor

func (*QueryAllDenomLiquidityResponse) Descriptor() ([]byte, []int)

func (*QueryAllDenomLiquidityResponse) GetDenomLiquidity

func (m *QueryAllDenomLiquidityResponse) GetDenomLiquidity() []DenomLiquidity

func (*QueryAllDenomLiquidityResponse) GetPagination

func (*QueryAllDenomLiquidityResponse) Marshal

func (m *QueryAllDenomLiquidityResponse) Marshal() (dAtA []byte, err error)

func (*QueryAllDenomLiquidityResponse) MarshalTo

func (m *QueryAllDenomLiquidityResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllDenomLiquidityResponse) MarshalToSizedBuffer

func (m *QueryAllDenomLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllDenomLiquidityResponse) ProtoMessage

func (*QueryAllDenomLiquidityResponse) ProtoMessage()

func (*QueryAllDenomLiquidityResponse) Reset

func (m *QueryAllDenomLiquidityResponse) Reset()

func (*QueryAllDenomLiquidityResponse) Size

func (m *QueryAllDenomLiquidityResponse) Size() (n int)

func (*QueryAllDenomLiquidityResponse) String

func (*QueryAllDenomLiquidityResponse) Unmarshal

func (m *QueryAllDenomLiquidityResponse) Unmarshal(dAtA []byte) error

func (*QueryAllDenomLiquidityResponse) XXX_DiscardUnknown

func (m *QueryAllDenomLiquidityResponse) XXX_DiscardUnknown()

func (*QueryAllDenomLiquidityResponse) XXX_Marshal

func (m *QueryAllDenomLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllDenomLiquidityResponse) XXX_Merge

func (m *QueryAllDenomLiquidityResponse) XXX_Merge(src proto.Message)

func (*QueryAllDenomLiquidityResponse) XXX_Size

func (m *QueryAllDenomLiquidityResponse) XXX_Size() int

func (*QueryAllDenomLiquidityResponse) XXX_Unmarshal

func (m *QueryAllDenomLiquidityResponse) XXX_Unmarshal(b []byte) error

type QueryAllPoolRequest

type QueryAllPoolRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (*QueryAllPoolRequest) Descriptor

func (*QueryAllPoolRequest) Descriptor() ([]byte, []int)

func (*QueryAllPoolRequest) GetPagination

func (m *QueryAllPoolRequest) GetPagination() *query.PageRequest

func (*QueryAllPoolRequest) Marshal

func (m *QueryAllPoolRequest) Marshal() (dAtA []byte, err error)

func (*QueryAllPoolRequest) MarshalTo

func (m *QueryAllPoolRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllPoolRequest) MarshalToSizedBuffer

func (m *QueryAllPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllPoolRequest) ProtoMessage

func (*QueryAllPoolRequest) ProtoMessage()

func (*QueryAllPoolRequest) Reset

func (m *QueryAllPoolRequest) Reset()

func (*QueryAllPoolRequest) Size

func (m *QueryAllPoolRequest) Size() (n int)

func (*QueryAllPoolRequest) String

func (m *QueryAllPoolRequest) String() string

func (*QueryAllPoolRequest) Unmarshal

func (m *QueryAllPoolRequest) Unmarshal(dAtA []byte) error

func (*QueryAllPoolRequest) XXX_DiscardUnknown

func (m *QueryAllPoolRequest) XXX_DiscardUnknown()

func (*QueryAllPoolRequest) XXX_Marshal

func (m *QueryAllPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllPoolRequest) XXX_Merge

func (m *QueryAllPoolRequest) XXX_Merge(src proto.Message)

func (*QueryAllPoolRequest) XXX_Size

func (m *QueryAllPoolRequest) XXX_Size() int

func (*QueryAllPoolRequest) XXX_Unmarshal

func (m *QueryAllPoolRequest) XXX_Unmarshal(b []byte) error

type QueryAllPoolResponse

type QueryAllPoolResponse struct {
	Pool       []Pool              `protobuf:"bytes,1,rep,name=pool,proto3" json:"pool"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

func (*QueryAllPoolResponse) Descriptor

func (*QueryAllPoolResponse) Descriptor() ([]byte, []int)

func (*QueryAllPoolResponse) GetPagination

func (m *QueryAllPoolResponse) GetPagination() *query.PageResponse

func (*QueryAllPoolResponse) GetPool

func (m *QueryAllPoolResponse) GetPool() []Pool

func (*QueryAllPoolResponse) Marshal

func (m *QueryAllPoolResponse) Marshal() (dAtA []byte, err error)

func (*QueryAllPoolResponse) MarshalTo

func (m *QueryAllPoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllPoolResponse) MarshalToSizedBuffer

func (m *QueryAllPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllPoolResponse) ProtoMessage

func (*QueryAllPoolResponse) ProtoMessage()

func (*QueryAllPoolResponse) Reset

func (m *QueryAllPoolResponse) Reset()

func (*QueryAllPoolResponse) Size

func (m *QueryAllPoolResponse) Size() (n int)

func (*QueryAllPoolResponse) String

func (m *QueryAllPoolResponse) String() string

func (*QueryAllPoolResponse) Unmarshal

func (m *QueryAllPoolResponse) Unmarshal(dAtA []byte) error

func (*QueryAllPoolResponse) XXX_DiscardUnknown

func (m *QueryAllPoolResponse) XXX_DiscardUnknown()

func (*QueryAllPoolResponse) XXX_Marshal

func (m *QueryAllPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllPoolResponse) XXX_Merge

func (m *QueryAllPoolResponse) XXX_Merge(src proto.Message)

func (*QueryAllPoolResponse) XXX_Size

func (m *QueryAllPoolResponse) XXX_Size() int

func (*QueryAllPoolResponse) XXX_Unmarshal

func (m *QueryAllPoolResponse) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Parameters queries the parameters of the module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Queries a list of Pool items.
	Pool(ctx context.Context, in *QueryGetPoolRequest, opts ...grpc.CallOption) (*QueryGetPoolResponse, error)
	PoolAll(ctx context.Context, in *QueryAllPoolRequest, opts ...grpc.CallOption) (*QueryAllPoolResponse, error)
	// Queries a list of DenomLiquidity items.
	DenomLiquidity(ctx context.Context, in *QueryGetDenomLiquidityRequest, opts ...grpc.CallOption) (*QueryGetDenomLiquidityResponse, error)
	DenomLiquidityAll(ctx context.Context, in *QueryAllDenomLiquidityRequest, opts ...grpc.CallOption) (*QueryAllDenomLiquidityResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryGetDenomLiquidityRequest

type QueryGetDenomLiquidityRequest struct {
	Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
}

func (*QueryGetDenomLiquidityRequest) Descriptor

func (*QueryGetDenomLiquidityRequest) Descriptor() ([]byte, []int)

func (*QueryGetDenomLiquidityRequest) GetDenom

func (m *QueryGetDenomLiquidityRequest) GetDenom() string

func (*QueryGetDenomLiquidityRequest) Marshal

func (m *QueryGetDenomLiquidityRequest) Marshal() (dAtA []byte, err error)

func (*QueryGetDenomLiquidityRequest) MarshalTo

func (m *QueryGetDenomLiquidityRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryGetDenomLiquidityRequest) MarshalToSizedBuffer

func (m *QueryGetDenomLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGetDenomLiquidityRequest) ProtoMessage

func (*QueryGetDenomLiquidityRequest) ProtoMessage()

func (*QueryGetDenomLiquidityRequest) Reset

func (m *QueryGetDenomLiquidityRequest) Reset()

func (*QueryGetDenomLiquidityRequest) Size

func (m *QueryGetDenomLiquidityRequest) Size() (n int)

func (*QueryGetDenomLiquidityRequest) String

func (*QueryGetDenomLiquidityRequest) Unmarshal

func (m *QueryGetDenomLiquidityRequest) Unmarshal(dAtA []byte) error

func (*QueryGetDenomLiquidityRequest) XXX_DiscardUnknown

func (m *QueryGetDenomLiquidityRequest) XXX_DiscardUnknown()

func (*QueryGetDenomLiquidityRequest) XXX_Marshal

func (m *QueryGetDenomLiquidityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGetDenomLiquidityRequest) XXX_Merge

func (m *QueryGetDenomLiquidityRequest) XXX_Merge(src proto.Message)

func (*QueryGetDenomLiquidityRequest) XXX_Size

func (m *QueryGetDenomLiquidityRequest) XXX_Size() int

func (*QueryGetDenomLiquidityRequest) XXX_Unmarshal

func (m *QueryGetDenomLiquidityRequest) XXX_Unmarshal(b []byte) error

type QueryGetDenomLiquidityResponse

type QueryGetDenomLiquidityResponse struct {
	DenomLiquidity DenomLiquidity `protobuf:"bytes,1,opt,name=denomLiquidity,proto3" json:"denomLiquidity"`
}

func (*QueryGetDenomLiquidityResponse) Descriptor

func (*QueryGetDenomLiquidityResponse) Descriptor() ([]byte, []int)

func (*QueryGetDenomLiquidityResponse) GetDenomLiquidity

func (m *QueryGetDenomLiquidityResponse) GetDenomLiquidity() DenomLiquidity

func (*QueryGetDenomLiquidityResponse) Marshal

func (m *QueryGetDenomLiquidityResponse) Marshal() (dAtA []byte, err error)

func (*QueryGetDenomLiquidityResponse) MarshalTo

func (m *QueryGetDenomLiquidityResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryGetDenomLiquidityResponse) MarshalToSizedBuffer

func (m *QueryGetDenomLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGetDenomLiquidityResponse) ProtoMessage

func (*QueryGetDenomLiquidityResponse) ProtoMessage()

func (*QueryGetDenomLiquidityResponse) Reset

func (m *QueryGetDenomLiquidityResponse) Reset()

func (*QueryGetDenomLiquidityResponse) Size

func (m *QueryGetDenomLiquidityResponse) Size() (n int)

func (*QueryGetDenomLiquidityResponse) String

func (*QueryGetDenomLiquidityResponse) Unmarshal

func (m *QueryGetDenomLiquidityResponse) Unmarshal(dAtA []byte) error

func (*QueryGetDenomLiquidityResponse) XXX_DiscardUnknown

func (m *QueryGetDenomLiquidityResponse) XXX_DiscardUnknown()

func (*QueryGetDenomLiquidityResponse) XXX_Marshal

func (m *QueryGetDenomLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGetDenomLiquidityResponse) XXX_Merge

func (m *QueryGetDenomLiquidityResponse) XXX_Merge(src proto.Message)

func (*QueryGetDenomLiquidityResponse) XXX_Size

func (m *QueryGetDenomLiquidityResponse) XXX_Size() int

func (*QueryGetDenomLiquidityResponse) XXX_Unmarshal

func (m *QueryGetDenomLiquidityResponse) XXX_Unmarshal(b []byte) error

type QueryGetPoolRequest

type QueryGetPoolRequest struct {
	PoolId uint64 `protobuf:"varint,1,opt,name=poolId,proto3" json:"poolId,omitempty"`
}

func (*QueryGetPoolRequest) Descriptor

func (*QueryGetPoolRequest) Descriptor() ([]byte, []int)

func (*QueryGetPoolRequest) GetPoolId

func (m *QueryGetPoolRequest) GetPoolId() uint64

func (*QueryGetPoolRequest) Marshal

func (m *QueryGetPoolRequest) Marshal() (dAtA []byte, err error)

func (*QueryGetPoolRequest) MarshalTo

func (m *QueryGetPoolRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryGetPoolRequest) MarshalToSizedBuffer

func (m *QueryGetPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGetPoolRequest) ProtoMessage

func (*QueryGetPoolRequest) ProtoMessage()

func (*QueryGetPoolRequest) Reset

func (m *QueryGetPoolRequest) Reset()

func (*QueryGetPoolRequest) Size

func (m *QueryGetPoolRequest) Size() (n int)

func (*QueryGetPoolRequest) String

func (m *QueryGetPoolRequest) String() string

func (*QueryGetPoolRequest) Unmarshal

func (m *QueryGetPoolRequest) Unmarshal(dAtA []byte) error

func (*QueryGetPoolRequest) XXX_DiscardUnknown

func (m *QueryGetPoolRequest) XXX_DiscardUnknown()

func (*QueryGetPoolRequest) XXX_Marshal

func (m *QueryGetPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGetPoolRequest) XXX_Merge

func (m *QueryGetPoolRequest) XXX_Merge(src proto.Message)

func (*QueryGetPoolRequest) XXX_Size

func (m *QueryGetPoolRequest) XXX_Size() int

func (*QueryGetPoolRequest) XXX_Unmarshal

func (m *QueryGetPoolRequest) XXX_Unmarshal(b []byte) error

type QueryGetPoolResponse

type QueryGetPoolResponse struct {
	Pool Pool `protobuf:"bytes,1,opt,name=pool,proto3" json:"pool"`
}

func (*QueryGetPoolResponse) Descriptor

func (*QueryGetPoolResponse) Descriptor() ([]byte, []int)

func (*QueryGetPoolResponse) GetPool

func (m *QueryGetPoolResponse) GetPool() Pool

func (*QueryGetPoolResponse) Marshal

func (m *QueryGetPoolResponse) Marshal() (dAtA []byte, err error)

func (*QueryGetPoolResponse) MarshalTo

func (m *QueryGetPoolResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryGetPoolResponse) MarshalToSizedBuffer

func (m *QueryGetPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryGetPoolResponse) ProtoMessage

func (*QueryGetPoolResponse) ProtoMessage()

func (*QueryGetPoolResponse) Reset

func (m *QueryGetPoolResponse) Reset()

func (*QueryGetPoolResponse) Size

func (m *QueryGetPoolResponse) Size() (n int)

func (*QueryGetPoolResponse) String

func (m *QueryGetPoolResponse) String() string

func (*QueryGetPoolResponse) Unmarshal

func (m *QueryGetPoolResponse) Unmarshal(dAtA []byte) error

func (*QueryGetPoolResponse) XXX_DiscardUnknown

func (m *QueryGetPoolResponse) XXX_DiscardUnknown()

func (*QueryGetPoolResponse) XXX_Marshal

func (m *QueryGetPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryGetPoolResponse) XXX_Merge

func (m *QueryGetPoolResponse) XXX_Merge(src proto.Message)

func (*QueryGetPoolResponse) XXX_Size

func (m *QueryGetPoolResponse) XXX_Size() int

func (*QueryGetPoolResponse) XXX_Unmarshal

func (m *QueryGetPoolResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	// params holds all the parameters of this module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Parameters queries the parameters of the module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Queries a list of Pool items.
	Pool(context.Context, *QueryGetPoolRequest) (*QueryGetPoolResponse, error)
	PoolAll(context.Context, *QueryAllPoolRequest) (*QueryAllPoolResponse, error)
	// Queries a list of DenomLiquidity items.
	DenomLiquidity(context.Context, *QueryGetDenomLiquidityRequest) (*QueryGetDenomLiquidityResponse, error)
	DenomLiquidityAll(context.Context, *QueryAllDenomLiquidityRequest) (*QueryAllDenomLiquidityResponse, error)
}

QueryServer is the server API for Query service.

type SwapAmountInRoute

type SwapAmountInRoute struct {
	PoolId        uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	TokenOutDenom string `protobuf:"bytes,2,opt,name=token_out_denom,json=tokenOutDenom,proto3" json:"token_out_denom,omitempty"`
}

func (*SwapAmountInRoute) Descriptor

func (*SwapAmountInRoute) Descriptor() ([]byte, []int)

func (*SwapAmountInRoute) GetPoolId

func (m *SwapAmountInRoute) GetPoolId() uint64

func (*SwapAmountInRoute) GetTokenOutDenom

func (m *SwapAmountInRoute) GetTokenOutDenom() string

func (*SwapAmountInRoute) Marshal

func (m *SwapAmountInRoute) Marshal() (dAtA []byte, err error)

func (*SwapAmountInRoute) MarshalTo

func (m *SwapAmountInRoute) MarshalTo(dAtA []byte) (int, error)

func (*SwapAmountInRoute) MarshalToSizedBuffer

func (m *SwapAmountInRoute) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SwapAmountInRoute) ProtoMessage

func (*SwapAmountInRoute) ProtoMessage()

func (*SwapAmountInRoute) Reset

func (m *SwapAmountInRoute) Reset()

func (*SwapAmountInRoute) Size

func (m *SwapAmountInRoute) Size() (n int)

func (*SwapAmountInRoute) String

func (m *SwapAmountInRoute) String() string

func (*SwapAmountInRoute) Unmarshal

func (m *SwapAmountInRoute) Unmarshal(dAtA []byte) error

func (*SwapAmountInRoute) XXX_DiscardUnknown

func (m *SwapAmountInRoute) XXX_DiscardUnknown()

func (*SwapAmountInRoute) XXX_Marshal

func (m *SwapAmountInRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SwapAmountInRoute) XXX_Merge

func (m *SwapAmountInRoute) XXX_Merge(src proto.Message)

func (*SwapAmountInRoute) XXX_Size

func (m *SwapAmountInRoute) XXX_Size() int

func (*SwapAmountInRoute) XXX_Unmarshal

func (m *SwapAmountInRoute) XXX_Unmarshal(b []byte) error

type SwapAmountInRoutes

type SwapAmountInRoutes []SwapAmountInRoute

func (SwapAmountInRoutes) IntermediateDenoms

func (routes SwapAmountInRoutes) IntermediateDenoms() []string

func (SwapAmountInRoutes) Length

func (routes SwapAmountInRoutes) Length() int

func (SwapAmountInRoutes) PoolIds

func (routes SwapAmountInRoutes) PoolIds() []uint64

func (SwapAmountInRoutes) Validate

func (routes SwapAmountInRoutes) Validate() error

type SwapAmountOutRoute

type SwapAmountOutRoute struct {
	PoolId       uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
	TokenInDenom string `protobuf:"bytes,2,opt,name=token_in_denom,json=tokenInDenom,proto3" json:"token_in_denom,omitempty"`
}

func (*SwapAmountOutRoute) Descriptor

func (*SwapAmountOutRoute) Descriptor() ([]byte, []int)

func (*SwapAmountOutRoute) GetPoolId

func (m *SwapAmountOutRoute) GetPoolId() uint64

func (*SwapAmountOutRoute) GetTokenInDenom

func (m *SwapAmountOutRoute) GetTokenInDenom() string

func (*SwapAmountOutRoute) Marshal

func (m *SwapAmountOutRoute) Marshal() (dAtA []byte, err error)

func (*SwapAmountOutRoute) MarshalTo

func (m *SwapAmountOutRoute) MarshalTo(dAtA []byte) (int, error)

func (*SwapAmountOutRoute) MarshalToSizedBuffer

func (m *SwapAmountOutRoute) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SwapAmountOutRoute) ProtoMessage

func (*SwapAmountOutRoute) ProtoMessage()

func (*SwapAmountOutRoute) Reset

func (m *SwapAmountOutRoute) Reset()

func (*SwapAmountOutRoute) Size

func (m *SwapAmountOutRoute) Size() (n int)

func (*SwapAmountOutRoute) String

func (m *SwapAmountOutRoute) String() string

func (*SwapAmountOutRoute) Unmarshal

func (m *SwapAmountOutRoute) Unmarshal(dAtA []byte) error

func (*SwapAmountOutRoute) XXX_DiscardUnknown

func (m *SwapAmountOutRoute) XXX_DiscardUnknown()

func (*SwapAmountOutRoute) XXX_Marshal

func (m *SwapAmountOutRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SwapAmountOutRoute) XXX_Merge

func (m *SwapAmountOutRoute) XXX_Merge(src proto.Message)

func (*SwapAmountOutRoute) XXX_Size

func (m *SwapAmountOutRoute) XXX_Size() int

func (*SwapAmountOutRoute) XXX_Unmarshal

func (m *SwapAmountOutRoute) XXX_Unmarshal(b []byte) error

type SwapAmountOutRoutes

type SwapAmountOutRoutes []SwapAmountOutRoute

func (SwapAmountOutRoutes) IntermediateDenoms

func (routes SwapAmountOutRoutes) IntermediateDenoms() []string

func (SwapAmountOutRoutes) Length

func (routes SwapAmountOutRoutes) Length() int

func (SwapAmountOutRoutes) PoolIds

func (routes SwapAmountOutRoutes) PoolIds() []uint64

func (SwapAmountOutRoutes) Validate

func (routes SwapAmountOutRoutes) Validate() error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreatePool

func (*UnimplementedMsgServer) ExitPool

func (*UnimplementedMsgServer) FeedMultipleExternalLiquidity added in v0.12.0

func (*UnimplementedMsgServer) JoinPool

func (*UnimplementedMsgServer) SwapExactAmountIn

func (*UnimplementedMsgServer) SwapExactAmountOut

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) DenomLiquidity

func (*UnimplementedQueryServer) DenomLiquidityAll

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) Pool

func (*UnimplementedQueryServer) PoolAll

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL