Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StateVarEventTypeToName = map[EventType]string{ EventTypeAuctionUnknown: "unknown", EventTypeMarketEnactment: "market-enacted", EventTypeOpeningAuctionFirstUncrossingPrice: "opening-auction-first-uncrossing-price", EventTypeAuctionEnded: "auction-ended", EventTypeTimeTrigger: "time-trigger", EventTypeMarketUpdated: "market-updated", }
Functions ¶
func ValueFromProto ¶
func ValueFromProto(val *vega.StateVarValue) (value, error)
ValueFromProto converts the proto into a value.
Types ¶
type Converter ¶
type Converter interface { BundleToInterface(*KeyValueBundle) StateVariableResult InterfaceToBundle(StateVariableResult) *KeyValueBundle }
type DecimalMatrix ¶
func (*DecimalMatrix) Equals ¶
func (dm *DecimalMatrix) Equals(other value) bool
Equals returns true of the other value is a matrix of floating point values with the same shape and equals values.
func (*DecimalMatrix) ToProto ¶
func (dm *DecimalMatrix) ToProto() *vega.StateVarValue
ToProto converts the state variable value to protobuf.
func (*DecimalMatrix) WithinTolerance ¶
func (dm *DecimalMatrix) WithinTolerance(other value, tolerance num.Decimal) bool
WithinTolerance returns true if the other value is a matrix and has the same shape and values in the same index are within the given tolerance of each other.
type DecimalScalar ¶
DecimalScalar is a scalar floating point value.
func (*DecimalScalar) Equals ¶
func (dv *DecimalScalar) Equals(other value) bool
Equals returns true of the other value is a scalar floating point with equals value.
func (*DecimalScalar) ToProto ¶
func (dv *DecimalScalar) ToProto() *vega.StateVarValue
ToProto converts the state variable value to protobuf.
func (*DecimalScalar) WithinTolerance ¶
func (dv *DecimalScalar) WithinTolerance(other value, tolerance num.Decimal) bool
WithinTolerance returns true if the other value is a scalar value and is equal to this scalar value within the given tolerance.
type DecimalVector ¶
func (*DecimalVector) Equals ¶
func (dv *DecimalVector) Equals(other value) bool
Equals returns true of the other value is a vector of floating point values with the same shape and equals values.
func (*DecimalVector) ToProto ¶
func (dv *DecimalVector) ToProto() *vega.StateVarValue
ToProto converts the state variable value to protobuf.
func (*DecimalVector) WithinTolerance ¶
func (dv *DecimalVector) WithinTolerance(other value, tolerance num.Decimal) bool
WithinTolerance returns true if the other value is a vector and has the same shape and values in the same index are within the given tolerance of each other.
type EventType ¶ added in v0.55.0
type EventType int
EventType enumeration for supported events triggering calculation.
type FinaliseCalculation ¶
type FinaliseCalculation interface {
CalculationFinished(string, StateVariableResult, error)
}
type KeyValueBundle ¶
type KeyValueBundle struct {
KVT []KeyValueTol
}
KeyValueBundle is a slice of key value and their expected tolerances.
func KeyValueBundleFromProto ¶
func KeyValueBundleFromProto(protoKVT []*vega.KeyValueBundle) (*KeyValueBundle, error)
KeyValueBundleFromProto converts from proto into KeyValueBundle.
func (*KeyValueBundle) Equals ¶
func (kvb *KeyValueBundle) Equals(other *KeyValueBundle) bool
Equals returns true of the two bundles have the same keys in the same order and the values in the same index are equal.
func (*KeyValueBundle) ToProto ¶
func (kvb *KeyValueBundle) ToProto() []*vega.KeyValueBundle
ToProto converts KevValueBundle into proto.
func (*KeyValueBundle) WithinTolerance ¶
func (kvb *KeyValueBundle) WithinTolerance(other *KeyValueBundle) bool
WithinTolerance returns true if the two bundles have the same keys, same tolerances and the values at the same index are with the tolerance of each other.
type KeyValueTol ¶
type StateVariableResult ¶
type StateVariableResult interface{}