The target aggregator for the TWAP.
Ending unix timestamp to collect values up to
OptionalendingExecute the task to get the ending unix timestamp
Minimum number of samples in the history to calculate a valid result
Period, in seconds, the twap should account for
Weight samples by their propagation time
Converts this TwapTask to JSON.
JSON object
StaticcreateStaticdecodeDecodes a TwapTask message from the specified reader or buffer.
Reader or buffer to decode from
Optionallength: numberMessage length if known beforehand
TwapTask
StaticdecodeDecodes a TwapTask message from the specified reader or buffer, length delimited.
Reader or buffer to decode from
TwapTask
StaticencodeEncodes the specified TwapTask message. Does not implicitly {@apilink oracle_job.OracleJob.TwapTask.verify|verify} messages.
TwapTask message or plain object to encode
Optionalwriter: WriterWriter to encode to
Writer
StaticencodeEncodes the specified TwapTask message, length delimited. Does not implicitly {@apilink oracle_job.OracleJob.TwapTask.verify|verify} messages.
TwapTask message or plain object to encode
Optionalwriter: WriterWriter to encode to
Writer
StaticfromCreates a TwapTask message from a plain object. Also converts values to their respective internal types.
Plain object
TwapTask
StaticgetGets the default type url for TwapTask
OptionaltypeUrlPrefix: stringyour custom typeUrlPrefix(default "type.googleapis.com")
The default type url
StatictoCreates a plain object from a TwapTask message. Also converts values to other types if specified.
TwapTask
Optionaloptions: IConversionOptionsConversion options
Plain object
StaticverifyVerifies a TwapTask message.
Plain object to verify
null if valid, otherwise the reason why it is not
Takes a twap over a set period for a certain aggregator. Aggregators have an optional history buffer account storing the last N accepted results. The TwapTask will iterate over an aggregators history buffer and calculate the time weighted average of the samples within a given time period.
Input: None
Returns: The time weighted average of an aggregator over a given time period.
Example: The 1hr Twap of the SOL/USD Aggregator, requiring at least 60 samples.