Documentation ¶
Overview ¶
nolint
Index ¶
- type MessageGenerator
- func (mg *MessageGenerator) ExpireMessages(height int, timeNow time.Time) (tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, ...)
- func (mg *MessageGenerator) OneOnOneMessages(height int, timeNow time.Time) (tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, ...)
- func (mg MessageGenerator) Publish(height, timePub int64, tradesToPublish []*pub.Trade, ...)
- func (mg *MessageGenerator) Setup()
- func (mg *MessageGenerator) TwoOnOneMessages(height int, timeNow time.Time) (tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageGenerator ¶
type MessageGenerator struct { NumOfTradesPerBlock int NumOfTransferPerBlock int NumOfBlocks int OrderChangeMap orderPkg.OrderInfoForPublish TimeStart time.Time // contains filtered or unexported fields }
func (*MessageGenerator) ExpireMessages ¶
func (mg *MessageGenerator) ExpireMessages(height int, timeNow time.Time) (tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, accounts map[string]pub.Account)
simulate 1 million expire orders to publish at breathe block
func (*MessageGenerator) OneOnOneMessages ¶
func (mg *MessageGenerator) OneOnOneMessages(height int, timeNow time.Time) (tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, accounts map[string]pub.Account, transfers *pub.Transfers)
each trade has two equal quantity order the price is a sin function of time, 4 full sin curve (0 - 2 * pi) within an hour :P
func (MessageGenerator) Publish ¶
func (mg MessageGenerator) Publish(height, timePub int64, tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, orderChangesMap orderPkg.OrderInfoForPublish, accounts map[string]pub.Account, transfers *pub.Transfers, block *pub.Block)
func (*MessageGenerator) Setup ¶
func (mg *MessageGenerator) Setup()
func (*MessageGenerator) TwoOnOneMessages ¶
func (mg *MessageGenerator) TwoOnOneMessages(height int, timeNow time.Time) (tradesToPublish []*pub.Trade, orderChanges orderPkg.OrderChanges, accounts map[string]pub.Account, transfers *pub.Transfers)
each big order eat two small orders
Click to show internal directories.
Click to hide internal directories.