> ## Documentation Index
> Fetch the complete documentation index at: https://www.diadata.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Feeders (Sourcing Layer)

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.

<Frame caption="Data sourcing flow in oracle feeders">
  <img src="https://mintcdn.com/diadata/qIgjiltsbRJuXYkF/images/reference/architecture/image-1.png?fit=max&auto=format&n=qIgjiltsbRJuXYkF&q=85&s=3223121d2ff3aef2d0c854620967a577" width="2304" height="1233" data-path="images/reference/architecture/image-1.png" />
</Frame>

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

<CardGroup>
  <Card title="Scrapers" icon="square-1" iconType="solid" horizontal href="/dia-stack/architecture/core-components/feeders#scrapers" />

  <Card title="Collector" icon="square-2" iconType="solid" horizontal href="/dia-stack/architecture/core-components/feeders#collector" />

  <Card title="Processor" icon="square-3" iconType="solid" horizontal href="/dia-stack/architecture/core-components/feeders#processor" />

  <Card title="Pods" icon="square-4" iconType="solid" horizontal href="/dia-stack/architecture/core-components/feeders#pods" />
</CardGroup>

#### Scrapers

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.

#### 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 instance `BTC-USDT` trades on Binance exchange. These tradesblocks are sent to the `Processor`.

#### Processor

The processor is a 2-step aggregation procedure:

<Steps>
  <Step title="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>

  <Step title="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.
  </Step>
</Steps>

#### Pods

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](/guides/general-guides/run-a-feeder).

## Staking Incentives

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.
