Skip to content

Commit

Permalink
twap: rename constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Aug 20, 2024
1 parent ebaf3a3 commit a06b63c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/execute_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ var executeOrderCmd = &cobra.Command{
return fmt.Errorf("market %s not found", symbol)
}

executor := twap.NewStreamExecutor(session.Exchange, symbol, market, side, targetQuantity, sliceQuantity)
executor := twap.NewFixedQuantityExecutor(session.Exchange, symbol, market, side, targetQuantity, sliceQuantity)

if updateInterval > 0 {
executor.SetUpdateInterval(updateInterval)
Expand Down
2 changes: 1 addition & 1 deletion pkg/twap/v2/stream_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type FixedQuantityExecutor struct {
done *DoneSignal
}

func NewStreamExecutor(
func NewFixedQuantityExecutor(
exchange types.Exchange,
symbol string,
market types.Market,
Expand Down
2 changes: 1 addition & 1 deletion pkg/twap/v2/stream_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestNewStreamExecutor(t *testing.T) {
}
mockEx.EXPECT().SubmitOrder(gomock.AssignableToTypeOf(ctx), firstSubmitOrder).Return(&firstOrder, nil)

executor := NewStreamExecutor(mockEx, symbol, market, types.SideTypeBuy, targetQuantity, sliceQuantity)
executor := NewFixedQuantityExecutor(mockEx, symbol, market, types.SideTypeBuy, targetQuantity, sliceQuantity)
executor.SetUpdateInterval(200 * time.Millisecond)

go func() {
Expand Down

0 comments on commit a06b63c

Please sign in to comment.