stoporders

package
v0.73.0-preview.11 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPriceToOffset   = errors.New("no price to offset")
	ErrStopOrderNotFound = errors.New("stop order not found")
	ErrPriceNotFound     = errors.New("price not found")
	ErrOrderNotFound     = errors.New("order not found")
)

Functions

This section is empty.

Types

type Pool

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

func New

func New(log *logging.Logger) *Pool

func NewFromProto

func NewFromProto(log *logging.Logger, p *v1.StopOrders) *Pool

func (*Pool) Cancel

func (p *Pool) Cancel(
	partyID string,
	orderID string,
) ([]*types.StopOrder, error)

func (*Pool) CountForParty

func (p *Pool) CountForParty(party string) uint64

func (*Pool) GetStopOrderCount

func (p *Pool) GetStopOrderCount() uint64

func (*Pool) Insert

func (p *Pool) Insert(order *types.StopOrder)

func (*Pool) PriceUpdated

func (p *Pool) PriceUpdated(newPrice *num.Uint) (triggered, cancelled []*types.StopOrder)

func (*Pool) RemoveExpired

func (p *Pool) RemoveExpired(orderIDs []string) []*types.StopOrder

func (*Pool) Settled added in v0.72.3

func (p *Pool) Settled() []*types.StopOrder

func (*Pool) ToProto

func (p *Pool) ToProto() *v1.StopOrders

type PricedStopOrders

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

func NewPricedStopOrders

func NewPricedStopOrders() *PricedStopOrders

func NewPricedStopOrdersFromProto

func NewPricedStopOrdersFromProto(p *v1.PricedStopOrders) *PricedStopOrders

func (*PricedStopOrders) DumpFallsBelow

func (p *PricedStopOrders) DumpFallsBelow() string

func (*PricedStopOrders) DumpRisesAbove

func (p *PricedStopOrders) DumpRisesAbove() string

func (*PricedStopOrders) Insert

func (p *PricedStopOrders) Insert(
	id string, price *num.Uint, direction types.StopOrderTriggerDirection,
)

func (*PricedStopOrders) PriceUpdated

func (p *PricedStopOrders) PriceUpdated(newPrice *num.Uint) []string

func (*PricedStopOrders) Remove

func (p *PricedStopOrders) Remove(id string) error

func (*PricedStopOrders) ToProto

func (p *PricedStopOrders) ToProto() *v1.PricedStopOrders

type TrailingStopOrders

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

func NewTrailingStopOrders

func NewTrailingStopOrders() *TrailingStopOrders

func NewTrailingStopOrdersFromProto

func NewTrailingStopOrdersFromProto(p *v1.TrailingStopOrders) *TrailingStopOrders

func (*TrailingStopOrders) DumpFallsBelow

func (p *TrailingStopOrders) DumpFallsBelow() string

func (*TrailingStopOrders) DumpRisesAbove

func (p *TrailingStopOrders) DumpRisesAbove() string

func (*TrailingStopOrders) Insert

func (p *TrailingStopOrders) Insert(
	id string, offset num.Decimal, direction types.StopOrderTriggerDirection,
)

func (*TrailingStopOrders) PriceUpdated

func (p *TrailingStopOrders) PriceUpdated(newPrice *num.Uint) []string

func (*TrailingStopOrders) Remove

func (p *TrailingStopOrders) Remove(id string) error

func (*TrailingStopOrders) ToProto

Jump to

Keyboard shortcuts

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