cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New() *Cache

func (*Cache) Account

func (c *Cache) Account(id model.AccountID) (model.AccountSnapshot, bool)

func (*Cache) AccountHistory

func (c *Cache) AccountHistory(id model.AccountID) []model.AccountSnapshot

func (*Cache) Bar

func (c *Cache) Bar(barType model.BarType) (model.Bar, bool)

func (*Cache) ClearDeferredFillsForOrder

func (c *Cache) ClearDeferredFillsForOrder(accountID model.AccountID, orderID model.OrderID)

func (*Cache) ClosedOrders

func (c *Cache) ClosedOrders(accountID model.AccountID) []model.OrderStatusReport

func (*Cache) ClosedPositions

func (c *Cache) ClosedPositions(accountID model.AccountID) []model.PositionStatusReport

func (*Cache) CustomData

func (c *Cache) CustomData(instrumentID model.InstrumentID, typ string) (model.CustomData, bool)

func (*Cache) DeferredFillsForOrder

func (c *Cache) DeferredFillsForOrder(accountID model.AccountID, orderID model.OrderID) []model.FillReport

func (*Cache) FillByTradeID

func (c *Cache) FillByTradeID(accountID model.AccountID, tradeID model.TradeID) (model.FillReport, bool)

func (*Cache) FillsByVenueOrderID

func (c *Cache) FillsByVenueOrderID(accountID model.AccountID, venueOrderID model.VenueOrderID) []model.FillReport

func (*Cache) FillsForOrder

func (c *Cache) FillsForOrder(accountID model.AccountID, orderID model.OrderID) []model.FillReport

func (*Cache) FundingRate

func (c *Cache) FundingRate(instrumentID model.InstrumentID) (model.FundingRate, bool)

func (*Cache) Instrument

func (c *Cache) Instrument(id model.InstrumentID) (model.Instrument, bool)

func (*Cache) Instruments

func (c *Cache) Instruments() []model.Instrument

func (*Cache) LatestBar

func (c *Cache) LatestBar(instrumentID model.InstrumentID) (model.Bar, bool)

func (*Cache) OpenOrders

func (c *Cache) OpenOrders(accountID model.AccountID) []model.OrderStatusReport

func (*Cache) OpenPositions

func (c *Cache) OpenPositions(accountID model.AccountID) []model.PositionStatusReport

func (*Cache) Order

func (c *Cache) Order(accountID model.AccountID, orderID model.OrderID) (model.OrderStatusReport, bool)

func (*Cache) OrderBook

func (c *Cache) OrderBook(instrumentID model.InstrumentID) (model.OrderBook, bool)

func (*Cache) OrderByClientID

func (c *Cache) OrderByClientID(accountID model.AccountID, clientOrderID model.ClientOrderID) (model.OrderStatusReport, bool)

func (*Cache) OrderByVenueID

func (c *Cache) OrderByVenueID(accountID model.AccountID, venueOrderID model.VenueOrderID) (model.OrderStatusReport, bool)

func (*Cache) Orders

func (c *Cache) Orders(accountID model.AccountID) []model.OrderStatusReport

func (*Cache) OrdersByExecSpawnID

func (c *Cache) OrdersByExecSpawnID(accountID model.AccountID, execSpawnID model.ExecSpawnID) []model.OrderStatusReport

func (*Cache) OrdersByOrderListID

func (c *Cache) OrdersByOrderListID(accountID model.AccountID, orderListID model.OrderListID) []model.OrderStatusReport

func (*Cache) OrdersByPositionID

func (c *Cache) OrdersByPositionID(accountID model.AccountID, positionID model.PositionID) []model.OrderStatusReport

func (*Cache) OrdersByStrategy

func (c *Cache) OrdersByStrategy(accountID model.AccountID, strategyID model.StrategyID) []model.OrderStatusReport

func (*Cache) Position

func (c *Cache) Position(accountID model.AccountID, positionID model.PositionID) (model.PositionStatusReport, bool)

func (*Cache) PositionByInstrument

func (c *Cache) PositionByInstrument(accountID model.AccountID, instrumentID model.InstrumentID) (model.PositionStatusReport, bool)

func (*Cache) PositionByVenueID

func (c *Cache) PositionByVenueID(accountID model.AccountID, venuePositionID model.VenuePositionID) (model.PositionStatusReport, bool)

func (*Cache) Positions

func (c *Cache) Positions(accountID model.AccountID) []model.PositionStatusReport

func (*Cache) PositionsByStrategy

func (c *Cache) PositionsByStrategy(accountID model.AccountID, strategyID model.StrategyID) []model.PositionStatusReport

func (*Cache) PositionsForInstrument

func (c *Cache) PositionsForInstrument(instrumentID model.InstrumentID) []model.PositionStatusReport

func (*Cache) Purge

func (c *Cache) Purge(accountID model.AccountID, policy PurgePolicy) PurgeResult

func (*Cache) PutAccount

func (c *Cache) PutAccount(account model.AccountSnapshot)

func (*Cache) PutDeferredFill

func (c *Cache) PutDeferredFill(fill model.FillReport) (bool, error)

func (*Cache) PutFill

func (c *Cache) PutFill(fill model.FillReport) (bool, error)

func (*Cache) PutInstrument

func (c *Cache) PutInstrument(inst model.Instrument) error

func (*Cache) PutMarketEvent

func (c *Cache) PutMarketEvent(event model.MarketEvent) error

func (*Cache) PutOrder

func (c *Cache) PutOrder(order model.OrderStatusReport) error

func (*Cache) PutPosition

func (c *Cache) PutPosition(position model.PositionStatusReport) error

func (*Cache) PutSyntheticInstrument

func (c *Cache) PutSyntheticInstrument(inst model.SyntheticInstrument) error

func (*Cache) QuoteTick

func (c *Cache) QuoteTick(instrumentID model.InstrumentID) (model.QuoteTick, bool)

func (*Cache) Residuals

func (c *Cache) Residuals(accountID model.AccountID) Residuals

func (*Cache) Snapshot

func (c *Cache) Snapshot(accountID model.AccountID) Snapshot

func (*Cache) SyntheticInstrument

func (c *Cache) SyntheticInstrument(id model.InstrumentID) (model.SyntheticInstrument, bool)

func (*Cache) SyntheticInstruments

func (c *Cache) SyntheticInstruments() []model.SyntheticInstrument

func (*Cache) Ticker

func (c *Cache) Ticker(instrumentID model.InstrumentID) (model.Ticker, bool)

func (*Cache) TradeTick

func (c *Cache) TradeTick(instrumentID model.InstrumentID) (model.TradeTick, bool)

type PurgePolicy

type PurgePolicy struct {
	ClosedOrdersLimit     int
	ClosedPositionsLimit  int
	AccountSnapshotsLimit int
}

type PurgeResult

type PurgeResult struct {
	ClosedOrders     int
	ClosedPositions  int
	AccountSnapshots int
}

type Residuals

type Residuals struct {
	OpenOrders                   int
	OpenPositions                int
	DeferredFills                int
	InconsistentOrderMappings    int
	InconsistentPositionMappings int
}

type Snapshot

type Snapshot struct {
	AccountID       model.AccountID
	Account         model.AccountSnapshot
	AccountHistory  []model.AccountSnapshot
	OpenOrders      []model.OrderStatusReport
	ClosedOrders    []model.OrderStatusReport
	OpenPositions   []model.PositionStatusReport
	ClosedPositions []model.PositionStatusReport
	DeferredFills   []model.FillReport
	Residuals       Residuals
}

Jump to

Keyboard shortcuts

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