pathfinder

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseAmplifier = 10000
)
View Source
const (
	MaxPaths = 20
)

Variables

This section is empty.

Functions

func FindGoodTradePath

func FindGoodTradePath(
	maxPathLen uint,
	pools []*shared.Pdexv3PoolPairWithId,
	poolPairStates map[string]*pdex.PoolPairState,
	tokenIDStrSource string,
	tokenIDStrDest string,
	originalSellAmount uint64,
) ([]*shared.Pdexv3PoolPairWithId, uint64)

func FindSellAmount

func FindSellAmount(
	maxPathLen uint,
	pools []*shared.Pdexv3PoolPairWithId,
	poolPairStates map[string]*pdex.PoolPairState,
	tokenIDStrSource string,
	tokenIDStrDest string,
	expectedBuyAmount uint64,
) ([]*shared.Pdexv3PoolPairWithId, uint64)

func GetPdexv3PoolDataFromRawRPCResult

func GetPdexv3PoolDataFromRawRPCResult(message json.RawMessage) ([]*shared.Pdexv3PoolPairWithId, map[string]*pdex.PoolPairState, error)

Types

type Node

type Node struct {
	TokenIDStr     string
	TokenPoolValue *big.Int
}

type PriceCalculator

type PriceCalculator struct {
	Graph map[string][]Node
}

type SimplePoolNodeData

type SimplePoolNodeData struct {
	Token0ID  string
	Token1ID  string
	Token0Liq *big.Int
	Token1Liq *big.Int
}

Jump to

Keyboard shortcuts

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