
Data sourcing flow in oracle feeders
Key components
Feeder
A Feeder is a single node in a Distributed Feeder Network that fetches granular market data directly from decentralized exchanges (DEXs), centralized exchanges (CEXs), and third-party data sources. Feeders are responsible for sourcing trade ticks and pushing them to Pods—smart contracts running on DIA’s Lasernet—at configurable intervals (e.g. 30 seconds). There are four main elements that make up a feeder:Scrapers
The expected input for a scraper is a set of pair tickers such asBTC-USDT
. Tickers are always capitalized and symbols separated by a hyphen. It’s the role of the scraper to format the pair ticker such that it can subscribe to the corresponding (websocket) stream.
Collector
The collector gathers trades from all running scrapers. As soon as it receives a signal through a trigger channel it bundles trades in atomic tradesblocks. An atomic tradesblock is a set of trades restricted to one market on one exchange, for instanceBTC-USDT
trades on Binance exchange. These tradesblocks are sent to the Processor
.
Processor
The processor is a 2-step aggregation procedure:1
Step 1
Aggregate trades from an atomic tradesblock. The type of aggregation can be
selected through an environment variable (see Feeder/main). The only
assumption on the aggregation implementation is that it returns a
float64
.2
Step 2
Aggregate filter values obtained in step 1. The selection of aggregation
method and assumptions are identical to Step 1. The obtained scalar value is
sent to the Oracle feeder.