dex

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDex

type IDex interface {
	// SpotPrice returns the spot price of baseToken/quoteToken, it indicates how much of the quote token is needed to purchase one unit of the base token.
	// If middleToken is not empty, it indicates the price of baseToken/middleTokens/quoteToken.
	// Get history spot price by specify blockNumber in call opts , if blockNumber is nil, it will return the latest spot price.
	SpotPrice(opts *bind.CallOpts, baseToken, quoteToken string, middleTokens ...string) (*decimal.Decimal, error)
	// Liquidity returns the liquidity of the pair.
	Liquidity(opts *bind.CallOpts, baseToken, quoteToken string) (*decimal.Decimal, *decimal.Decimal, error)
}

func NewDex

func NewDex(ethClient *ethclient.Client, protocol string, version string, param any) (IDex, error)

Directories

Path Synopsis
backend

Jump to

Keyboard shortcuts

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