Prediction market-style analytics derived from Injective perpetual futures data
A developer-focused API that transforms raw Injective exchange data into actionable trading signals, sentiment indicators, and market health metrics.
This API provides derived signals and computed analytics on top of Injective's perpetual futures markets:
| Signal Type | Description |
|---|---|
| Implied Probability | Bull/bear probability estimates derived from funding rates, orderbook imbalance, and momentum |
| Sentiment Indicator | Market sentiment score (-100 to +100) with categorical labels |
| Momentum Indicator | Price momentum with directional strength |
| Liquidity Score | Market depth and spread analysis |
| Funding Rate Signals | Contrarian signals from funding rate extremes |
| Market Health Score | Overall market quality grade (A-F) |
| Conviction Ranking | Cross-market signal strength comparison |
The Injective Signals API uses official Injective SDK packages to fetch real-time data from Injective's indexer infrastructure. All signals and analytics are calculated locally from this raw data.
| Source | SDK Class | Description |
|---|---|---|
| Indexer gRPC API | IndexerGrpcDerivativesApi |
Markets, orderbooks, trades, funding rates |
| Chronos REST API | IndexerRestDerivativesChronosApi |
Market summaries (OHLCV, 24h change) |
{
"@injectivelabs/sdk-ts": "^1.17.7",
"@injectivelabs/networks": "^1.17.7"
}| Method | Description | Used In |
|---|---|---|
fetchMarkets() |
List all derivative markets | /api/markets |
fetchOrderbookV2(marketId) |
Get orderbook (bids/asks) | /api/markets/{id}/orderbook, signals |
fetchTrades({ marketId, pagination }) |
Get recent trades | /api/markets/{id}/trades, signals |
fetchFundingRates({ marketId, pagination }) |
Get funding rate history | /api/funding, signals |
| Method | Description | Used In |
|---|---|---|
fetchMarketSummary(marketId) |
Get 24h OHLCV data | Signals, momentum calculation |
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";
const endpoints = getNetworkEndpoints(Network.Mainnet);
// endpoints.indexer β gRPC indexer endpoint
// endpoints.chronos β Chronos REST endpointThe API supports both mainnet (default) and testnet via the NETWORK environment variable.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Injective Network β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Injective Indexer β
β βββββββββββββββββββββββ βββββββββββββββββββββββββββββββ β
β β gRPC Derivatives β β Chronos REST API β β
β β - Markets β β - Market Summaries β β
β β - Orderbooks β β - OHLCV Data β β
β β - Trades β β - 24h Statistics β β
β β - Funding Rates β β β β
β βββββββββββββββββββββββ βββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Injective Signals API β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Signal Calculations β β
β β - Implied Probability (funding + orderbook) β β
β β - Sentiment Index (funding + imbalance + volume) β β
β β - Momentum Score (price changes + volume) β β
β β - Liquidity Score (depth + spread) β β
β β - Conviction Ranking (combined signals) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Endpoints β
β GET /api/markets - Raw market data β
β GET /api/signals - Calculated trading signals β
β GET /api/funding - Funding rate analysis β
β GET /api/conviction - Market conviction rankings β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Market metadata (ticker, fees, margin requirements)
- Orderbook depth (bids/asks with price and quantity)
- Trade history (execution price, quantity, side)
- Funding rates (hourly rates)
- Market summaries (24h OHLCV)
- Implied Probability β Bullish/bearish probability based on funding rate, orderbook imbalance, and momentum
- Sentiment Index β Market sentiment score (-100 to +100) with fear/greed labels
- Momentum Score β Price momentum based on 1h and 24h price changes
- Liquidity Score β Market liquidity based on spread and depth
- Conviction Ranking β Combined signal strength for trade conviction
npm install
cp .env.example .env
npm run devOption 1: One-Click Deploy
Option 2: CLI Deploy
# Install Vercel CLI
npm i -g vercel
# Deploy (from project root)
vercel
# Deploy to production
vercel --prodOption 3: GitHub Integration
- Push to GitHub
- Go to vercel.com
- Import your repository
- Deploy automatically on every push
# Health check
curl http://localhost:3000/api/health
# List all markets
curl http://localhost:3000/api/markets?status=active
# Get signals for a market
curl http://localhost:3000/api/signals/0x...marketId
# Get conviction ranking
curl http://localhost:3000/api/convictionVisit /docs for the interactive Swagger UI where you can explore and test all endpoints.
- Swagger UI:
https://your-app.vercel.app/docs - OpenAPI Spec:
https://your-app.vercel.app/api/openapi
| Endpoint | Description |
|---|---|
GET /api/markets |
List all derivative markets |
GET /api/markets/:marketId |
Get single market details |
GET /api/markets/:marketId/orderbook |
Get orderbook depth |
GET /api/markets/:marketId/trades |
Get recent trades |
| Endpoint | Description |
|---|---|
GET /api/signals |
Get signals for all markets |
GET /api/signals/:marketId |
Get comprehensive signals for a market |
GET /api/signals/:marketId/probability |
Get implied probability only |
GET /api/signals/:marketId/sentiment |
Get sentiment indicator only |
| Endpoint | Description |
|---|---|
GET /api/funding |
Get funding rate extremes across all markets |
GET /api/funding/:marketId |
Get detailed funding rate analysis |
| Endpoint | Description |
|---|---|
GET /api/health/:marketId |
Get market health score and warnings |
| Endpoint | Description |
|---|---|
GET /api/conviction |
Get conviction ranking across all markets |
{
"success": true,
"data": {
"marketId": "0x...",
"ticker": "BTC/USDT PERP",
"timestamp": "2024-01-15T10:30:00Z",
"markPrice": 42500.5,
"lastTradePrice": 42498.0,
"impliedProbability": {
"bullish": 0.58,
"bearish": 0.42,
"confidence": 0.75,
"signals": ["funding_rate", "orderbook_imbalance", "momentum"]
},
"sentiment": {
"score": 23.5,
"label": "greed",
"components": {
"fundingRate": 15.2,
"orderbookImbalance": 28.4,
"volumeTrend": 18.9
}
},
"momentum": {
"score": 32.1,
"direction": "bullish",
"priceChange": {
"1h": 0.45,
"24h": 2.15
},
"volumeChange24h": 1.08
},
"liquidity": {
"score": 78.5,
"depth": {
"bids": {
"atHalfPercent": 150000,
"atOnePercent": 450000,
"atTwoPercent": 890000
},
"asks": {
"atHalfPercent": 145000,
"atOnePercent": 420000,
"atTwoPercent": 850000
}
},
"spread": { "absolute": 0.5, "percentage": 0.0012 },
"imbalanceRatio": 0.045
},
"metrics": {
"fundingRate": 0.00015,
"volume24h": 15400000,
"openInterest": 0,
"tradeCount24h": 4523,
"high24h": 43200,
"low24h": 41800
}
},
"timestamp": "2024-01-15T10:30:00Z"
}{
"success": true,
"data": {
"marketId": "0x...",
"ticker": "BTC/USDT PERP",
"currentRate": 0.00025,
"predictedRate": 0.00018,
"annualizedRate": 21.9,
"extremeLevel": "positive",
"signal": "sell",
"history": [
{ "timestamp": "2024-01-15T10:00:00Z", "rate": 0.00025 },
{ "timestamp": "2024-01-15T09:00:00Z", "rate": 0.00022 }
]
}
}{
"success": true,
"data": {
"count": 10,
"rankings": [
{
"marketId": "0x...",
"ticker": "ETH/USDT PERP",
"convictionScore": 72.5,
"direction": "long",
"strength": "strong",
"factors": [
{
"factor": "funding_rate",
"contribution": 25.0,
"direction": "bullish"
},
{
"factor": "orderbook_imbalance",
"contribution": 18.5,
"direction": "bullish"
},
{ "factor": "momentum", "contribution": 29.0, "direction": "bullish" }
]
}
]
}
}| Environment Variable | Description | Default |
|---|---|---|
NETWORK |
Injective network (mainnet or testnet) |
mainnet |
PORT |
Server port | 3000 |
Combines three signals with weighted contributions as an adjustment to a base score:
- Funding Rate (Β±15%): Contrarian signal - high positive funding suggests overextended longs
- Orderbook Imbalance (Β±15%): Bid/ask volume ratio indicates buying/selling pressure
- Momentum (Β±10%): Recent price action contribution
Weighted composite of:
- Funding Rate Component (40%)
- Orderbook Imbalance Component (35%)
- Volume Trend Component (25%)
Labels: extreme_fear | fear | neutral | greed | extreme_greed
Based on:
- Liquidity (35%): Orderbook depth and value
- Volatility (25%): 24h price range stability
- Activity (25%): Trade count
- Spread (15%): Bid-ask spread tightness
| Source | Data |
|---|---|
IndexerGrpcDerivativesApi |
Markets, orderbooks, trades, positions, funding rates |
IndexerRestDerivativesChronosApi |
24h market summaries |
- Runtime: Node.js + TypeScript
- Framework: Express.js
- Injective SDK:
@injectivelabs/sdk-ts - Caching: In-memory with TTL
injective-signals-api/
βββ src/
β βββ index.ts # Entry point
β βββ routes/
β β βββ index.ts # API route definitions
β βββ services/
β β βββ injectiveClient.ts # Injective SDK wrapper
β β βββ marketDataService.ts # Raw data fetching + caching
β β βββ signalsService.ts # Signal calculations
β βββ types/
β βββ index.ts # TypeScript type definitions
βββ package.json
βββ tsconfig.json
βββ README.md
MIT
Built for Ninja API Forge Hackathon π₯·