Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterMsgCreatorServer(s grpc1.Server, srv MsgCreatorServer)
- type MsgCreateConcentratedPool
- func (msg MsgCreateConcentratedPool) CreatePool(ctx sdk.Context, poolID uint64) (poolmanagertypes.PoolI, error)
- func (*MsgCreateConcentratedPool) Descriptor() ([]byte, []int)
- func (m *MsgCreateConcentratedPool) GetDenom0() string
- func (m *MsgCreateConcentratedPool) GetDenom1() string
- func (msg MsgCreateConcentratedPool) GetPoolType() poolmanagertypes.PoolType
- func (m *MsgCreateConcentratedPool) GetSender() string
- func (msg MsgCreateConcentratedPool) GetSignBytes() []byte
- func (msg MsgCreateConcentratedPool) GetSigners() []sdk.AccAddress
- func (m *MsgCreateConcentratedPool) GetTickSpacing() uint64
- func (msg MsgCreateConcentratedPool) InitialLiquidity() sdk.Coins
- func (m *MsgCreateConcentratedPool) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateConcentratedPool) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateConcentratedPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (msg MsgCreateConcentratedPool) PoolCreator() sdk.AccAddress
- func (*MsgCreateConcentratedPool) ProtoMessage()
- func (m *MsgCreateConcentratedPool) Reset()
- func (msg MsgCreateConcentratedPool) Route() string
- func (m *MsgCreateConcentratedPool) Size() (n int)
- func (m *MsgCreateConcentratedPool) String() string
- func (msg MsgCreateConcentratedPool) Type() string
- func (m *MsgCreateConcentratedPool) Unmarshal(dAtA []byte) error
- func (msg MsgCreateConcentratedPool) Validate(ctx sdk.Context) error
- func (msg MsgCreateConcentratedPool) ValidateBasic() error
- func (m *MsgCreateConcentratedPool) XXX_DiscardUnknown()
- func (m *MsgCreateConcentratedPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateConcentratedPool) XXX_Merge(src proto.Message)
- func (m *MsgCreateConcentratedPool) XXX_Size() int
- func (m *MsgCreateConcentratedPool) XXX_Unmarshal(b []byte) error
- type MsgCreateConcentratedPoolResponse
- func (*MsgCreateConcentratedPoolResponse) Descriptor() ([]byte, []int)
- func (m *MsgCreateConcentratedPoolResponse) GetPoolID() uint64
- func (m *MsgCreateConcentratedPoolResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgCreateConcentratedPoolResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgCreateConcentratedPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgCreateConcentratedPoolResponse) ProtoMessage()
- func (m *MsgCreateConcentratedPoolResponse) Reset()
- func (m *MsgCreateConcentratedPoolResponse) Size() (n int)
- func (m *MsgCreateConcentratedPoolResponse) String() string
- func (m *MsgCreateConcentratedPoolResponse) Unmarshal(dAtA []byte) error
- func (m *MsgCreateConcentratedPoolResponse) XXX_DiscardUnknown()
- func (m *MsgCreateConcentratedPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgCreateConcentratedPoolResponse) XXX_Merge(src proto.Message)
- func (m *MsgCreateConcentratedPoolResponse) XXX_Size() int
- func (m *MsgCreateConcentratedPoolResponse) XXX_Unmarshal(b []byte) error
- type MsgCreatorClient
- type MsgCreatorServer
- type Pool
- func (p *Pool) ApplySwap(newLiquidity sdk.Dec, newCurrentTick sdk.Int, newCurrentSqrtPrice sdk.Dec) error
- func (p Pool) CalcActualAmounts(ctx sdk.Context, lowerTick, upperTick int64, liquidityDelta sdk.Dec) (actualAmountDenom0 sdk.Dec, actualAmountDenom1 sdk.Dec, err error)
- func (*Pool) Descriptor() ([]byte, []int)
- func (p Pool) GetAddress() sdk.AccAddress
- func (p Pool) GetCurrentSqrtPrice() sdk.Dec
- func (p Pool) GetCurrentTick() sdk.Int
- func (p Pool) GetExponentAtPriceOne() sdk.Int
- func (p Pool) GetId() uint64
- func (p Pool) GetIncentivesAddress() sdk.AccAddress
- func (p Pool) GetLastLiquidityUpdate() time.Time
- func (p Pool) GetLiquidity() sdk.Dec
- func (p Pool) GetSwapFee(ctx sdk.Context) sdk.Dec
- func (p Pool) GetTickSpacing() uint64
- func (p Pool) GetToken0() string
- func (p Pool) GetToken1() string
- func (p Pool) GetType() poolmanagertypes.PoolType
- func (p Pool) IsActive(ctx sdk.Context) bool
- func (p Pool) IsCurrentTickInRange(lowerTick, upperTick int64) bool
- func (m *Pool) Marshal() (dAtA []byte, err error)
- func (m *Pool) MarshalTo(dAtA []byte) (int, error)
- func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Pool) ProtoMessage()
- func (m *Pool) Reset()
- func (p *Pool) SetCurrentSqrtPrice(newSqrtPrice sdk.Dec)
- func (p *Pool) SetCurrentTick(newTick sdk.Int)
- func (p *Pool) SetLastLiquidityUpdate(newTime time.Time)
- func (p *Pool) SetTickSpacing(tickSpacing uint64)
- func (m *Pool) Size() (n int)
- func (p Pool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom string) (sdk.Dec, error)
- func (p Pool) String() string
- func (m *Pool) Unmarshal(dAtA []byte) error
- func (p *Pool) UpdateLiquidity(newLiquidity sdk.Dec)
- func (p *Pool) UpdateLiquidityIfActivePosition(ctx sdk.Context, lowerTick, upperTick int64, liquidityDelta sdk.Dec) bool
- func (m *Pool) XXX_DiscardUnknown()
- func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Pool) XXX_Merge(src proto.Message)
- func (m *Pool) XXX_Size() int
- func (m *Pool) XXX_Unmarshal(b []byte) error
- type Position
- func (*Position) Descriptor() ([]byte, []int)
- func (m *Position) GetAddress() string
- func (m *Position) GetJoinTime() time.Time
- func (m *Position) GetLowerTick() int64
- func (m *Position) GetPoolId() uint64
- func (m *Position) GetPositionId() uint64
- func (m *Position) GetUpperTick() int64
- func (m *Position) Marshal() (dAtA []byte, err error)
- func (m *Position) MarshalTo(dAtA []byte) (int, error)
- func (m *Position) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Position) ProtoMessage()
- func (m *Position) Reset()
- func (m *Position) Size() (n int)
- func (m *Position) String() string
- func (m *Position) Unmarshal(dAtA []byte) error
- func (m *Position) XXX_DiscardUnknown()
- func (m *Position) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Position) XXX_Merge(src proto.Message)
- func (m *Position) XXX_Size() int
- func (m *Position) XXX_Unmarshal(b []byte) error
- type PositionWithUnderlyingAssetBreakdown
- func (*PositionWithUnderlyingAssetBreakdown) Descriptor() ([]byte, []int)
- func (m *PositionWithUnderlyingAssetBreakdown) GetAsset0() types1.Coin
- func (m *PositionWithUnderlyingAssetBreakdown) GetAsset1() types1.Coin
- func (m *PositionWithUnderlyingAssetBreakdown) GetPosition() Position
- func (m *PositionWithUnderlyingAssetBreakdown) Marshal() (dAtA []byte, err error)
- func (m *PositionWithUnderlyingAssetBreakdown) MarshalTo(dAtA []byte) (int, error)
- func (m *PositionWithUnderlyingAssetBreakdown) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PositionWithUnderlyingAssetBreakdown) ProtoMessage()
- func (m *PositionWithUnderlyingAssetBreakdown) Reset()
- func (m *PositionWithUnderlyingAssetBreakdown) Size() (n int)
- func (m *PositionWithUnderlyingAssetBreakdown) String() string
- func (m *PositionWithUnderlyingAssetBreakdown) Unmarshal(dAtA []byte) error
- func (m *PositionWithUnderlyingAssetBreakdown) XXX_DiscardUnknown()
- func (m *PositionWithUnderlyingAssetBreakdown) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PositionWithUnderlyingAssetBreakdown) XXX_Merge(src proto.Message)
- func (m *PositionWithUnderlyingAssetBreakdown) XXX_Size() int
- func (m *PositionWithUnderlyingAssetBreakdown) XXX_Unmarshal(b []byte) error
- type TickInfo
- func (*TickInfo) Descriptor() ([]byte, []int)
- func (m *TickInfo) GetFeeGrowthOppositeDirectionOfLastTraversal() github_com_cosmos_cosmos_sdk_types.DecCoins
- func (m *TickInfo) GetUptimeTrackers() []UptimeTracker
- func (m *TickInfo) Marshal() (dAtA []byte, err error)
- func (m *TickInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *TickInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TickInfo) ProtoMessage()
- func (m *TickInfo) Reset()
- func (m *TickInfo) Size() (n int)
- func (m *TickInfo) String() string
- func (m *TickInfo) Unmarshal(dAtA []byte) error
- func (m *TickInfo) XXX_DiscardUnknown()
- func (m *TickInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TickInfo) XXX_Merge(src proto.Message)
- func (m *TickInfo) XXX_Size() int
- func (m *TickInfo) XXX_Unmarshal(b []byte) error
- type UnimplementedMsgCreatorServer
- type UptimeTracker
- func (*UptimeTracker) Descriptor() ([]byte, []int)
- func (m *UptimeTracker) GetUptimeGrowthOutside() github_com_cosmos_cosmos_sdk_types.DecCoins
- func (m *UptimeTracker) Marshal() (dAtA []byte, err error)
- func (m *UptimeTracker) MarshalTo(dAtA []byte) (int, error)
- func (m *UptimeTracker) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UptimeTracker) ProtoMessage()
- func (m *UptimeTracker) Reset()
- func (m *UptimeTracker) Size() (n int)
- func (m *UptimeTracker) String() string
- func (m *UptimeTracker) Unmarshal(dAtA []byte) error
- func (m *UptimeTracker) XXX_DiscardUnknown()
- func (m *UptimeTracker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UptimeTracker) XXX_Merge(src proto.Message)
- func (m *UptimeTracker) XXX_Size() int
- func (m *UptimeTracker) XXX_Unmarshal(b []byte) error
Constants ¶
const (
TypeMsgCreateConcentratedPool = "create_concentrated_pool"
)
constants.
Variables ¶
var ( ErrInvalidLengthPool = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPool = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPool = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthPosition = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPosition = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPosition = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTickInfo = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTickInfo = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTickInfo = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var (
ModuleCdc = codec.NewAminoCodec(amino)
)
TODO: re-enable this when CL state-breakage PR is merged. return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
Functions ¶
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterMsgCreatorServer ¶
func RegisterMsgCreatorServer(s grpc1.Server, srv MsgCreatorServer)
Types ¶
type MsgCreateConcentratedPool ¶
type MsgCreateConcentratedPool struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"` Denom0 string `protobuf:"bytes,2,opt,name=denom0,proto3" json:"denom0,omitempty" yaml:"denom0"` Denom1 string `protobuf:"bytes,3,opt,name=denom1,proto3" json:"denom1,omitempty" yaml:"denom1"` TickSpacing uint64 `protobuf:"varint,4,opt,name=tick_spacing,json=tickSpacing,proto3" json:"tick_spacing,omitempty" yaml:"tick_spacing"` SwapFee github_com_cosmos_cosmos_sdk_types.Dec `` /* 138-byte string literal not displayed */ }
===================== MsgCreateConcentratedPool
func NewMsgCreateConcentratedPool ¶
func NewMsgCreateConcentratedPool( sender sdk.AccAddress, denom0 string, denom1 string, tickSpacing uint64, swapFee sdk.Dec, ) MsgCreateConcentratedPool
func (MsgCreateConcentratedPool) CreatePool ¶
func (msg MsgCreateConcentratedPool) CreatePool(ctx sdk.Context, poolID uint64) (poolmanagertypes.PoolI, error)
func (*MsgCreateConcentratedPool) Descriptor ¶
func (*MsgCreateConcentratedPool) Descriptor() ([]byte, []int)
func (*MsgCreateConcentratedPool) GetDenom0 ¶
func (m *MsgCreateConcentratedPool) GetDenom0() string
func (*MsgCreateConcentratedPool) GetDenom1 ¶
func (m *MsgCreateConcentratedPool) GetDenom1() string
func (MsgCreateConcentratedPool) GetPoolType ¶
func (msg MsgCreateConcentratedPool) GetPoolType() poolmanagertypes.PoolType
func (*MsgCreateConcentratedPool) GetSender ¶
func (m *MsgCreateConcentratedPool) GetSender() string
func (MsgCreateConcentratedPool) GetSignBytes ¶
func (msg MsgCreateConcentratedPool) GetSignBytes() []byte
func (MsgCreateConcentratedPool) GetSigners ¶
func (msg MsgCreateConcentratedPool) GetSigners() []sdk.AccAddress
func (*MsgCreateConcentratedPool) GetTickSpacing ¶
func (m *MsgCreateConcentratedPool) GetTickSpacing() uint64
func (MsgCreateConcentratedPool) InitialLiquidity ¶
func (msg MsgCreateConcentratedPool) InitialLiquidity() sdk.Coins
func (*MsgCreateConcentratedPool) Marshal ¶
func (m *MsgCreateConcentratedPool) Marshal() (dAtA []byte, err error)
func (*MsgCreateConcentratedPool) MarshalTo ¶
func (m *MsgCreateConcentratedPool) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateConcentratedPool) MarshalToSizedBuffer ¶
func (m *MsgCreateConcentratedPool) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (MsgCreateConcentratedPool) PoolCreator ¶
func (msg MsgCreateConcentratedPool) PoolCreator() sdk.AccAddress
func (*MsgCreateConcentratedPool) ProtoMessage ¶
func (*MsgCreateConcentratedPool) ProtoMessage()
func (*MsgCreateConcentratedPool) Reset ¶
func (m *MsgCreateConcentratedPool) Reset()
func (MsgCreateConcentratedPool) Route ¶
func (msg MsgCreateConcentratedPool) Route() string
func (*MsgCreateConcentratedPool) Size ¶
func (m *MsgCreateConcentratedPool) Size() (n int)
func (*MsgCreateConcentratedPool) String ¶
func (m *MsgCreateConcentratedPool) String() string
func (MsgCreateConcentratedPool) Type ¶
func (msg MsgCreateConcentratedPool) Type() string
func (*MsgCreateConcentratedPool) Unmarshal ¶
func (m *MsgCreateConcentratedPool) Unmarshal(dAtA []byte) error
func (MsgCreateConcentratedPool) Validate ¶
func (msg MsgCreateConcentratedPool) Validate(ctx sdk.Context) error
func (MsgCreateConcentratedPool) ValidateBasic ¶
func (msg MsgCreateConcentratedPool) ValidateBasic() error
func (*MsgCreateConcentratedPool) XXX_DiscardUnknown ¶
func (m *MsgCreateConcentratedPool) XXX_DiscardUnknown()
func (*MsgCreateConcentratedPool) XXX_Marshal ¶
func (m *MsgCreateConcentratedPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateConcentratedPool) XXX_Merge ¶
func (m *MsgCreateConcentratedPool) XXX_Merge(src proto.Message)
func (*MsgCreateConcentratedPool) XXX_Size ¶
func (m *MsgCreateConcentratedPool) XXX_Size() int
func (*MsgCreateConcentratedPool) XXX_Unmarshal ¶
func (m *MsgCreateConcentratedPool) XXX_Unmarshal(b []byte) error
type MsgCreateConcentratedPoolResponse ¶
type MsgCreateConcentratedPoolResponse struct {
PoolID uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"`
}
Returns a unique poolID to identify the pool with.
func (*MsgCreateConcentratedPoolResponse) Descriptor ¶
func (*MsgCreateConcentratedPoolResponse) Descriptor() ([]byte, []int)
func (*MsgCreateConcentratedPoolResponse) GetPoolID ¶
func (m *MsgCreateConcentratedPoolResponse) GetPoolID() uint64
func (*MsgCreateConcentratedPoolResponse) Marshal ¶
func (m *MsgCreateConcentratedPoolResponse) Marshal() (dAtA []byte, err error)
func (*MsgCreateConcentratedPoolResponse) MarshalTo ¶
func (m *MsgCreateConcentratedPoolResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgCreateConcentratedPoolResponse) MarshalToSizedBuffer ¶
func (m *MsgCreateConcentratedPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgCreateConcentratedPoolResponse) ProtoMessage ¶
func (*MsgCreateConcentratedPoolResponse) ProtoMessage()
func (*MsgCreateConcentratedPoolResponse) Reset ¶
func (m *MsgCreateConcentratedPoolResponse) Reset()
func (*MsgCreateConcentratedPoolResponse) Size ¶
func (m *MsgCreateConcentratedPoolResponse) Size() (n int)
func (*MsgCreateConcentratedPoolResponse) String ¶
func (m *MsgCreateConcentratedPoolResponse) String() string
func (*MsgCreateConcentratedPoolResponse) Unmarshal ¶
func (m *MsgCreateConcentratedPoolResponse) Unmarshal(dAtA []byte) error
func (*MsgCreateConcentratedPoolResponse) XXX_DiscardUnknown ¶
func (m *MsgCreateConcentratedPoolResponse) XXX_DiscardUnknown()
func (*MsgCreateConcentratedPoolResponse) XXX_Marshal ¶
func (m *MsgCreateConcentratedPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgCreateConcentratedPoolResponse) XXX_Merge ¶
func (m *MsgCreateConcentratedPoolResponse) XXX_Merge(src proto.Message)
func (*MsgCreateConcentratedPoolResponse) XXX_Size ¶
func (m *MsgCreateConcentratedPoolResponse) XXX_Size() int
func (*MsgCreateConcentratedPoolResponse) XXX_Unmarshal ¶
func (m *MsgCreateConcentratedPoolResponse) XXX_Unmarshal(b []byte) error
type MsgCreatorClient ¶
type MsgCreatorClient interface {
CreateConcentratedPool(ctx context.Context, in *MsgCreateConcentratedPool, opts ...grpc.CallOption) (*MsgCreateConcentratedPoolResponse, error)
}
MsgCreatorClient is the client API for MsgCreator service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgCreatorClient ¶
func NewMsgCreatorClient(cc grpc1.ClientConn) MsgCreatorClient
type MsgCreatorServer ¶
type MsgCreatorServer interface {
CreateConcentratedPool(context.Context, *MsgCreateConcentratedPool) (*MsgCreateConcentratedPoolResponse, error)
}
MsgCreatorServer is the server API for MsgCreator service.
type Pool ¶
type Pool struct { // pool's address holding all liquidity tokens. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` // address holding the incentives liquidity. IncentivesAddress string `` /* 138-byte string literal not displayed */ Id uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` // Amount of total liquidity CurrentTickLiquidity github_com_cosmos_cosmos_sdk_types.Dec `` /* 193-byte string literal not displayed */ Token0 string `protobuf:"bytes,5,opt,name=token0,proto3" json:"token0,omitempty"` Token1 string `protobuf:"bytes,6,opt,name=token1,proto3" json:"token1,omitempty"` CurrentSqrtPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */ CurrentTick github_com_cosmos_cosmos_sdk_types.Int `` /* 154-byte string literal not displayed */ // tick_spacing must be one of the authorized_tick_spacing values set in the // concentrated-liquidity parameters TickSpacing uint64 `protobuf:"varint,9,opt,name=tick_spacing,json=tickSpacing,proto3" json:"tick_spacing,omitempty" yaml:"tick_spacing"` ExponentAtPriceOne github_com_cosmos_cosmos_sdk_types.Int `` /* 189-byte string literal not displayed */ // swap_fee is the ratio that is charged on the amount of token in. SwapFee github_com_cosmos_cosmos_sdk_types.Dec `` /* 139-byte string literal not displayed */ // last_liquidity_update is the last time either the pool liquidity or the // active tick changed LastLiquidityUpdate time.Time `` /* 148-byte string literal not displayed */ }
func NewConcentratedLiquidityPool ¶
func NewConcentratedLiquidityPool(poolId uint64, denom0, denom1 string, tickSpacing uint64, swapFee sdk.Dec) (Pool, error)
NewConcentratedLiquidityPool creates a new ConcentratedLiquidity pool with the specified parameters. The two provided denoms are ordered so that denom0 is lexicographically smaller than denom1.
func (*Pool) ApplySwap ¶
func (p *Pool) ApplySwap(newLiquidity sdk.Dec, newCurrentTick sdk.Int, newCurrentSqrtPrice sdk.Dec) error
ApplySwap state of pool after swap. It specifically overwrites the pool's liquidity, curr tick and the curr sqrt price
func (Pool) CalcActualAmounts ¶
func (p Pool) CalcActualAmounts(ctx sdk.Context, lowerTick, upperTick int64, liquidityDelta sdk.Dec) (actualAmountDenom0 sdk.Dec, actualAmountDenom1 sdk.Dec, err error)
calcActualAmounts calculates and returns actual amounts based on where the current tick is located relative to position's lower and upper ticks. There are 3 possible cases: -The position is active ( lowerTick <= p.CurrentTick < upperTick).
- The provided liquidity is distributed in both tokens.
- Actual amounts might differ from desired because we recalculate them from liquidity delta and sqrt price.
- Current tick is below the position ( p.CurrentTick < lowerTick).
- The provided liquidity is distributed in token0 only.
- Current tick is above the position ( p.CurrentTick >= p.upperTick ).
- The provided liquidity is distributed in token1 only.
Note, that liquidityDelta can be positive or negative but cannot be zero. If zero, an error is returned. If positive, we assume, liquidity being added. As a result, we round up so that we request a user to add more liquidity in favor of the pool. If negative, we assume, liquidity being removed. As a result, we round down so that we request a user to remove less liquidity in favor of the pool.
func (*Pool) Descriptor ¶
func (Pool) GetAddress ¶
func (p Pool) GetAddress() sdk.AccAddress
GetAddress returns the address of the concentrated liquidity pool
func (Pool) GetCurrentSqrtPrice ¶
GetCurrentSqrtPrice returns the current sqrt price of the pool
func (Pool) GetCurrentTick ¶
GetCurrentTick returns the current tick of the pool
func (Pool) GetExponentAtPriceOne ¶
GetExponentAtPriceOne returns the precision factor at price one of the pool
func (Pool) GetIncentivesAddress ¶
func (p Pool) GetIncentivesAddress() sdk.AccAddress
GetIncentivesAddress returns the address storing incentives of the concentrated liquidity pool.
func (Pool) GetLastLiquidityUpdate ¶
GetLastLiquidityUpdate returns the last time there was a change in pool liquidity or active tick.
func (Pool) GetLiquidity ¶
GetLiquidity returns the liquidity of the pool
func (Pool) GetSwapFee ¶
GetSwapFee returns the swap fee of the pool
func (Pool) GetTickSpacing ¶
GetTickSpacing returns the current tick spacing parameter of the pool
func (Pool) GetType ¶
func (p Pool) GetType() poolmanagertypes.PoolType
func (Pool) IsCurrentTickInRange ¶ added in v15.5.0
isCurrentTickInRange returns true if pool's current tick is within the range of the lower and upper ticks. False otherwise.
func (*Pool) ProtoMessage ¶
func (*Pool) ProtoMessage()
func (*Pool) SetCurrentSqrtPrice ¶
SetCurrentSqrtPrice updates the current sqrt price of the pool when the first position is created.
func (*Pool) SetCurrentTick ¶
SetCurrentTick updates the current tick of the pool when the first position is created.
func (*Pool) SetLastLiquidityUpdate ¶
SetLastLiquidityUpdate updates the pool's LastLiquidityUpdate to newTime.
func (*Pool) SetTickSpacing ¶ added in v15.5.0
SetTickSpacing updates the tick spacing parameter of the pool.
func (Pool) SpotPrice ¶
func (p Pool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom string) (sdk.Dec, error)
SpotPrice returns the spot price of the pool. If base asset is the Token0 of the pool, we use the current sqrt price of the pool. If not, we calculate the inverse of the current sqrt price of the pool.
func (*Pool) UpdateLiquidity ¶
UpdateLiquidity updates the liquidity of the pool. Note that this method is mutative.
func (*Pool) UpdateLiquidityIfActivePosition ¶
func (p *Pool) UpdateLiquidityIfActivePosition(ctx sdk.Context, lowerTick, upperTick int64, liquidityDelta sdk.Dec) bool
updateLiquidityIfActivePosition updates the pool's liquidity if the position is active. Returns true if updated, false otherwise.
func (*Pool) XXX_DiscardUnknown ¶
func (m *Pool) XXX_DiscardUnknown()
func (*Pool) XXX_Unmarshal ¶
type Position ¶
type Position struct { PositionId uint64 `protobuf:"varint,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty" yaml:"position_id"` Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` PoolId uint64 `protobuf:"varint,3,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` LowerTick int64 `protobuf:"varint,4,opt,name=lower_tick,json=lowerTick,proto3" json:"lower_tick,omitempty"` UpperTick int64 `protobuf:"varint,5,opt,name=upper_tick,json=upperTick,proto3" json:"upper_tick,omitempty"` JoinTime time.Time `protobuf:"bytes,6,opt,name=join_time,json=joinTime,proto3,stdtime" json:"join_time" yaml:"join_time"` Liquidity github_com_cosmos_cosmos_sdk_types.Dec `` /* 128-byte string literal not displayed */ }
Position contains position's id, address, pool id, lower tick, upper tick join time, and liquidity.
func (*Position) Descriptor ¶
func (*Position) GetAddress ¶
func (*Position) GetJoinTime ¶
func (*Position) GetLowerTick ¶
func (*Position) GetPositionId ¶
func (*Position) GetUpperTick ¶
func (*Position) MarshalToSizedBuffer ¶
func (*Position) ProtoMessage ¶
func (*Position) ProtoMessage()
func (*Position) XXX_DiscardUnknown ¶
func (m *Position) XXX_DiscardUnknown()
func (*Position) XXX_Marshal ¶
func (*Position) XXX_Unmarshal ¶
type PositionWithUnderlyingAssetBreakdown ¶
type PositionWithUnderlyingAssetBreakdown struct { Position Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position"` Asset0 types1.Coin `protobuf:"bytes,2,opt,name=asset0,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"asset0"` Asset1 types1.Coin `protobuf:"bytes,3,opt,name=asset1,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"asset1"` }
func (*PositionWithUnderlyingAssetBreakdown) Descriptor ¶
func (*PositionWithUnderlyingAssetBreakdown) Descriptor() ([]byte, []int)
func (*PositionWithUnderlyingAssetBreakdown) GetAsset0 ¶ added in v15.5.0
func (m *PositionWithUnderlyingAssetBreakdown) GetAsset0() types1.Coin
func (*PositionWithUnderlyingAssetBreakdown) GetAsset1 ¶ added in v15.5.0
func (m *PositionWithUnderlyingAssetBreakdown) GetAsset1() types1.Coin
func (*PositionWithUnderlyingAssetBreakdown) GetPosition ¶
func (m *PositionWithUnderlyingAssetBreakdown) GetPosition() Position
func (*PositionWithUnderlyingAssetBreakdown) Marshal ¶
func (m *PositionWithUnderlyingAssetBreakdown) Marshal() (dAtA []byte, err error)
func (*PositionWithUnderlyingAssetBreakdown) MarshalTo ¶
func (m *PositionWithUnderlyingAssetBreakdown) MarshalTo(dAtA []byte) (int, error)
func (*PositionWithUnderlyingAssetBreakdown) MarshalToSizedBuffer ¶
func (m *PositionWithUnderlyingAssetBreakdown) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PositionWithUnderlyingAssetBreakdown) ProtoMessage ¶
func (*PositionWithUnderlyingAssetBreakdown) ProtoMessage()
func (*PositionWithUnderlyingAssetBreakdown) Reset ¶
func (m *PositionWithUnderlyingAssetBreakdown) Reset()
func (*PositionWithUnderlyingAssetBreakdown) Size ¶
func (m *PositionWithUnderlyingAssetBreakdown) Size() (n int)
func (*PositionWithUnderlyingAssetBreakdown) String ¶
func (m *PositionWithUnderlyingAssetBreakdown) String() string
func (*PositionWithUnderlyingAssetBreakdown) Unmarshal ¶
func (m *PositionWithUnderlyingAssetBreakdown) Unmarshal(dAtA []byte) error
func (*PositionWithUnderlyingAssetBreakdown) XXX_DiscardUnknown ¶
func (m *PositionWithUnderlyingAssetBreakdown) XXX_DiscardUnknown()
func (*PositionWithUnderlyingAssetBreakdown) XXX_Marshal ¶
func (m *PositionWithUnderlyingAssetBreakdown) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PositionWithUnderlyingAssetBreakdown) XXX_Merge ¶
func (m *PositionWithUnderlyingAssetBreakdown) XXX_Merge(src proto.Message)
func (*PositionWithUnderlyingAssetBreakdown) XXX_Size ¶
func (m *PositionWithUnderlyingAssetBreakdown) XXX_Size() int
func (*PositionWithUnderlyingAssetBreakdown) XXX_Unmarshal ¶
func (m *PositionWithUnderlyingAssetBreakdown) XXX_Unmarshal(b []byte) error
type TickInfo ¶
type TickInfo struct { LiquidityGross github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */ LiquidityNet github_com_cosmos_cosmos_sdk_types.Dec `` /* 158-byte string literal not displayed */ // Total fees accumulated in the opposite direction that the tick was last // crossed. i.e. if the current tick is to the right of this tick (meaning its // currently a greater price), then this is the total fees accumulated below // the tick. If the current tick is to the left of this tick (meaning its // currently at a lower price), then this is the total fees accumulated above // the tick. // // Note: the way this value is used depends on the direction of fees we are // calculating for. If we are calculating fees below the lower tick and the // lower tick is the active tick, then this is the feeGrowthGlobal - the // lower tick's feeGrowthOppositeDirectionOfLastTraversal. If we are // calculating fees above the upper tick and the upper tick is the active // tick, then this is just the tick's // feeGrowthOppositeDirectionOfLastTraversal value. FeeGrowthOppositeDirectionOfLastTraversal github_com_cosmos_cosmos_sdk_types.DecCoins `` /* 241-byte string literal not displayed */ UptimeTrackers []UptimeTracker `protobuf:"bytes,4,rep,name=uptime_trackers,json=uptimeTrackers,proto3" json:"uptime_trackers" yaml:"uptime_trackers"` }
func (*TickInfo) Descriptor ¶
func (*TickInfo) GetFeeGrowthOppositeDirectionOfLastTraversal ¶ added in v15.5.0
func (m *TickInfo) GetFeeGrowthOppositeDirectionOfLastTraversal() github_com_cosmos_cosmos_sdk_types.DecCoins
func (*TickInfo) GetUptimeTrackers ¶
func (m *TickInfo) GetUptimeTrackers() []UptimeTracker
func (*TickInfo) MarshalToSizedBuffer ¶
func (*TickInfo) ProtoMessage ¶
func (*TickInfo) ProtoMessage()
func (*TickInfo) XXX_DiscardUnknown ¶
func (m *TickInfo) XXX_DiscardUnknown()
func (*TickInfo) XXX_Marshal ¶
func (*TickInfo) XXX_Unmarshal ¶
type UnimplementedMsgCreatorServer ¶
type UnimplementedMsgCreatorServer struct { }
UnimplementedMsgCreatorServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgCreatorServer) CreateConcentratedPool ¶
func (*UnimplementedMsgCreatorServer) CreateConcentratedPool(ctx context.Context, req *MsgCreateConcentratedPool) (*MsgCreateConcentratedPoolResponse, error)
type UptimeTracker ¶
type UptimeTracker struct {
UptimeGrowthOutside github_com_cosmos_cosmos_sdk_types.DecCoins `` /* 167-byte string literal not displayed */
}
func (*UptimeTracker) Descriptor ¶
func (*UptimeTracker) Descriptor() ([]byte, []int)
func (*UptimeTracker) GetUptimeGrowthOutside ¶
func (m *UptimeTracker) GetUptimeGrowthOutside() github_com_cosmos_cosmos_sdk_types.DecCoins
func (*UptimeTracker) Marshal ¶
func (m *UptimeTracker) Marshal() (dAtA []byte, err error)
func (*UptimeTracker) MarshalToSizedBuffer ¶
func (m *UptimeTracker) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*UptimeTracker) ProtoMessage ¶
func (*UptimeTracker) ProtoMessage()
func (*UptimeTracker) Reset ¶
func (m *UptimeTracker) Reset()
func (*UptimeTracker) Size ¶
func (m *UptimeTracker) Size() (n int)
func (*UptimeTracker) String ¶
func (m *UptimeTracker) String() string
func (*UptimeTracker) Unmarshal ¶
func (m *UptimeTracker) Unmarshal(dAtA []byte) error
func (*UptimeTracker) XXX_DiscardUnknown ¶
func (m *UptimeTracker) XXX_DiscardUnknown()
func (*UptimeTracker) XXX_Marshal ¶
func (m *UptimeTracker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UptimeTracker) XXX_Merge ¶
func (m *UptimeTracker) XXX_Merge(src proto.Message)
func (*UptimeTracker) XXX_Size ¶
func (m *UptimeTracker) XXX_Size() int
func (*UptimeTracker) XXX_Unmarshal ¶
func (m *UptimeTracker) XXX_Unmarshal(b []byte) error