types

package
v28.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTakerFee = osmomath.MustNewDecFromStr("0.001000000000000000")

Functions

This section is empty.

Types

type ConcentratedPoolNoTickModelError

type ConcentratedPoolNoTickModelError struct {
	PoolId uint64
}

func (ConcentratedPoolNoTickModelError) Error

type DenomPair

type DenomPair struct {
	Denom0 string
	Denom1 string
}

DenomPair encapsulates a pair of denoms.

type LiquidityDepthsWithRange

type LiquidityDepthsWithRange = clqueryproto.LiquidityDepthWithRange

type OrderbookPoolInvalidDirectionError

type OrderbookPoolInvalidDirectionError struct {
	Direction int64
}

func (OrderbookPoolInvalidDirectionError) Error

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

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

PoolI represents a generalized Pool interface.

type PoolWrapper

type PoolWrapper struct {
	ChainModel poolmanagertypes.PoolI                   `json:"underlying_pool"`
	SQSModel   SQSPool                                  `json:"sqs_model"`
	APRData    passthroughdomain.PoolAPRDataStatusWrap  `json:"apr_data,omitempty"`
	FeesData   passthroughdomain.PoolFeesDataStatusWrap `json:"fees_data,omitempty"`
	TickModel  *TickModel                               `json:"tick_model,omitempty"`
}

func NewPool

func NewPool(model poolmanagertypes.PoolI, spreadFactor osmomath.Dec, balances sdk.Coins) *PoolWrapper

func (*PoolWrapper) GetId

func (p *PoolWrapper) GetId() uint64

GetId implements PoolI.

func (*PoolWrapper) GetPoolDenoms

func (p *PoolWrapper) GetPoolDenoms() []string

GetPoolDenoms implements PoolI.

func (*PoolWrapper) GetPoolLiquidityCap

func (p *PoolWrapper) GetPoolLiquidityCap() osmomath.Int

GetPoolLiquidityCap 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) GetType

func (p *PoolWrapper) GetType() poolmanagertypes.PoolType

GetType implements PoolI.

func (*PoolWrapper) GetUnderlyingPool

func (p *PoolWrapper) GetUnderlyingPool() poolmanagertypes.PoolI

GetUnderlyingPool implements PoolI.

type SQSPool

type SQSPool struct {
	PoolLiquidityCap      osmomath.Int `json:"pool_liquidity_cap"`
	PoolLiquidityCapError string       `json:"pool_liquidity_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"`

	// Only CosmWasm pools need CosmWasmPoolModel appended
	CosmWasmPoolModel *cosmwasmpool.CosmWasmPoolModel `json:"cosmwasm_pool_model,omitempty"`
}

type TakerFeeMap

type TakerFeeMap map[DenomPair]osmomath.Dec

TakerFeeMap is a map of DenomPair to taker fee. Sorting is no longer performed since bi-directional taker fee is supported.

func (TakerFeeMap) GetTakerFee

func (tfm TakerFeeMap) GetTakerFee(denom0, denom1 string) osmomath.Dec

GetTakerFee returns the taker fee for the given denoms. Sorting is no longer performed since bi-directional taker fees are stored. 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. Sorting is no longer performed since bi-directional taker fees are stored.

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. Sorting is no longer performed since bi-directional taker fee is supported.

func (TakerFeeMap) UnmarshalJSON

func (tfm TakerFeeMap) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TickModel

type TickModel struct {
	Ticks            []LiquidityDepthsWithRange `json:"ticks,omitempty"`
	CurrentTickIndex int64                      `json:"current_tick_index,omitempty"`
	HasNoLiquidity   bool                       `json:"has_no_liquidity,omitempty"`
}

Directories

Path Synopsis
This package encapsulates the JSON library used by the sidecar query server.
This package encapsulates the JSON library used by the sidecar query server.
proto

Jump to

Keyboard shortcuts

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