USE CASE

AI Agents & Multi-Source Data

Cross-app data access for trading agents, backtesting, and autonomous AI systems

The Challenge

AI agents need data from multiple sources to make intelligent decisions. Trading bots require historical price data. Prediction markets need outcome feeds. Autonomous systems need to query across application boundaries. Traditional APIs require individual integrations, authentication flows, and billing relationships with each data provider.

10+
API integrations for a typical trading agent
Weeks
to negotiate data access agreements
$1000s
monthly for premium data feeds

Why Agents Need Cross-App Data Access

Multi-Source Intelligence

Trading agents need price feeds, order books, sentiment data, and on-chain metrics simultaneously. Each data source currently requires a separate integration.

Historical & Archival Data

Backtesting requires years of historical data. Most APIs limit historical access or charge premium rates for archival queries.

Agent-to-Agent Data Sharing

Specialized agents produce valuable signals. Currently, there's no standard way for agents to monetize their data or for other agents to consume it.

How OnchainDB Solves This

Single Query, Multiple Sources

Query data from any app on OnchainDB with a single API call. No individual integrations, no separate auth flows. Data providers set prices, payments happen automatically via HTTP 402.

Full Historical Access

Data persists on Celestia with configurable retention policies. Query price history, prediction outcomes, or trading signals across your retention window. Indexes maintained for fast historical lookups.

App-to-App Data Protocol

Agents can publish data and earn from other agents' queries. Revenue splits automatically - 70% to data provider, 30% platform fee. No contracts, no negotiations.

Cross-App Joins

Join data from multiple apps in a single query. Correlate price feeds with sentiment data, or prediction market outcomes with trading signals.

Agent Use Cases

Trading Agent Backtesting

Access years of historical price data for stocks, crypto tokens, and derivatives. Test strategies against real market conditions without expensive data subscriptions.

Prediction Market Agents

Query outcome data, resolution feeds, and historical accuracy. Build agents that learn from past predictions to improve future bets.

Price Oracle Networks

Aggregate price data from multiple sources. Publish consensus prices that other agents can query. Earn from every query to your oracle.

Sentiment Analysis Agents

Publish sentiment signals derived from social data. Other trading agents pay to query your signals. Your agent earns while it runs.

OnchainDB vs. Traditional Data Access

CapabilityOnchainDBTraditional APIsData Marketplaces
Multi-Source QueriesSingle API, any appSeparate integration per sourceDownload and merge manually
Historical DataConfigurable retention, indexedLimited or premium-pricedStatic snapshots
Payment ModelPay-per-query, automaticMonthly subscriptionsOne-time purchase
Agent-to-AgentNative supportNot supportedManual listing/purchase
Real-Time UpdatesLive queriesDepends on APIStatic data only

Quick Start

trading-agent.ts
import { createClient } from '@onchaindb/sdk';

const client = createClient({
  endpoint: 'https://api.onchaindb.io',
  appKey: process.env.ONCHAINDB_KEY
});

// Query historical price data for backtesting
const priceHistory = await client.query({
  appId: 'price-oracle-app',
  collection: 'token_prices',
  filter: {
    symbol: 'ETH',
    timestamp: { $gte: '2024-01-01' }
  }
});  // Pays data provider automatically

// Publish your agent's trading signals
await client.store({
  collection: 'trading_signals',
  data: [{
    symbol: 'ETH',
    signal: 'buy',
    confidence: 0.85,
    timestamp: new Date().toISOString()
  }]
});  // Other agents can query and pay you

// Cross-app join: prices + sentiment
const enrichedData = await client.queryBuilder()
  .from('price-oracle-app', 'token_prices')
  .join('sentiment-agent', 'signals')
  .on('symbol')
  .execute();  // Revenue splits to both providers

Ready to Build Data-Powered Agents?

Access any data source with a single API. Monetize your agent's signals automatically.