Inferenco Predictions SDK
A Rust library for cryptocurrency price forecasting that combines statistical methods, technical analysis, and machine learning.
Projects using this SDK
- DeFiCalc integrates the SDK for price-aware DeFi calculations.
- Inferenco Nova uses the SDK to power AI-driven blockchain conversations and tooling.
Features
- Hybrid Forecasting Engine: Ensemble of statistical models, ML (SVR), and technical indicators
- Multi-Horizon Forecasts: From 15 minutes to 4 years
- Two-Tier Caching: Smart TTL-based caching for API responses and forecasts
- Rate Limiting: Built-in token bucket + exponential backoff for CoinGecko API
- Technical Analysis: RSI, MACD, Bollinger Bands
- Local AI: On-the-fly Mixture of Linear Experts (MixLinear) training
Installation
Add to your Cargo.toml:
[]
= "0.1.9"
= { = "1", = ["full"] }
Quick Start
Usage
use ;
async
Fetching Charts
To retrieve historical candles and (for long horizons) projection bands, set the chart flag to true in your request. This is best handled via the run_prediction_handler helper or by manually calling fetch_chart_candles.
use ;
// ... inside async fn
let request = ForecastRequest ;
// Returns a JSON string containing both "forecast" and "chart" fields
let json_response = run_prediction_handler.await?;
println!;
Response Structure:
ML-backed short forecasts expose ml_interval_calibration, reflecting a 90%
target conformal interval built from rolling, out-of-fold residuals. The
calibration_score replaces the previous heuristic reliability metric and is
derived from pinball loss against the observed coverage.
Run the Example
MCP Integration
This SDK is designed to be easily integrated into Model Context Protocol (MCP) servers as a tool.
- Tool Name:
get_crypto_forecast - Functionality: Provides short/long term price forecasts and optional chart data.
- Integration: Use
run_prediction_handlerto process tool arguments and return the JSON result directly.
See the MCP Integration Guide in the documentation for the full JSON schema and Rust implementation details.
See DOCUMENTATION.md for detailed architecture, API reference, and integration guides.
CI/CD
GitHub Actions runs:
cargo fmt --checkcargo clippycargo buildcargo test(unit + integration + doc tests)
License
MIT