Documentation
¶
Index ¶
- Constants
- func AverageSizeFillPerMinute(start time.Time, end time.Time, amount decimal.Decimal) decimal.Decimal
- func Execute(t Payload)
- func HandleOrderTask(ctx context.Context, task *asynq.Task) error
- func HandleTwapTask(ctx context.Context, t *asynq.Task) error
- func NewOrderTask(order *order.Submit) (*asynq.Task, error)
- func NewTwapTask(twap Payload) (*asynq.Task, error)
- type Payload
Constants ¶
View Source
const ( TypeTwap = "twap" TypeOrder = "order" )
Variables ¶
This section is empty.
Functions ¶
func AverageSizeFillPerMinute ¶
func AverageSizeFillPerMinute(start time.Time, end time.Time, amount decimal.Decimal) decimal.Decimal
AverageSizeFillPerMinute returns the average size of the order that has to be filled per second to reach the target amount
func Execute ¶
func Execute(t Payload)
Execute executes the TWAP algorithm We can improve the algorithm by using a queue of orders and processing them in a separate goroutine TODO
func HandleTwapTask ¶
HandleTwapTask handles a task for TWAP algorithm.
Types ¶
Click to show internal directories.
Click to hide internal directories.