constants

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const PoolInitCodeHash = "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54"

Variables

View Source
var (
	FactoryAddress = common.HexToAddress("0x1F98431c8aD98523631AE4a59f267346ea31F984")
	AddressZero    = common.HexToAddress("0x0000000000000000000000000000000000000000")
)
View Source
var (
	Fees     = []FeeAmount{FeeLow, FeeMedium, FeeHigh}
	FeesInt  = []int{int(FeeLow), int(FeeMedium), int(FeeHigh)}
	FeePairs = make([]FeePair, 0)
)
View Source
var (
	NegativeOne = big.NewInt(-1)
	Zero        = big.NewInt(0)
	One         = big.NewInt(1)

	// used in liquidity amount math
	Q96  = new(big.Int).Exp(big.NewInt(2), big.NewInt(96), nil)
	Q192 = new(big.Int).Exp(Q96, big.NewInt(2), nil)

	PercentZero = entities.NewFraction(big.NewInt(0), big.NewInt(1))
)
View Source
var TickSpacings = map[FeeAmount]int{
	FeeLowest: 1,
	FeeLow:    10,
	FeeMedium: 60,
	FeeHigh:   200,
}

The default factory tick spacings by fee amount.

Functions

func GetFeePermutations

func GetFeePermutations(n int) (result [][]int, err error)

func Permutations added in v0.1.5

func Permutations(L []int, r int) [][]int

Types

type FeeAmount

type FeeAmount uint64

The default factory enabled fee amounts, denominated in hundredths of bips.

const (
	FeeLowest FeeAmount = 100
	FeeLow    FeeAmount = 500
	FeeMedium FeeAmount = 3000
	FeeHigh   FeeAmount = 10000

	FeeMax FeeAmount = 1000000
)

type FeePair

type FeePair struct {
	Fee0 FeeAmount
	Fee1 FeeAmount
}

Jump to

Keyboard shortcuts

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