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 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

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

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


baseintegerBase resolve time
quoteintegerQuote resolve time


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