Data Sources

A data source is an external information not present in current events, but is useful in determining whether the event should be alerted or not.

Only data sources explicitly chosen to be injected in the usecase rule can be called.

Accessing data sources in usecase rules

process() function injects dataSource parameter so that it can be called. In order to get specific type of data source, call dataSource.get("<data-source-type>") to access the data source. As in above example, dataSource.get("sanction-list") will provide sanction list methods.

async process({ dataSource }) {
    const cexDataSource = dataSource.get("cex");
    const price = cexDataSource.getTokenPrice("BTCUSDT");
    return {
        isAlert: price > 25000
    }
}

Each data source has different implementation. Following are available data sources and their specific methods:

Contract ReadsToken infoSanction ListCentralized Exchanges (CEX)

Last updated