Skip to content

Data Feed Registry

The TaaS Data Feed Registry is a runtime directory of all active data provider plugins registered in the network. It is managed by the @friehub/sovereign-logic package and populated by the @friehub/taas-plugins ecosystem.


How it Works

When the TaaS Backend or a Truth Node starts, it initializes the plugin registry by calling:

typescript
import { bootstrapRegistry, globalLogicRegistry } from '@friehub/sovereign-logic';
import { CategoryMapper } from '@friehub/taas-plugins';

await bootstrapRegistry({});

const plugins = CategoryMapper.getPlugins({
    keys: {
        coingecko: process.env.COINGECKO_API_KEY,
        sportmonks: process.env.SPORTMONKS_KEY,
        openweather: process.env.OPENWEATHER_KEY,
        // ... other providers
    }
});

for (const plugin of plugins) {
    globalLogicRegistry.register(plugin);
}

Each plugin is a SovereignAdapter instance with a standardized fetch({ params }) method that returns a TruthData object.


Registered Providers

Crypto

Provider IDDescriptionRequired Key
coingeckoCryptocurrency price data (BTC, ETH, all tokens)Optional
birdeyeSolana DeFi token prices and market dataBIRDEYE_API_KEY
cmcCoinMarketCap multi-asset price rankingsCMC_API_KEY

Finance & Economics

Provider IDDescriptionRequired Key
alphavantageForex rates, stock prices, commodity dataALPHA_VANTAGE_KEY
exchangerateCurrency exchange rate dataEXCHANGERATE_KEY
fredUS Federal Reserve Economic Data (macroeconomics)FRED_KEY

Sports

Provider IDDescriptionRequired Key
sportmonksFootball/soccer fixture results and statisticsSPORTMONKS_KEY
theoddsapiSports betting odds across major leaguesTHE_ODDS_API_KEY
sportsdbMulti-sport event outcomesSPORTS_DB_KEY

Weather

Provider IDDescriptionRequired Key
openweatherCurrent and forecasted weather by locationOPENWEATHER_KEY

Social & AI

Provider IDDescriptionRequired Key
groqFast LLM inference for text-based truth queriesGROQ_API_KEY
geminiGoogle Gemini AI inferenceGEMINI_API_KEY
serperGoogle Search API for web-based fact checkingSERPER_API_KEY

Writing a Custom Adapter

Implement the SovereignAdapter interface from @friehub/taas-interfaces:

typescript
import { SovereignAdapter, TruthData, DataCategory } from '@friehub/sovereign-logic';

export class MyCustomAdapter extends SovereignAdapter<TruthData> {
    constructor(apiKey: string) {
        super({
            name: 'my-custom-source',
            category: DataCategory.FINANCE
        });
    }

    protected async fetchData(params: any): Promise<TruthData> {
        const response = await fetch(`https://my-api.com/data?q=${params.query}`);
        const json = await response.json();

        return {
            id: 'my-custom-source',
            value: json.result,
            category: DataCategory.FINANCE,
            source: 'my-custom-source',
            timestamp: Math.floor(Date.now() / 1000),
            metadata: json
        };
    }

    protected async getMockData(params: any): Promise<TruthData> {
        return this.fetchData(params); // For testing
    }
}

Register it:

typescript
globalLogicRegistry.register(new MyCustomAdapter(process.env.MY_API_KEY!));

Querying the Registry via the Gateway

The TaaS Gateway exposes a REST endpoint to inspect all registered feed statuses:

bash
GET https://api.friehub.com/gateway/feeds

Response:

json
{
  "success": true,
  "total": 14,
  "feeds": [
    {
      "id": "coingecko",
      "name": "CoinGecko",
      "category": "CRYPTO",
      "status": "HEALTHY",
      "circuitBreaker": { "state": "CLOSED" }
    }
  ]
}