markets

package
v0.73.7-preview.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instrument

type Instrument struct {
	ID       string
	Code     string
	Name     string
	Metadata *types.InstrumentMetadata
	Product  products.Product

	Quote string
}

Instrument represent an instrument used in a market.

func NewInstrument

func NewInstrument(ctx context.Context, log *logging.Logger, pi *types.Instrument, marketID string, ts common.TimeService, oe products.OracleEngine, broker products.Broker, assetDP uint32) (*Instrument, error)

NewInstrument will instantiate a new instrument using a market framework configuration for a instrument.

func NewInstrumentFromSnapshot added in v0.73.0

func NewInstrumentFromSnapshot(
	ctx context.Context,
	log *logging.Logger,
	pi *types.Instrument,
	marketID string,
	ts common.TimeService,
	oe products.OracleEngine,
	broker products.Broker,
	productState *snapshotpb.Product,
	assetDP uint32,
) (*Instrument, error)

NewInstrument will instantiate a new instrument using a market framework configuration for a instrument.

func (*Instrument) Unsubscribe

func (i *Instrument) Unsubscribe(ctx context.Context)

func (*Instrument) UnsubscribeSettlementData added in v0.58.0

func (i *Instrument) UnsubscribeSettlementData(ctx context.Context)

func (*Instrument) UnsubscribeTradingTerminated added in v0.55.0

func (i *Instrument) UnsubscribeTradingTerminated(ctx context.Context)

func (*Instrument) Update added in v0.73.0

NewInstrument will instantiate a new instrument using a market framework configuration for a instrument.

type TradableInstrument

type TradableInstrument struct {
	Instrument       *Instrument
	MarginCalculator *types.MarginCalculator
	RiskModel        risk.Model
	// contains filtered or unexported fields
}

TradableInstrument represent an instrument to be trade in a market.

func NewTradableInstrument

func NewTradableInstrument(ctx context.Context, log *logging.Logger, pti *types.TradableInstrument, marketID string, ts common.TimeService, oe products.OracleEngine, broker products.Broker, assetDP uint32) (*TradableInstrument, error)

NewTradableInstrument will instantiate a new tradable instrument using a market framework configuration for a tradable instrument.

func NewTradableInstrumentFromSnapshot added in v0.73.0

func NewTradableInstrumentFromSnapshot(
	ctx context.Context,
	log *logging.Logger,
	pti *types.TradableInstrument,
	marketID string,
	ts common.TimeService,
	oe products.OracleEngine,
	broker products.Broker,
	productState *snapshotpb.Product,
	assetDP uint32,
) (*TradableInstrument, error)

NewTradableInstrument will instantiate a new tradable instrument using a market framework configuration for a tradable instrument.

func (*TradableInstrument) UpdateInstrument

func (i *TradableInstrument) UpdateInstrument(ctx context.Context, log *logging.Logger, ti *types.TradableInstrument, marketID string, oe products.OracleEngine, broker products.Broker) error

Jump to

Keyboard shortcuts

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