romanornr / autodealer

Types of function parameters can be combined CRT-A0017
Style
Minor
4 months ago3 years old
func(start time.Time, end time.Time, amount decimal.Decimal) decimal.Decimal could be replaced with func(start, end time.Time, amount decimal.Decimal) decimal.Decimal
83}
84
85// AverageSizeFillPerMinute returns the average size of the order that has to be filled per second to reach the target amount
86func AverageSizeFillPerMinute(start time.Time, end time.Time, amount decimal.Decimal) decimal.Decimal {87	diff := end.Sub(start).Minutes()
88	a := amount.Div(decimal.NewFromFloat(diff)) // average size fill per minute
89	return a