commondomain

package
v25.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper is an interface for getting bank balances.

type BlockPools

type BlockPools struct {
	// ConcentratedPools are the concentrated pools to be ingested.
	ConcentratedPools []poolmanagertypes.PoolI
	// ConcentratedPoolIDTickChange is the map of pool ID to tick change for concentrated pools.
	// We use these pool IDs to append concentrated pools with all ticks at the end of the block.
	ConcentratedPoolIDTickChange map[uint64]struct{}
	// CosmWasmPools are the CosmWasm pools to be ingested.
	CosmWasmPools []poolmanagertypes.PoolI
	// CFMMPools are the CFMM pools to be ingested.
	CFMMPools []poolmanagertypes.PoolI
}

BlockPools contains the pools to be ingested in a block.

func (BlockPools) GetAll

func (bp BlockPools) GetAll() []poolmanagertypes.PoolI

type BlockProcessStrategyManager

type BlockProcessStrategyManager interface {
	// ShouldPushAllData returns true if all data should be pushed.
	ShouldPushAllData() bool

	// MarkInitialDataIngested marks the initial data as ingested.
	// After calling this function, ShouldPushAllData should return false.
	MarkInitialDataIngested()

	// MarkErrorObserved marks that an error has been observed.
	MarkErrorObserved()
}

BlockProcessStrategyManager is an interface for managing the strategy of pushing the blocks. Either all block data or only the block update are the possible options It is initialized with the strategy of pushing all data. If it observes an error, it will switch to pushing all data. If it ingested initial data and observed no error, it will switch to pushing only changed data.

func NewBlockProcessStrategyManager

func NewBlockProcessStrategyManager() BlockProcessStrategyManager

NewBlockProcessStrategyManager creates a new push strategy manager.

type BlockProcessor

type BlockProcessor interface {
	// ProcessBlock processes a block.
	// It returns an error if the block processing fails.
	ProcessBlock(ctx sdk.Context) error

	// IsFullBlockProcessor returns true if the block processor is a full block processor.
	IsFullBlockProcessor() bool
}

BlockProcessor is an interface for processing a block.

type ConcentratedKeeper

type ConcentratedKeeper interface {
	PoolKeeper
	GetTickLiquidityForFullRange(ctx sdk.Context, poolId uint64) ([]queryproto.LiquidityDepthWithRange, int64, error)
	GetConcentratedPoolById(ctx sdk.Context, poolId uint64) (concentratedtypes.ConcentratedPoolExtension, error)
}

ConcentratedKeeper is an interface for the concentrated keeper.

type CosmWasmPoolKeeper

type CosmWasmPoolKeeper interface {
	GetPoolsWithWasmKeeper(ctx sdk.Context) ([]poolmanagertypes.PoolI, error)
}

CosmWasmPoolKeeper is an interface for getting CosmWasm pools from a keeper.

type PoolExtractor

type PoolExtractor interface {
	// ExtractAll extracts all the pools available within the height associated
	// with the context.
	ExtractAll(ctx sdk.Context) (BlockPools, error)
	// ExtractChanged extracts the pools that were changed in the block height associated
	// with the context.
	ExtractChanged(ctx sdk.Context) (BlockPools, error)
}

PoolExtractor defines the interface for extracting pools.

type PoolExtractorKeepers

type PoolExtractorKeepers struct {
	GammKeeper         PoolKeeper
	CosmWasmPoolKeeper CosmWasmPoolKeeper
	WasmKeeper         WasmKeeper
	BankKeeper         BankKeeper
	ProtorevKeeper     ProtorevKeeper
	PoolManagerKeeper  PoolManagerKeeper
	ConcentratedKeeper ConcentratedKeeper
}

Chain keepers required for extracting pool data.

type PoolKeeper

type PoolKeeper interface {
	GetPools(ctx sdk.Context) ([]poolmanagertypes.PoolI, error)
}

PoolKeeper is an interface for getting pools from a keeper.

type PoolManagerKeeper

type PoolManagerKeeper interface {
	RouteCalculateSpotPrice(
		ctx sdk.Context,
		poolId uint64,
		quoteAssetDenom string,
		baseAssetDenom string,
	) (price osmomath.BigDec, err error)

	SwapExactAmountIn(
		ctx sdk.Context,
		sender sdk.AccAddress,
		poolId uint64,
		tokenIn sdk.Coin,
		tokenOutDenom string,
		tokenOutMinAmount osmomath.Int,
	) (tokenOutAmount osmomath.Int, err error)

	RouteGetPoolDenoms(
		ctx sdk.Context,
		poolId uint64,
	) (denoms []string, err error)

	GetTradingPairTakerFee(ctx sdk.Context, denom0, denom1 string) (osmomath.Dec, error)

	MultihopEstimateInGivenExactAmountOut(
		ctx sdk.Context,
		route []poolmanagertypes.SwapAmountOutRoute,
		tokenOut sdk.Coin,
	) (tokenInAmount osmomath.Int, err error)
}

PoolManagerKeeper is an interface for the pool manager keeper.

type ProtorevKeeper

type ProtorevKeeper interface {
	GetPoolForDenomPair(ctx sdk.Context, baseDenom, denomToMatch string) (uint64, error)
}

ProtorevKeeper is an interface for getting the pool for a denom pair.

type WasmKeeper

type WasmKeeper interface {
	QueryRaw(ctx sdk.Context, contractAddress sdk.AccAddress, key []byte) []byte
	QuerySmart(ctx sdk.Context, contractAddress sdk.AccAddress, req []byte) ([]byte, error)
}

WasmKeeper is an interface for querying CosmWasm contract.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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