Documentation ¶
Index ¶
- Variables
- type ConcentratedCurrentTickAndBucketMismatchError
- type ConcentratedCurrentTickNotWithinBucketError
- type ConcentratedNoLiquidityError
- type ConcentratedNotEnoughLiquidityToCompleteSwapError
- type ConcentratedPoolNoTickModelError
- type ConcentratedTickModelNotSetError
- type ConcentratedZeroCurrentSqrtPriceError
- type DenomPair
- type FailedToCastPoolModelError
- type InvalidPoolTypeError
- type LiquidityDepthsWithRange
- type PoolI
- type PoolNotFoundError
- type PoolWrapper
- func (p *PoolWrapper) GetId() uint64
- func (p *PoolWrapper) GetPoolDenoms() []string
- func (p *PoolWrapper) GetSQSPoolModel() SQSPool
- func (p *PoolWrapper) GetTickModel() (*TickModel, error)
- func (p *PoolWrapper) GetTotalValueLockedUOSMO() osmomath.Int
- func (p *PoolWrapper) GetType() poolmanagertypes.PoolType
- func (p *PoolWrapper) GetUnderlyingPool() poolmanagertypes.PoolI
- func (p *PoolWrapper) SetTickModel(tickModel *TickModel) error
- func (p *PoolWrapper) Validate(minUOSMOTVL osmomath.Int) error
- type Quote
- type RoutablePool
- type RoutableResultPool
- type Route
- type RouterConfig
- type SQSPool
- type SplitRoute
- type StaleHeightError
- type TakerFeeMap
- func (tfm TakerFeeMap) GetTakerFee(denom0, denom1 string) (osmomath.Dec, error)
- func (tfm TakerFeeMap) Has(denom0, denom1 string) bool
- func (tfm TakerFeeMap) MarshalJSON() ([]byte, error)
- func (tfm TakerFeeMap) SetTakerFee(denom0, denom1 string, takerFee osmomath.Dec)
- func (tfm TakerFeeMap) UnmarshalJSON(data []byte) error
- type TakerFeeNotFoundForDenomPairError
- type TickModel
- type Token
- type TokensUsecase
- type TransmuterInsufficientBalanceError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInternalServerError will throw if any the Internal Server Error happen ErrInternalServerError = errors.New("internal Server Error") // ErrNotFound will throw if the requested item is not exists ErrNotFound = errors.New("your requested Item is not found") // ErrConflict will throw if the current action already exists ErrConflict = errors.New("your Item already exist") // ErrBadParamInput will throw if the given request-body or params is not valid ErrBadParamInput = errors.New("given Param is not valid") )
var DefaultTakerFee = osmomath.MustNewDecFromStr("0.001000000000000000")
Functions ¶
This section is empty.
Types ¶
type ConcentratedCurrentTickAndBucketMismatchError ¶
type ConcentratedCurrentTickAndBucketMismatchError struct { CurrentTick int64 LowerTick int64 UpperTick int64 }
func (ConcentratedCurrentTickAndBucketMismatchError) Error ¶
func (e ConcentratedCurrentTickAndBucketMismatchError) Error() string
type ConcentratedCurrentTickNotWithinBucketError ¶
type ConcentratedCurrentTickNotWithinBucketError struct { PoolId uint64 CurrentBucketIndex int64 TotalBuckets int64 }
func (ConcentratedCurrentTickNotWithinBucketError) Error ¶
func (e ConcentratedCurrentTickNotWithinBucketError) Error() string
type ConcentratedNoLiquidityError ¶
type ConcentratedNoLiquidityError struct {
PoolId uint64
}
func (ConcentratedNoLiquidityError) Error ¶
func (e ConcentratedNoLiquidityError) Error() string
type ConcentratedNotEnoughLiquidityToCompleteSwapError ¶
func (ConcentratedNotEnoughLiquidityToCompleteSwapError) Error ¶
func (e ConcentratedNotEnoughLiquidityToCompleteSwapError) Error() string
type ConcentratedPoolNoTickModelError ¶
type ConcentratedPoolNoTickModelError struct {
PoolId uint64
}
func (ConcentratedPoolNoTickModelError) Error ¶
func (e ConcentratedPoolNoTickModelError) Error() string
type ConcentratedTickModelNotSetError ¶
type ConcentratedTickModelNotSetError struct {
PoolId uint64
}
func (ConcentratedTickModelNotSetError) Error ¶
func (e ConcentratedTickModelNotSetError) Error() string
type ConcentratedZeroCurrentSqrtPriceError ¶
type ConcentratedZeroCurrentSqrtPriceError struct {
PoolId uint64
}
func (ConcentratedZeroCurrentSqrtPriceError) Error ¶
func (e ConcentratedZeroCurrentSqrtPriceError) Error() string
type DenomPair ¶
DenomPair encapsulates a pair of denoms. The order of the denoms ius that Denom0 precedes Denom1 lexicographically.
type FailedToCastPoolModelError ¶
func (FailedToCastPoolModelError) Error ¶
func (e FailedToCastPoolModelError) Error() string
type InvalidPoolTypeError ¶
type InvalidPoolTypeError struct {
PoolType int32
}
InvalidPoolTypeError is an error type for invalid pool type.
func (InvalidPoolTypeError) Error ¶
func (e InvalidPoolTypeError) Error() string
type LiquidityDepthsWithRange ¶
type LiquidityDepthsWithRange = clqueryproto.LiquidityDepthWithRange
type PoolI ¶
type PoolI interface { // GetId returns the ID of the pool. GetId() uint64 // GetType returns the type of the pool (Balancer, Stableswap, Concentrated, etc.) GetType() poolmanagertypes.PoolType GetTotalValueLockedUOSMO() osmomath.Int GetPoolDenoms() []string GetUnderlyingPool() poolmanagertypes.PoolI GetSQSPoolModel() SQSPool // GetTickModel returns the tick model for the pool // If this is a concentrated pool. Errors otherwise // Also errors if this is a concentrated pool but // the tick model is not set GetTickModel() (*TickModel, error) // SetTickModel sets the tick model for the pool // If this is not a concentrated pool, errors SetTickModel(*TickModel) error // Validate validates the pool // Returns nil if the pool is valid // Returns error if the pool is invalid Validate(minUOSMOTVL osmomath.Int) error }
PoolI represents a generalized Pool interface.
type PoolNotFoundError ¶
type PoolNotFoundError struct {
PoolID uint64
}
func (PoolNotFoundError) Error ¶
func (e PoolNotFoundError) Error() string
type PoolWrapper ¶
type PoolWrapper struct { ChainModel poolmanagertypes.PoolI `json:"underlying_pool"` SQSModel SQSPool `json:"sqs_model"` TickModel *TickModel `json:"tick_model,omitempty"` }
func (*PoolWrapper) GetPoolDenoms ¶
func (p *PoolWrapper) GetPoolDenoms() []string
GetPoolDenoms implements PoolI.
func (*PoolWrapper) GetSQSPoolModel ¶
func (p *PoolWrapper) GetSQSPoolModel() SQSPool
GetSQSPoolModel implements PoolI.
func (*PoolWrapper) GetTickModel ¶
func (p *PoolWrapper) GetTickModel() (*TickModel, error)
GetTickModel implements PoolI.
func (*PoolWrapper) GetTotalValueLockedUOSMO ¶
func (p *PoolWrapper) GetTotalValueLockedUOSMO() osmomath.Int
GetTotalValueLockedUOSMO implements PoolI.
func (*PoolWrapper) GetType ¶
func (p *PoolWrapper) GetType() poolmanagertypes.PoolType
GetType implements PoolI.
func (*PoolWrapper) GetUnderlyingPool ¶
func (p *PoolWrapper) GetUnderlyingPool() poolmanagertypes.PoolI
GetUnderlyingPool implements PoolI.
func (*PoolWrapper) SetTickModel ¶
func (p *PoolWrapper) SetTickModel(tickModel *TickModel) error
SetTickModel implements PoolI.
type Quote ¶
type Quote interface { GetAmountIn() sdk.Coin GetAmountOut() osmomath.Int GetRoute() []SplitRoute GetEffectiveSpreadFactor() osmomath.Dec // PrepareResult mutates the quote to prepare // it with the data formatted for output to the client. PrepareResult() ([]SplitRoute, osmomath.Dec) String() string }
type RoutablePool ¶
type RoutablePool interface { GetId() uint64 GetType() poolmanagertypes.PoolType GetPoolDenoms() []string GetTokenOutDenom() string CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (sdk.Coin, error) ChargeTakerFeeExactIn(tokenIn sdk.Coin) (tokenInAfterFee sdk.Coin) // SetTokenOutDenom sets the token out denom on the routable pool. SetTokenOutDenom(tokenOutDenom string) GetTakerFee() osmomath.Dec GetSpreadFactor() osmomath.Dec String() string }
type RoutableResultPool ¶
type RoutableResultPool interface { RoutablePool GetBalances() sdk.Coins }
type Route ¶
type Route interface { GetPools() []RoutablePool // AddPool adds pool to route. AddPool(pool PoolI, tokenOut string, takerFee osmomath.Dec) // CalculateTokenOutByTokenIn calculates the token out amount given the token in amount. // Returns error if the calculation fails. CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (sdk.Coin, error) GetTokenOutDenom() string // PrepareResultPools strips away unnecessary fields // from each pool in the route, // leaving only the data needed by client // Note that it mutates the route. // Returns the resulting pools. PrepareResultPools() []RoutablePool String() string }
type RouterConfig ¶
type RouterConfig struct { PreferredPoolIDs []uint64 `mapstructure:"preferred_pool_ids"` MaxPoolsPerRoute int `mapstructure:"max_pools_per_route"` MaxRoutes int `mapstructure:"max_routes"` MaxSplitRoutes int `mapstructure:"max_split_routes"` MaxSplitIterations int `mapstructure:"max_split_iterations"` // Denominated in OSMO (not uosmo) MinOSMOLiquidity int `mapstructure:"min_osmo_liquidity"` RouteUpdateHeightInterval int `mapstructure:"route_update_height_interval"` RouteCacheEnabled bool `mapstructure:"route_cache_enabled"` }
type SQSPool ¶
type SQSPool struct { TotalValueLockedUSDC osmomath.Int `json:"total_value_locked_uosmo"` TotalValueLockedError string `json:"total_value_locked_error,omitempty"` // Only CL and Cosmwasm pools need balances appended Balances sdk.Coins `json:"balances"` PoolDenoms []string `json:"pool_denoms"` SpreadFactor osmomath.Dec `json:"spread_factor"` }
type SplitRoute ¶
type StaleHeightError ¶
type StaleHeightError struct { StoredHeight uint64 TimeSinceLastUpdate int MaxAllowedTimeDeltaSecs int }
func (StaleHeightError) Error ¶
func (e StaleHeightError) Error() string
type TakerFeeMap ¶
TakerFeeMap is a map of DenomPair to taker fee. It sorts the denoms lexicographically before looking up the taker fee.
func (TakerFeeMap) GetTakerFee ¶
func (tfm TakerFeeMap) GetTakerFee(denom0, denom1 string) (osmomath.Dec, error)
GetTakerFee returns the taker fee for the given denoms. It sorts the denoms lexicographically before looking up the taker fee. Returns error if the taker fee is not found.
func (TakerFeeMap) Has ¶
func (tfm TakerFeeMap) Has(denom0, denom1 string) bool
Has returns true if the taker fee for the given denoms is found. It sorts the denoms lexicographically before looking up the taker fee.
func (TakerFeeMap) MarshalJSON ¶
func (tfm TakerFeeMap) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (TakerFeeMap) SetTakerFee ¶
func (tfm TakerFeeMap) SetTakerFee(denom0, denom1 string, takerFee osmomath.Dec)
SetTakerFee sets the taker fee for the given denoms. It sorts the denoms lexicographically before setting the taker fee.
func (TakerFeeMap) UnmarshalJSON ¶
func (tfm TakerFeeMap) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type TakerFeeNotFoundForDenomPairError ¶
func (TakerFeeNotFoundForDenomPairError) Error ¶
func (e TakerFeeNotFoundForDenomPairError) Error() string
type TickModel ¶
type TickModel struct { Ticks []LiquidityDepthsWithRange `json:"ticks,omitempty"` CurrentTickIndex int64 `json:"current_tick_index,omitempty"` HasNoLiquidity bool `json:"has_no_liquidity,omitempty"` }
type Token ¶
type Token struct { // ChainDenom is the denom used in the chain state. ChainDenom string `json:"chain_denom"` // HumanDenom is the human readable denom. HumanDenom string `json:"human_denom"` // Precision is the precision of the token. Precision int `json:"precision"` }
Token represents the token's domain model
type TokensUsecase ¶
Tokens represent the token's usecases
type TransmuterInsufficientBalanceError ¶
func (TransmuterInsufficientBalanceError) Error ¶
func (e TransmuterInsufficientBalanceError) Error() string