Documentation ¶
Index ¶
- Constants
- func FindGoodTradePath(maxPathLen uint, poolPairStates map[string]*jsonresult.Pdexv3PoolPairState, ...) ([]*jsonresult.Pdexv3PoolPair, []string, uint64)
- func TradePathFromState(sellToken common.Hash, tradePath []string, ...) ([]*jsonresult.Pdexv3PoolPair, []v2.OrderBookIterator, []byte, error)
- type Node
- type Order
- type OrderBook
- type PriceCalculator
- type SimplePoolNodeData
Constants ¶
View Source
const ( MaxPaths = 5 BaseAmplifier = 10000 )
View Source
const (
TradeDirectionSell0 = iota
)
Variables ¶
This section is empty.
Functions ¶
func FindGoodTradePath ¶
func FindGoodTradePath( maxPathLen uint, poolPairStates map[string]*jsonresult.Pdexv3PoolPairState, tokenIDStrSource string, tokenIDStrDest string, originalSellAmount uint64, ) ([]*jsonresult.Pdexv3PoolPair, []string, uint64)
FindGoodTradePath attempts to find a good enough trading path for the given trading pair, selling amount, and pool pairs.
func TradePathFromState ¶
func TradePathFromState( sellToken common.Hash, tradePath []string, pairs map[string]*jsonresult.Pdexv3PoolPairState, ) ( []*jsonresult.Pdexv3PoolPair, []v2.OrderBookIterator, []byte, error, )
Types ¶
type Order ¶
type Order = jsonresult.Pdexv3Order
type OrderBook ¶
type OrderBook struct {
// contains filtered or unexported fields
}
func NewOrderBook ¶
func NewOrderBook(tmpOrder jsonresult.Pdexv3Orderbook) OrderBook
func (*OrderBook) InsertOrder ¶
InsertOrder appends a new order while keeping the list sorted (ascending by Token1Rate / Token0Rate)
func (OrderBook) MarshalJSON ¶
func (*OrderBook) NextOrder ¶
NextOrder returns the matchable order with the best rate that has any outstanding balance to sell
func (*OrderBook) RemoveOrder ¶
RemoveOrder removes one order by its index
func (*OrderBook) UnmarshalJSON ¶
type PriceCalculator ¶
Click to show internal directories.
Click to hide internal directories.