twap

package
v1.64.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoneSignal

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

func NewDoneSignal

func NewDoneSignal() *DoneSignal

func (*DoneSignal) Chan

func (e *DoneSignal) Chan() (c <-chan struct{})

Chan returns a channel that emits a signal when the execution is done.

func (*DoneSignal) Emit

func (e *DoneSignal) Emit()

type FixedQuantityExecutor

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

FixedQuantityExecutor is a TWAP executor that places orders on the exchange using the exchange's stream API. It uses a fixed target quantity to place orders.

func NewFixedQuantityExecutor added in v1.60.1

func NewFixedQuantityExecutor(
	exchange types.Exchange,
	symbol string,
	market types.Market,
	side types.SideType,
	targetQuantity, sliceQuantity fixedpoint.Value,
) *FixedQuantityExecutor

func (*FixedQuantityExecutor) Done

func (e *FixedQuantityExecutor) Done() <-chan struct{}

Done returns a channel that emits a signal when the execution is done.

func (*FixedQuantityExecutor) SetDeadlineTime

func (e *FixedQuantityExecutor) SetDeadlineTime(t time.Time)

func (*FixedQuantityExecutor) SetDelayInterval

func (e *FixedQuantityExecutor) SetDelayInterval(delayInterval time.Duration)

func (*FixedQuantityExecutor) SetNumOfTicks added in v1.60.1

func (e *FixedQuantityExecutor) SetNumOfTicks(numOfTicks int)

func (*FixedQuantityExecutor) SetOrderUpdateRateLimit added in v1.60.1

func (e *FixedQuantityExecutor) SetOrderUpdateRateLimit(rateLimit *rate.Limiter)

func (*FixedQuantityExecutor) SetStopPrice added in v1.60.1

func (e *FixedQuantityExecutor) SetStopPrice(price fixedpoint.Value)

func (*FixedQuantityExecutor) SetUpdateInterval

func (e *FixedQuantityExecutor) SetUpdateInterval(updateInterval time.Duration)

func (*FixedQuantityExecutor) Shutdown

func (e *FixedQuantityExecutor) Shutdown(shutdownCtx context.Context)

Shutdown stops the execution If we call this method, it means the execution is still running, We need it to: 1. Stop the order updater (by using the execution context) 2. The order updater cancels all open orders and closes the user data stream

func (*FixedQuantityExecutor) Start

func (*FixedQuantityExecutor) WaitForConnection

func (e *FixedQuantityExecutor) WaitForConnection(ctx context.Context) error

Jump to

Keyboard shortcuts

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