Coinhawk Price Engine avatar
Coinhawk Price Engine

Pricing

$0.05 / price aggregation run

Go to Apify Store
Coinhawk Price Engine

Coinhawk Price Engine

High-accuracy crypto price aggregation from CEX, DEX, and Solana AMMs. Validates prices across sources, detects outliers, and returns confidence-scored real-time and historical pricing data.

Pricing

$0.05 / price aggregation run

Rating

0.0

(0)

Developer

Natalie Leong

Natalie Leong

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

25 days ago

Last modified

Share

Price Engine S1/S2 - Multi-Source Price Aggregation

Description

The Price Engine provides comprehensive cryptocurrency price data aggregation from multiple sources including centralized exchanges (CEX), decentralized exchanges (DEX), and automated market makers (AMM). It features intelligent source selection, price validation, and real-time market data collection with support for both Ethereum and Solana ecosystems.

Features

  • Multi-Source Aggregation: CEX, DEX, and AMM price feeds
  • Solana AMM Integration: Raydium S1/S2 pool pricing with RPC fallback
  • Price Validation: Outlier detection and confidence scoring
  • Real-Time Data: Live price feeds with sub-second updates
  • Source Prioritization: Intelligent routing based on liquidity and reliability
  • Historical Data: Time-series price collection and storage

Supported Sources

Centralized Exchanges (CEX)

  • Binance, Coinbase, Kraken, KuCoin
  • FTX, Gate.io, Huobi, OKX

Decentralized Exchanges (DEX)

  • Uniswap V2/V3, SushiSwap, PancakeSwap
  • 1inch, Curve, Balancer

Solana AMMs

  • Raydium S1: Basic pool pricing
  • Raydium S2: Advanced pool discovery with RPC validation
  • Orca, Serum, Jupiter aggregation

Input Schema

interface PriceEngineInput {
tokens: string[]; // Token symbols or addresses
sources?: string[]; // Optional source filtering
include_historical?: boolean; // Include price history
time_range?: number; // Historical data range (hours)
validation_threshold?: number; // Price validation sensitivity
}

Output Schema

interface PriceEngineOutput {
results: PriceResult[];
metadata: {
total_sources: number;
avg_confidence: number;
timestamp: number;
};
}
interface PriceResult {
token: string;
price_usd: number;
confidence: number; // 0-1 confidence score
sources: SourceResult[];
best_source: string;
volume_24h?: number;
market_cap?: number;
price_change_24h?: number;
historical?: PricePoint[];
}
interface SourceResult {
source: string;
price: number;
volume: number;
liquidity?: number;
last_updated: number;
confidence: number;
}

Example Run

Input

{
"tokens": ["BTC", "ETH", "SOL", "RAY"],
"sources": ["binance", "coinbase", "raydium"],
"include_historical": true,
"time_range": 24,
"validation_threshold": 0.05
}

Output

{
"results": [
{
"token": "BTC",
"price_usd": 43250.50,
"confidence": 0.98,
"best_source": "binance",
"volume_24h": 28500000000,
"market_cap": 847000000000,
"price_change_24h": 2.34,
"sources": [
{
"source": "binance",
"price": 43250.50,
"volume": 15200000000,
"last_updated": 1703123456789,
"confidence": 0.98
},
{
"source": "coinbase",
"price": 43248.20,
"volume": 8900000000,
"last_updated": 1703123450000,
"confidence": 0.96
}
],
"historical": [
{ "time": 1703120000, "price": 43100.00 },
{ "time": 1703121600, "price": 43180.50 },
{ "time": 1703123200, "price": 43250.50 }
]
},
{
"token": "RAY",
"price_usd": 0.1847,
"confidence": 0.89,
"best_source": "raydium",
"volume_24h": 12500000,
"sources": [
{
"source": "raydium",
"price": 0.1847,
"volume": 8200000,
"liquidity": 2400000,
"last_updated": 1703123445000,
"confidence": 0.89
}
]
}
],
"metadata": {
"total_sources": 12,
"avg_confidence": 0.94,
"timestamp": 1703123456789
}
}

Raydium Integration

S1 Implementation (Basic)

  • Direct pool price calculation
  • Token mint validation
  • Basic liquidity checks
  • Standard AMM math

S2 Implementation (Advanced)

  • Pool discovery via API + RPC
  • Missing field repair via RPC fallback
  • Enhanced liquidity validation
  • Multi-pool aggregation
  • Slippage calculation

Price Validation

The engine employs multiple validation techniques:

  1. Outlier Detection: Statistical analysis to identify price anomalies
  2. Cross-Source Validation: Compare prices across multiple sources
  3. Volume Weighting: Higher volume sources get higher confidence
  4. Liquidity Checks: Ensure sufficient liquidity for reliable pricing
  5. Timestamp Validation: Reject stale price data

Configuration

Environment variables:

  • BINANCE_API_KEY: Binance API credentials
  • COINBASE_API_KEY: Coinbase Pro API credentials
  • SOLANA_RPC_URL: Solana RPC endpoint
  • PRICE_CACHE_TTL: Price cache duration (default: 30 seconds)
  • MAX_PRICE_DEVIATION: Maximum allowed price deviation (default: 5%)
  • MIN_LIQUIDITY_USD: Minimum liquidity threshold (default: $10,000)

Pricing

  • Free Tier: Up to 100 price requests per day
  • Standard: $0.001 per price request
  • Premium: $0.0005 per request (bulk pricing for >100,000 requests/month)
  • Enterprise: Custom pricing with dedicated infrastructure

Use Cases

  • Trading Applications: Real-time price feeds for trading platforms
  • Portfolio Tracking: Accurate valuation of cryptocurrency holdings
  • DeFi Integration: Price oracles for decentralized applications
  • Market Analysis: Historical price data for research and backtesting
  • Arbitrage Detection: Cross-exchange price comparison
  • Risk Management: Price validation and confidence scoring

Technical Features

  • High Availability: 99.9% uptime SLA
  • Low Latency: Sub-100ms response times
  • Rate Limiting: Intelligent request throttling
  • Caching: Redis-based price caching for performance
  • Monitoring: Real-time health checks and alerting
  • Scalability: Auto-scaling based on demand

API Endpoints

  • GET /price/{token}: Single token price
  • GET /prices: Batch price requests
  • GET /sources: Available price sources
  • GET /historical/{token}: Historical price data
  • WebSocket /ws/prices: Real-time price streams