Skip to main content

Data Module

This module is used to construct the data in term of dataclass to make sure that all the inputs and outputs follow this data schema.

Although there are Protobuf classes, some types do not exists. Therefore, additional types of data will be declared here.

note

Note that base and quote is the first and the second price symbols respectively e.g. BTC/USD price rate has a base of BTC and a quote of USD.

The dataclasses declaration are as follows:

from dataclasses import dataclass


@dataclass
class ReferencePriceUpdated(object):
base: int
quote: int


@dataclass
class ReferencePrice(object):
pair: str
rate: float
updated_at: ReferencePriceUpdated

ReferencePriceUpdated

AttributeTypeDescription
baseintegerBase resolve time
quoteintegerQuote resolve time

ReferencePrice

AttributeTypeDescription
pairstringThe token pair e.g. "BTC/USDT"
ratefloatPrice rate
updated_atReferencePriceUpdatedPrice updated time