Data sourcing
Last updated
Last updated
At the heart of Lumina is a decentralized data collection system composed of feeder nodes operating within the Distributed Feeder Network, responsible for sourcing data and feeding it into the Lasernet chain.
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
Collector
Processor
Pods
The expected input for a scraper is a set of pair tickers such as BTC-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.
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 instance BTC-USDT
trades on Binance exchange. These tradesblocks are sent to the Processor
.
The processor is a 2-step aggregation procedure:
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
.
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.
Pods (or feeder contracts) are a simple key-value oracle contracts assigned to each feeder node. They store the value obtained from the Processor. It is worth mentioning that the trigger mechanism for starting a new cycle of the data collection flow can be implemented on-chain using the feeder contract.
Find out more about the feeder structure and how to run your own feeder here.
To encourage honest behavior, oracle feeders will be rewarded for successful operations and penalized for harmful actions. These incentives ensure that dishonest behavior is punished and becomes economically unviable.
Rewards and penalties will primarily be based on uptime and accuracy, measured by the timeliness of updates and the accuracy of prices compared to other feeders. Initially, feeders will gather the last traded price for assets from centralized exchanges (CEXs). For decentralized exchanges (DEXs), we will use trade simulation-based price estimation, which simulates trades to obtain current exchange rates. This approach ensures more accurate pricing, particularly for assets that are infrequently traded.