Documentation ¶
Index ¶
- Variables
- type Future
- func (f *Future) GetAsset() string
- func (f *Future) IsTradingTerminated() bool
- func (f *Future) NotifyOnSettlementData(listener func(context.Context, *num.Uint))
- func (f *Future) NotifyOnTradingTerminated(listener func(context.Context, bool))
- func (f *Future) ScaleSettlementDataToDecimalPlaces(price *num.Uint, dp uint32) (*num.Uint, error)
- func (f *Future) Settle(entryPriceInAsset *num.Uint, assetDecimals uint32, ...) (amt *types.FinancialAmount, neg bool, err error)
- func (f *Future) Unsubscribe(ctx context.Context)
- func (f *Future) UnsubscribeSettlementData(ctx context.Context)
- func (f *Future) UnsubscribeTradingTerminated(ctx context.Context)
- func (f *Future) Value(markPrice *num.Uint) (*num.Uint, error)
- type OracleEngine
- type Product
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrOracleSpecAndBindingAreRequired is returned when the definition of the // oracle spec or its binding is missing from the future definition. ErrOracleSpecAndBindingAreRequired = errors.New("an oracle spec and an oracle spec binding are required") // ErrOracleSettlementDataeNotSet is returned when the oracle has not set the settlement data. ErrOracleSettlementDataNotSet = errors.New("settlement data is not set") )
View Source
var ( // ErrNilProduct signals the product passed in the constructor was nil. ErrNilProduct = errors.New("nil product") // ErrUnimplementedProduct signal that the product passed to the // constructor was not nil, but the code as no knowledge of it. ErrUnimplementedProduct = errors.New("unimplemented product") )
Functions ¶
This section is empty.
Types ¶
type Future ¶
type Future struct { SettlementAsset string QuoteName string // contains filtered or unexported fields }
Future represent a Future as describe by the market framework.
func (*Future) IsTradingTerminated ¶
IsTradingTerminated - returns true when the oracle has signalled terminated market.
func (*Future) NotifyOnSettlementData ¶ added in v0.58.0
func (*Future) NotifyOnTradingTerminated ¶
func (*Future) ScaleSettlementDataToDecimalPlaces ¶ added in v0.58.0
func (*Future) Settle ¶
func (f *Future) Settle(entryPriceInAsset *num.Uint, assetDecimals uint32, netFractionalPosition num.Decimal) (amt *types.FinancialAmount, neg bool, err error)
Settle a position against the future.
func (*Future) Unsubscribe ¶
func (*Future) UnsubscribeSettlementData ¶ added in v0.58.0
func (*Future) UnsubscribeTradingTerminated ¶ added in v0.55.0
type OracleEngine ¶
type OracleEngine interface { ListensToPubKeys(oracles.OracleData) bool Subscribe(context.Context, oracles.OracleSpec, oracles.OnMatchedOracleData) (oracles.SubscriptionID, oracles.Unsubscriber) Unsubscribe(context.Context, oracles.SubscriptionID) }
OracleEngine ...
type Product ¶
type Product interface { Settle(*num.Uint, uint32, num.Decimal) (amt *types.FinancialAmount, neg bool, err error) Value(markPrice *num.Uint) (*num.Uint, error) GetAsset() string IsTradingTerminated() bool ScaleSettlementDataToDecimalPlaces(price *num.Uint, dp uint32) (*num.Uint, error) NotifyOnTradingTerminated(listener func(context.Context, bool)) NotifyOnSettlementData(listener func(context.Context, *num.Uint)) UnsubscribeTradingTerminated(ctx context.Context) UnsubscribeSettlementData(ctx context.Context) }
Product is the interface provided by all product in vega.
Click to show internal directories.
Click to hide internal directories.