Skip to main content
Version: pre-release (v0.79)

data_source.proto

path vega/data_source.proto

package vega


Messages

DataSourceDefinition

Represents the top level object that handles data sources. Data source definition can be external or internal, with whatever number of data sources are defined for each type in the child objects below.

NameTypeDescription
internalDataSourceDefinitionInternal
externalDataSourceDefinitionExternal

DataSourceDefinitionExternal

DataSourceDefinitionExternal is the top level object used for all external data sources. It contains one of any of the defined `SourceType` variants.

NameTypeDescription
oracleDataSourceSpecConfiguration
eth_oracleEthCallSpecContains the data specification that is received from Ethereum sources.

DataSourceDefinitionInternal

Top level object used for all internal data sources. It contains one of any of the defined source type variants.

NameTypeDescription
timeDataSourceSpecConfigurationTime
time_triggerDataSourceSpecConfigurationTimeTrigger

DataSourceSpec

Data source spec describes the data source base that a product or a risk model wants to get from the data source engine. This message contains additional information used by the API.

NameTypeDescription
idstringHash generated from the DataSpec data.
created_atint64Creation date and time
updated_atint64Last Updated timestamp
dataDataSourceDefinition
statusDataSourceSpec.StatusStatus describes the status of the data source spec

DataSourceSpecConfiguration

All types of external data sources use the same configuration set for meeting requirements in order for the data to be useful for Vega - valid signatures and matching filters.

NameTypeDescription
signersrepeated data.v1.SignerSigners is the list of authorized signatures that signed the data for this source. All the signatures in the data source data should be contained in this external source. All the signatures in the data should be contained in this list.
filtersrepeated data.v1.FilterFilters describes which source data are considered of interest or not for the product (or the risk model).

DataSourceSpecConfigurationTime

Internal data source used for emitting timestamps.

NameTypeDescription
conditionsrepeated data.v1.ConditionConditions that the timestamps should meet in order to be considered.

DataSourceSpecConfigurationTimeTrigger

Internal data source used for emitting timestamps automatically using predefined intervals and conditions.

NameTypeDescription
conditionsrepeated data.v1.ConditionConditions that the timestamps need to meet in order to be considered.
triggersrepeated data.v1.InternalTimeTriggerAn internal time trigger

EthCallSpec

Specifies a data source that derives its content from calling a read method on an Ethereum contract.

NameTypeDescription
addressstringEthereum address of the contract to call.
abistringThe ABI of that contract.
methodstringName of the method on the contract to call.
argsrepeated google.protobuf.ValueList of arguments to pass to method call. Protobuf 'Value' wraps an arbitrary JSON type that is mapped to an Ethereum type according to the ABI.
triggerEthCallTriggerConditions for determining when to call the contract method.
required_confirmationsuint64Number of confirmations required before the query is considered verified
filtersrepeated data.v1.FilterFilters the data returned from the contract method
normalisersrepeated NormaliserNormalisers are used to convert the data returned from the contract method into a standard format. The key of the map is the name of the property, which identifies the specific piece of data to other parts of the data sourcing framework, for example filters. The value is a JSONPath expression for expressing where in the contract call result the required data is located, for example $[0] indicates the first result. $[1].price would look in the second result returned from the contract for a structure with a key called 'price' and use that if it exists.
source_chain_iduint64The ID of the EVM based chain which is to be used to source the oracle data.

EthCallTrigger

Determines when the contract method should be called.

NameTypeDescription
time_triggerEthTimeTrigger

EthTimeTrigger

Trigger for an Ethereum call based on the Ethereum block timestamp. Can be one-off or repeating.

NameTypeDescription
initialoptional uint64Trigger when the Ethereum time is greater or equal to this time, in Unix seconds.
everyoptional uint64Repeat the call every n seconds after the initial call. If no time for initial call was specified, begin repeating immediately.
untiloptional uint64If repeating, stop once Ethereum time is greater than this time, in Unix seconds. If not set, then repeat indefinitely.

ExternalDataSourceSpec

NameTypeDescription
specDataSourceSpec

Normaliser

NameTypeDescription
namestring
expressionstring

SpecBindingForCompositePrice

Describes which property of the data source data is to be used for price source.

NameTypeDescription
price_source_propertystringThe property name of price.

Enums

DataSourceSpec.Status

Status describe the status of the data source spec

NameNumberDescription
STATUS_UNSPECIFIED0Default value.
STATUS_ACTIVE1STATUS_ACTIVE describes an active data source spec.
STATUS_DEACTIVATED2STATUS_DEACTIVATED describes a data source spec that is not listening to data anymore.