A modern cryptocurrency market data platform built with Hono.js and Next.js. Provides real-time price, volume, and volatility data through an intuitive UI and RESTful API endpoints optimized for blockchain integration.
- Real-time Market Data β Live cryptocurrency prices, volumes, and volatility from CoinGecko
- Blockchain-Ready API β uint256-encoded values scaled to 1e18 for direct smart contract consumption
- Fallback Resilience β Automatic failover to Coinbase API with intelligent caching
- NaΓ―ve Forecasting β Trend-based price predictions with 60-day backtested confidence scores
- Modern UI β Responsive, branded interface with per-token theming
# Clone the repository
git clone https://github.com/RitualChain/oracast-markets.git
cd oracast-markets
# Install dependencies
bun install
# or: npm install
# Start development server
bun dev
# or: npm run devOpen http://localhost:3000 in your browser.
GET /api/features/:idReturns uint256-encoded values optimized for on-chain consumption:
{
"price": "97382000000000000000000",
"volume": "110903448964000000000000000000",
"volatility": "6173220000000000000",
"direction": 1,
"forecast": {
"mean": "103555220000000000000000",
"low": "97159526340000000000000",
"high": "109950913660000000000000"
},
"fitness": "854200000000000000000"
}GET /api/features/all/:idReturns human-readable values with additional metadata:
{
"price": 97382.0,
"volume": 110903448964,
"volatility": 6.17,
"direction": 1,
"forecast": { "mean": 103555.22, "low": 97159.53, "high": 109950.91 },
"fitness": 85.42,
"name": "Bitcoin",
"symbol": "BTC",
"lastUpdated": "2026-01-15T12:00:00.000Z",
"source": "coingecko"
}| Endpoint | Description |
|---|---|
GET /api/health |
Health check |
GET /api/coins/list |
Top 25 cryptocurrencies |
GET /api/price/:id |
Price only (uint256) |
See docs/integration.md for detailed API documentation.
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User/Client ββββββΆβ Next.js API ββββββΆβ CoinGecko API β
β β β (Hono Routes) β β (Primary) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββ βββββββββββββββββββ
β In-Memory Cache β β Coinbase API β
β (TTL-based) β β (Fallback) β
ββββββββββββββββββββ βββββββββββββββββββ
- Framework: Next.js 16 (App Router)
- API: Hono.js 4.10
- Frontend: React 19, TypeScript
- Styling: Tailwind CSS, Radix UI
oracast-markets/
βββ app/
β βββ api/[...route]/ # Hono API routes
β βββ features/ # Main data display component
β βββ [..id]/ # Dynamic coin routes
βββ components/ui/ # Reusable UI components
βββ lib/ # Utilities and constants
βββ docs/ # API documentation
βββ public/ # Static assets
The API provides uint256-encoded values for direct blockchain consumption:
contract PriceOracle {
uint256 public price;
uint256 public volume;
uint256 public volatility;
uint256 public direction;
function updateFeatures(
uint256 _price,
uint256 _volume,
uint256 _volatility,
uint256 _direction
) external onlyOwner {
price = _price;
volume = _volume;
volatility = _volatility;
direction = _direction;
}
}See docs/a2a.md for the complete AI agent integration guide.
Edit lib/constants.ts to add new cryptocurrencies:
export const TOKEN_LIST_DEFAULT: Token[] = [
{
id: 'bitcoin', // CoinGecko ID
name: 'Bitcoin',
symbol: 'BTC',
logo: 'https://assets.coingecko.com/...',
brandColor: '#F7931A',
brandBgColor: '#FFF4E6',
},
// Add more tokens...
];Copy .env.example to .env.local for custom configuration. See the file for available options.
- API Integration Guide β Detailed API documentation
- Agent Integration (A2A) β Guide for AI agents and smart contracts
- Security Audit β Full security assessment
- Push your code to GitHub
- Import your repository in Vercel
- Deploy automatically
# Build for production
bun run build
# Start production server
bun run startContributions are welcome! Please read CONTRIBUTING.md for guidelines.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- See SECURITY.md for our security policy
- See SECURITY_AUDIT.md for the full security audit
- Report vulnerabilities to: security@bunsdev.com
This project is licensed under the MIT License β see the LICENSE file for details.
Val Alexander β bunsdev.com
Built with β for Ritual Devs
