timing_matcher

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderHashPrefix          = "matcher_orderhash_"
	OwnerPrefix              = "matcher_owner_"
	RingHashPrefix           = "matcher_ringhash_"
	FailedRingPrefix         = "failed_ring_"
	FailedOrderPrefix        = "failed_order_"
	RinghashToUniqueIdPrefix = "ringhash_uniqid_"
)

orderhash ringhash matchedstate owner tokenS orderhash ringhash orderhash+owner+tokens round orderhash

View Source
const (
	Task_Balancer_Name = "task_balancer_timingmatcher"
)

Variables

This section is empty.

Functions

func AddFailedRingCache

func AddFailedRingCache(uniqueId, txhash common.Hash, orderhashes []common.Hash)

func AddMinedRing

func AddMinedRing(ringState *types.RingSubmitInfo)

添加已经提交了的环路

func CacheRinghashToUniqueId

func CacheRinghashToUniqueId(ringhash, uniqueId common.Hash)

func CachedMatchedRing

func CachedMatchedRing(ringhash common.Hash) (bool, error)

func CachedRinghashes

func CachedRinghashes() ([]common.Hash, error)

func DealtAmount

func DealtAmount(orderhash common.Hash) (dealtAmountS, dealtAmountB *big.Rat, err error)

func FilledAmountS

func FilledAmountS(owner, tokenS common.Address) (filledAmountS *big.Rat, err error)

func GetUniqueIdByRinghash

func GetUniqueIdByRinghash(ringhash common.Hash) (common.Hash, error)

func OrderExecuteFailedCount

func OrderExecuteFailedCount(orderhash common.Hash) (int64, error)

func RemoveMinedRingAndReturnOrderhashes

func RemoveMinedRingAndReturnOrderhashes(ringhash common.Hash) ([]common.Hash, error)

func RingExecuteFailedCount

func RingExecuteFailedCount(uniqueId common.Hash) (int64, error)

Types

type CandidateRing

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

type CandidateRingList

type CandidateRingList []CandidateRing

func (CandidateRingList) Len

func (ringList CandidateRingList) Len() int

func (CandidateRingList) Less

func (ringList CandidateRingList) Less(i, j int) bool

func (CandidateRingList) Swap

func (ringList CandidateRingList) Swap(i, j int)

type ClusterNode

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

type Market

type Market struct {
	TokenA common.Address
	TokenB common.Address

	AtoBOrders *OrdersState
	BtoAOrders *OrdersState
	// contains filtered or unexported fields
}

func NewMarket

func NewMarket(protocolAddress *loopringaccessor.ProtocolAddress, tokenS, tokenB common.Address, matcher *TimingMatcher) *Market

func (*Market) GenerateCandidateRing

func (market *Market) GenerateCandidateRing(orders ...*types.OrderState) (*CandidateRing, error)

type Markets

type Markets []*Market

type NodeInterface

type NodeInterface interface {
	// contains filtered or unexported methods
}

type OrderHashes

type OrderHashes []common.Hash

func (OrderHashes) AddHash

func (hashes OrderHashes) AddHash(hash1 common.Hash)

type OrderMatchedState

type OrderMatchedState struct {
	//ringHash      common.Hash `json:"ringhash"`
	FilledAmountS *types.Rat `json:"filled_amount_s"`
	FilledAmountB *types.Rat `json:"filled_amount_b"`
}

type OrdersState

type OrdersState struct {
	Orders                      map[common.Hash]*types.OrderState
	OrderHashesExcludeNextRound OrderHashes
}

type SingleNode

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

type TimingMatcher

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

func NewTimingMatcher

func NewTimingMatcher(matcherOptions *config.TimingMatcher,
	submitter *miner.RingSubmitter,
	evaluator *miner.Evaluator,
	rds dao.RdsServiceImpl,
	marketcapProvider marketcap.MarketCapProvider,
	kafkaOptions kafka.KafkaOptions,
) *TimingMatcher

func (*TimingMatcher) GetAccountAvailableAmount

func (matcher *TimingMatcher) GetAccountAvailableAmount(address, tokenAddress, spender common.Address) (*big.Rat, error)

func (*TimingMatcher) Start

func (matcher *TimingMatcher) Start()

func (*TimingMatcher) Stop

func (matcher *TimingMatcher) Stop()

Jump to

Keyboard shortcuts

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