types

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset interface {
	Address() string
}

func NewAsset

func NewAsset(address string) Asset

type Pool

type Pool interface {
	Quoter
	Address() string
	PoolType() SuiPoolType
	CoinA() string
	CoinB() string
}

type PoolCache

type PoolCache struct {
	// contains filtered or unexported fields
}

func NewPoolCache

func NewPoolCache(expireSec uint64) *PoolCache

func (*PoolCache) GetPoolCache

func (c *PoolCache) GetPoolCache() []Pool

func (*PoolCache) SetPoolsCache

func (c *PoolCache) SetPoolsCache(pools []Pool)

type Provider

type Provider interface {
	Pools(ctx context.Context) ([]Pool, error)
}

type Quoter

type Quoter interface {
	GetAmountOut(pool Pool, inAsset Asset, outAsset Asset, inAmount *big.Int) (*big.Int, error)
}

type SuiPoolType

type SuiPoolType int
const (
	PoolTypeCetus SuiPoolType = iota
	PoolTypeDeepBook
)

type Trade

type Trade interface {
	Path() []Asset
	Pools() []Pool
	AmountOuts() []*big.Int
	A2B() []bool
}

Jump to

Keyboard shortcuts

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