# Agent Performance Source: https://docs.aioka.io/api-reference/agents/performance GET /v1/agents/performance Historical directional accuracy of each AI Council agent (BTC) > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Don't have a key? [Get one free โ†’](/api-reference/keys/generate) ## Overview Returns the historical accuracy of each AI Council agent. For every closed BTC Ghost Trader trade, AIOKA locates the council verdict that triggered it and checks which agents voted in the direction that actually paid off. The result is each agent's hit rate across all graded trades. **Asset:** BTC only โ€” the only asset with a live closed-trade record. **Tier:** Free โœ… **Cache TTL:** 3600 seconds (1 hour) ## How accuracy is graded Each closed trade's outcome direction is derived from its result and direction: | Trade | Outcome | Correct vote | | - | - | - | | LONG win | price rose | `BULLISH` | | LONG loss | price fell | `BEARISH` | | SHORT win | price fell | `BEARISH` | | SHORT loss | price rose | `BULLISH` | Only directional votes (`BULLISH` / `BEARISH`) are graded. `NEUTRAL` votes and non-directional rulings (e.g. RISK SHIELD's `PROCEED` / `REDUCE` / `WAIT` / `AVOID`) carry no directional claim, so they are excluded from the denominator rather than counted as wrong. An agent with no directional history is omitted from the response. ## Response Fields | Field | Type | Description | | - | - | - | | `asset` | string | Always `"BTC"`. | | `trades_analyzed` | number | Count of closed BTC trades matched to a council verdict. | | `agents` | array | Per-agent accuracy entries (see below). May be empty. | | `agents[].agent_name` | string | Display name, e.g. `"CHAIN ORACLE"`. | | `agents[].correct_calls` | number | Directional votes that matched the outcome. | | `agents[].total_calls` | number | Directional votes graded for this agent. | | `agents[].accuracy_pct` | number | `correct_calls / total_calls ร— 100`, 1 decimal. | | `agents[].last_updated` | string \| null | ISO timestamp of the most recent graded trade. | | `cached` | boolean | Whether this response was served from cache. | | `cache_ttl_seconds` | number | Cache lifetime in seconds (3600). | > [!NOTE] > > Accuracy is computed only from BTC trades because BTC is the only asset with a > validated, closed-trade record. Other asset councils (ETH, SOL, etc.) do not > yet expose accuracy stats. # Run Backtest Source: https://docs.aioka.io/api-reference/backtest/run POST /v1/backtest Historical performance simulation (max 90 days) > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires PRO tier key (\$199/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Pro (\$199/mo) ๐Ÿ”’ **Cache TTL:** 3600 seconds (1 hour) **Max period:** 90 days > โš ๏ธ Results are based on historical simulated conditions. > Past performance does not guarantee future results. ## Request Body | Field | Type | Required | Description | | - | - | - | - | | `start_date` | string | โœ… | Start date (YYYY-MM-DD) | | `end_date` | string | โœ… | End date (YYYY-MM-DD) | | `mode` | string | โ€” | Entry mode: `A` or `B` (default: `B`) | ```bash curl theme={null} curl -X POST https://api.aioka.io/v1/backtest \ -H "X-API-Key: aik_pro_your_key_here" \ -H "Content-Type: application/json" \ -d '{"start_date": "2026-01-01", "end_date": "2026-04-01", "mode": "B"}' ``` ```json 200 theme={null} { "total_trades": 8, "win_rate": 0.625, "total_pnl_usd": 312.50, "max_drawdown_pct": 4.2, "avg_hold_hours": 18.4, "period_days": 90, "mode": "B", "cached": false, "cache_ttl_seconds": 3600 } ``` ```json 400 theme={null} { "detail": { "error": "period_too_long", "message": "Maximum backtest period is 90 days.", "requested_days": 365 } } ``` # Gold Live Signals Source: https://docs.aioka.io/api-reference/commodities/gold/signals GET /v1/commodities/gold/signals Latest readings of all 8 Gold-specific signals across macro, technical, ETF flow, and safe-haven drivers > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. Fetches fresh > signal readings on every request (expect 1 -- 3 seconds response time). **Tier:** Pro (\$199/mo) **Cache:** None -- fetches fresh on every request **Rate limit:** 30/min (per tier) **Read-only:** No writes. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `signals` | array | Latest readings for each Gold signal, one entry per signal key | | `generatedAt` | string | Response timestamp (ISO 8601) | ### Per-signal (signals array) | Field | Type | Meaning | | - | - | - | | `key` | string | Signal identifier (see signal catalog below) | | `value` | number \| null | Latest numeric reading. `null` when the source is temporarily unavailable. | | `direction` | string | Direction label -- semantics vary per signal (see catalog) | | `source` | string | Data source identifier (e.g. `"fred"`, `"yahoo_finance"`, `"imf_ifs"`) | | `detail` | string | Human-readable description of the current reading | | `fetchedAt` | string | ISO 8601 timestamp of when this reading was captured | ## Gold Signal Catalog All 8 Gold-specific signals feed the council deliberation every 30 minutes. Per-signal cache TTLs vary (15 min -- 7 days) to match how frequently each underlying data source updates. | Signal Key | Description | Source | Cache TTL | Agent | | - | - | - | - | - | | `GOLD_REAL_RATE_DIRECTION` | 10Y TIPS yield trend (FRED DFII10). FALLING real rates lower the opportunity cost of holding Gold and are historically its strongest macro tailwind. **Used in Gate 8 -- RISING blocks all entries. UNKNOWN also blocks (fail-safe).** Threshold: delta > +5 bps = RISING; delta \< -5 bps = FALLING. Direction: `FALLING` / `FLAT` / `RISING` / `UNKNOWN`. | FRED (DFII10) | 4 h | MACRO\_SAGE, INFLATION\_SAGE | | `GOLD_DXY_TREND` | Broad USD index trend (FRED DTWEXBGS). Gold is priced in USD so an inverse correlation of roughly -0.7 holds historically. BULLISH = DXY falling (Gold rises). BEARISH = DXY rising (Gold falls). Threshold: change > +0.2% = BEARISH; change \< -0.2% = BULLISH. Direction: `BULLISH` / `BEARISH` / `NEUTRAL` / `UNKNOWN`. | FRED (DTWEXBGS) | 1 h | MACRO\_SAGE | | `GOLD_SILVER_RATIO` | XAU/USD divided by XAG/USD (Yahoo Finance futures GC=F / SI=F). Elevated ratio (75 -- 85) signals risk-off rotation into Gold. Extreme ratio (> 85) historically precedes Gold corrections. Below 65 = silver outperforming = risk-on = bearish for Gold. Direction: `BULLISH` / `NEUTRAL` / `BEARISH` / `UNKNOWN`. | Yahoo Finance (GC=F, SI=F) | 1 h | TECHNICAL\_HAWK | | `GOLD_ETF_FLOWS` | Institutional interest proxy from GLD + IAU combined 5-day trading volume vs prior 5 days (Yahoo Finance). Rising volume signals accelerating institutional interest. Note: this is a volume proxy, not net share creation -- true net flow data requires Bloomberg or ETF-issuer feeds. Direction: `BULLISH` / `NEUTRAL` / `BEARISH` / `UNKNOWN`. | Yahoo Finance (GLD, IAU) | 24 h | CENTRAL\_BANK\_WATCHER | | `GOLD_VIX` | CBOE Volatility Index (FRED VIXCLS). Elevated fear drives safe-haven demand for Gold. The sweet spot for Gold entries is VIX 20 -- 35 (elevated but not panic). Direction labels: `LOW` (\< 15) / `MODERATE` (15 -- 25) / `ELEVATED` (25 -- 35) / `EXTREME` (> 35) / `UNKNOWN`. | FRED (VIXCLS) | 15 min | SAFE\_HAVEN\_ANALYST | | `GOLD_INFLATION_EXPECTATIONS` | 5-year breakeven inflation rate (FRED T5YIE). Rising breakeven = markets pricing in more inflation = Gold inflation-hedge bid rises. Threshold: delta > +3 bps = BULLISH; delta \< -3 bps = BEARISH. Direction: `BULLISH` / `NEUTRAL` / `BEARISH` / `UNKNOWN`. | FRED (T5YIE) | 4 h | INFLATION\_SAGE | | `GOLD_CENTRAL_BANK_DEMAND` | World official gold reserves direction from IMF International Financial Statistics (IFS) SDMX API (Q.W00.RAAAGOLD\_T\_SDR). Physical quantity change is isolated by dividing each quarter's SDR reserve value by the contemporaneous Gold price (Yahoo GC=F quarterly), removing pure price-appreciation noise. Supports `AIOKA_GOLD_CB_DEMAND_OVERRIDE` env var for manual ops override. Never returns `UNKNOWN` -- falls back to stale cache then `NEUTRAL`. Direction: `BUYING` / `NEUTRAL` / `SELLING`. | IMF IFS SDMX API | 7 d | CENTRAL\_BANK\_WATCHER | | `GOLD_GEOPOLITICAL_RISK` | Geopolitical risk level via CBOE VIX proxy (FRED VIXCLS). The Caldara and Iacoviello GPRC index is not available via the FRED API (400 on all known series IDs) -- VIX is the permanent proxy. Direction: `LOW` / `MODERATE` / `ELEVATED` / `EXTREME` / `UNKNOWN`. | VIX proxy (FRED VIXCLS) | 1 h | SAFE\_HAVEN\_ANALYST, RISK\_WARDEN | ## Gate 8 -- Real Rate Block `GOLD_REAL_RATE_DIRECTION` is the only Gold signal that directly gates entry. When the 10Y TIPS yield trend is `RISING`, the Gold trader blocks all new entries regardless of other signal scores. `UNKNOWN` (FRED unavailable) also triggers the block -- the conservative call is to not trade when the most important macro input is missing. ## Notes * `GOLD_VIX` and `GOLD_GEOPOLITICAL_RISK` read from the same underlying FRED VIXCLS series. `GOLD_VIX` informs the `SAFE_HAVEN_ANALYST` veto above the configured threshold (VIX > 40). `GOLD_GEOPOLITICAL_RISK` is a direct geopolitical risk label for the `RISK_WARDEN` agent. * `GOLD_CENTRAL_BANK_DEMAND` uses a 7-day cache because IMF IFS data updates quarterly (at most 4 real changes per year). Fresh network fetches are rare by design. * `GOLD_ETF_FLOWS` uses 24-hour cache because daily Yahoo Finance volume data does not change intra-day in a meaningful way. * All providers are non-raising (P-G). A failed fetch returns `null` for `value` and `"UNKNOWN"` for `direction` -- the council quality score correctly reflects missing data rather than a fake zero. ```bash curl theme={null} curl https://api.aioka.io/v1/commodities/gold/signals \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "signals": [ { "key": "GOLD_REAL_RATE_DIRECTION", "value": 1.82, "direction": "FALLING", "source": "fred", "detail": "10Y TIPS=1.820% prior=1.870% delta=-5.0bps", "fetchedAt": "2026-05-07T08:14:00+00:00" }, { "key": "GOLD_DXY_TREND", "value": 104.21, "direction": "BEARISH", "source": "fred", "detail": "DXY=104.21 (+0.31%)", "fetchedAt": "2026-05-07T08:10:00+00:00" }, { "key": "GOLD_SILVER_RATIO", "value": 79.42, "direction": "BULLISH", "source": "yahoo_finance", "detail": "ratio=79.42 gold=$3241.50 silver=$40.82", "fetchedAt": "2026-05-07T08:12:00+00:00" }, { "key": "GOLD_ETF_FLOWS", "value": 48320000.0, "direction": "BULLISH", "source": "yahoo_finance", "detail": "5d_vol=48320000 prior=41800000 (+15.6%)", "fetchedAt": "2026-05-07T07:00:00+00:00" }, { "key": "GOLD_VIX", "value": 22.41, "direction": "MODERATE", "source": "fred", "detail": "VIX=22.41 (MODERATE)", "fetchedAt": "2026-05-07T08:14:30+00:00" }, { "key": "GOLD_INFLATION_EXPECTATIONS", "value": 2.341, "direction": "BULLISH", "source": "fred", "detail": "5Y breakeven=2.341% delta=+4.2bps", "fetchedAt": "2026-05-07T08:10:00+00:00" }, { "key": "GOLD_CENTRAL_BANK_DEMAND", "value": 3814.2, "direction": "BUYING", "source": "imf_ifs", "detail": "imf_world_sdr=3814.2B gold_px=3241 delta_qty=+0.0041", "fetchedAt": "2026-05-07T08:00:00+00:00" }, { "key": "GOLD_GEOPOLITICAL_RISK", "value": 22.41, "direction": "MODERATE", "source": "vix_proxy", "detail": "VIX proxy=22.41 (MODERATE)", "fetchedAt": "2026-05-07T08:14:30+00:00" } ], "generatedAt": "2026-05-07T08:15:00+00:00" } ``` # Latest Council Session Source: https://docs.aioka.io/api-reference/council/latest GET /v1/council/latest Most recent AI Council multi-agent verdict > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires PRO tier key (\$199/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Pro (\$199/mo) ๐Ÿ”’ **Cache TTL:** 60 seconds ## The 6 Agents | Agent | Domain | | - | - | | CHAIN ORACLE | On-chain analytics | | MACRO SAGE | Macro environment | | SENTIMENT MONK | Market sentiment | | TECH HAWK | Technical analysis | | LIQUIDITY GUARDIAN | Liquidity depth | | RISK SHIELD | Risk assessment | ```bash curl theme={null} curl https://api.aioka.io/v1/council/latest \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "ruling": "ACCUMULATE", "confidence": 0.77, "consensus": "BULLISH", "score": 0.42, "agents": [ { "agent": "CHAIN ORACLE", "ruling": "BUY", "confidence": 0.82, "thesis": "On-chain accumulation signals are strong." }, { "agent": "MACRO SAGE", "ruling": "ACCUMULATE", "confidence": 0.71, "thesis": "DXY weakness supports risk-on environment." } ], "agents_failed": 0, "session_at": "2026-04-03T09:45:00Z", "cached": true, "cache_ttl_seconds": 55 } ``` # Bitcoin Cycle Context Source: https://docs.aioka.io/api-reference/cycle/status GET /v1/cycle/status Where Bitcoin sits in its market cycle: phase, Pi Cycle Top, halving timing and on-chain valuation > [!NOTE] > > This endpoint is public โ€” no API key required. Powers the Cycle Intelligence card on > aioka.io/live and the `/cycle` Telegram command. **Tier:** Public โœ… **Cache:** 5 min (Redis response cache) **Read-only:** Never writes to any trading table. > โš ๏ธ Cycle context is market information, not financial advice. ## Response Fields | Field | Type | Meaning | | - | - | - | | `cyclePhase` | string | Deterministic phase: `BEAR_BOTTOM` / `EARLY_BULL` / `MID_BULL` / `LATE_BULL` / `TOP_SIGNAL` / `UNKNOWN` (`UNKNOWN` when the signals do not fit one phase, e.g. MVRV-Z below 0 while NUPL is still above 0.25) | | `cyclePhaseVerdict` | string | Verdict implied by the phase (`STRONG_BUY` โ€ฆ `STRONG_AVOID`; `HOLD` for `UNKNOWN`) | | `mvrvZ` | number \| null | MVRV Z-score (Coin Metrics) | | `nupl` | number \| null | Net Unrealized Profit/Loss | | `sopr` | number \| null | Spent Output Profit Ratio | | `piCyclePhase` | int \| null | Pi Cycle Top phase code 0โ€“4 | | `piCyclePhaseName` | string \| null | `BOTTOM_ZONE` / `EARLY_BULL` / `MID_BULL` / `LATE_BULL` / `TOP_SIGNAL` | | `piCycleGapPct` | number \| null | Gap between the 111-day MA and 2ร— the 350-day MA (fraction) | | `piCycleDaysToCross` | int \| null | Estimated days until the two averages cross; `-1` = diverging / already crossed | | `piCycleMa111` | number \| null | 111-day moving average of BTC (USD) | | `piCycleMa3502x` | number \| null | 2 ร— 350-day moving average of BTC (USD) | | `blockHeight` | int \| null | Current Bitcoin block height | | `daysSinceHalving` | int \| null | Days since the April 2024 halving | | `daysToNextHalving` | int \| null | Estimated days to the next halving | | `halvingPhase` | string \| null | `HALVING_RECENT` / `HALVING_EARLY` / `HALVING_MID` / `HALVING_LATE` | | `plainExplanation` | string | 2โ€“3 sentence plain-English summary (cycle agent, or a deterministic fallback) | | `lastUpdated` | string | ISO 8601 time the response was built | | `lastCouncilVerdictAt` | string \| null | Time of the most recent BTC council verdict | ```bash curl theme={null} curl https://api.aioka.io/v1/cycle/status ``` ```json 200 theme={null} { "cyclePhase": "UNKNOWN", "cyclePhaseVerdict": "HOLD", "mvrvZ": -0.65, "nupl": 0.354, "sopr": 0.974, "piCyclePhase": 0, "piCyclePhaseName": "BOTTOM_ZONE", "piCycleGapPct": -0.543, "piCycleDaysToCross": null, "piCycleMa111": 70984.25, "piCycleMa3502x": 155409.43, "blockHeight": 970446, "daysSinceHalving": 906, "daysToNextHalving": 552, "halvingPhase": "HALVING_LATE", "plainExplanation": "BTC sits 906 days past the April 2024 halving, beyond the window in which earlier cycle peaks fired. On-chain valuation looks cheap while holders are still in profit, so the phase is unclear: hold and wait for clearer signals.", "lastUpdated": "2026-10-08T05:20:46Z", "lastCouncilVerdictAt": "2026-10-08T05:22:57Z" } ``` # ETH Council Verdict Source: https://docs.aioka.io/api-reference/eth/council GET /v1/eth/council Latest ETH AI Council verdict with 6 specialist agent votes, confidence score, and signal snapshot > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. The ETH council > runs 6 specialist agents tuned to Ethereum-specific intelligence > (Sprint ETH Phase 2). **Tier:** Pro (\$199/mo) **Cache:** None **Rate limit:** 30/min (per tier) **Read-only:** Never writes to any trading table. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `verdict` | object \| null | Latest ETH council verdict. `null` if no verdict has been produced yet (first 30 minutes after deploy). | | `nextRefreshMinutes` | int | Minutes until the next scheduled council auto-refresh. Always `30`. | ### verdict fields | Field | Type | Meaning | | - | - | - | | `id` | string | UUID of this verdict record | | `ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `AVOID` | | `confidence` | number | 0.0 -- 1.0. ETH entry threshold is confidence >= 0.65. | | `agentVotes` | object | Per-agent breakdown from all 6 ETH specialist agents | | `agentVotes.` | object | Each agent entry has `ruling` (string) and `confidence` (number) | | `chiefRationale` | string \| null | Chief Judge's plain-language explanation of the ruling and why agent disagreements were resolved as they were | | `plainExplanation` | string \| null | Plain-English, jargon-free 2-3 sentence summary of WHY the council reached its ruling, synthesized by the Chief Judge in the same call. `null` for historical verdicts recorded before this feature. | | `snapshotSignals` | object | Raw signal readings at the time of council deliberation (key-value pairs) | | `createdAt` | string | ISO 8601 timestamp of verdict | ## Specialist Agents The ETH council replaces the generic BTC agent personas with 6 specialists calibrated for Ethereum-specific intelligence. Each agent produces an independent ruling and confidence score. The Chief Judge aggregates all 6 votes into the final verdict. | Agent | Weight | Veto | Domain | | - | - | - | - | | `VALIDATOR_ORACLE` | 0.20 | No | PoS network health, staking APY, ETH/BTC ratio | | `MACRO_SAGE` | 0.15 | No | DXY, US10Y, BTC dominance, Fear & Greed, ETH ETF flows | | `GAS_FEE_ANALYST` | 0.20 | No | EIP-1559 burn, DeFi TVL, L2 activity proxy | | `MOMENTUM_HUNTER` | 0.20 | No | RSI 1H/4H, MACD, EMA distance, funding rate | | `DEFI_LIQUIDITY_WARDEN` | 0.10 | **Yes** | DeFi exit risk, funding squeeze, liquidations | | `RISK_WARDEN` | 0.15 | **Yes** | Tail risks, F\&G extremes, ETH ETF outflow reversals | The `agentVotes` object in every verdict response maps each agent name to its individual `ruling` and `confidence`. Disagreement between agents is reflected in the final confidence score -- unanimous verdicts carry the highest confidence. ## Veto Rules DEFI\_LIQUIDITY\_WARDEN and RISK\_WARDEN carry veto power. When either returns AVOID with confidence > 0.7, the council ruling becomes AVOID regardless of what the other four agents vote. Vetoes are enforced deterministically in Python -- never trusted to LLM compliance. | Veto Agent | Trigger | Effect | | - | - | - | | `DEFI_LIQUIDITY_WARDEN` | AVOID + confidence > 0.7 | Council ruling forced to AVOID | | `RISK_WARDEN` | AVOID + confidence > 0.7 | Council ruling forced to AVOID | ```bash curl theme={null} curl https://api.aioka.io/v1/eth/council \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "verdict": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "ruling": "ACCUMULATE", "confidence": 0.72, "agentVotes": { "VALIDATOR_ORACLE": {"ruling": "BUY", "confidence": 0.76}, "MACRO_SAGE": {"ruling": "ACCUMULATE", "confidence": 0.68}, "GAS_FEE_ANALYST": {"ruling": "BUY", "confidence": 0.74}, "MOMENTUM_HUNTER": {"ruling": "BUY", "confidence": 0.79}, "DEFI_LIQUIDITY_WARDEN": {"ruling": "ACCUMULATE", "confidence": 0.65}, "RISK_WARDEN": {"ruling": "HOLD", "confidence": 0.58} }, "chiefRationale": "Validator network healthy, gas fees rising, momentum aligned. RISK_WARDEN's HOLD dissent reflects elevated ETH/BTC spread uncertainty. Confidence trimmed to 0.72.", "plainExplanation": "The council leaned moderately bullish because Ethereum's network activity and staking health are strengthening while macro conditions stay supportive. Momentum is firm but not extreme, so the stance is a measured accumulate rather than an aggressive buy.", "snapshotSignals": { "eth_price": 3265.0, "rsi_1h": 52.4, "ema_200": 3210.5, "fear_greed": 58, "staking_apy": 3.82 }, "createdAt": "2026-05-06T08:30:00+00:00" }, "nextRefreshMinutes": 30 } ``` # ETH Ghost Trader Status Source: https://docs.aioka.io/api-reference/eth/status GET /v1/eth/status Live ETH Ghost Trader status โ€” current trade, latest verdict, regime, RSI, EMA > [!NOTE] > > This endpoint is public โ€” no API key required. Powers the ETH panel > on aioka.io/live. (Sprint 258 โ€” first multi-asset expansion after BTC.) **Tier:** Public โœ… **Cache:** 60 s (Redis response cache) **Read-only:** Never writes to any trading table. > โš ๏ธ This is a paper-trading status snapshot, not financial advice. > AIOKA ETH Ghost Trader is a simulation. Never make real financial > decisions based solely on this signal. > [!WARNING] > > Since 2026-10-04 only the Bitcoin council runs. While the ETH council is paused this > endpoint answers `"status": "PAUSED"` with no verdict and no trade data, instead of > serving its last (stale) verdict. (Sprint 414) ## Response Fields | Field | Type | Meaning | | - | - | - | | `status` | string | `"WAITING"` (no open ETH trade) or `"IN_TRADE"`, or `"PAUSED"` when this council is paused (no verdict is returned) | | `currentTrade` | object \| null | Open ETH trade details when `status == "IN_TRADE"` | | `currentTrade.entryPrice` | number | ETH entry price (USD) | | `currentTrade.sizeEth` | number | Position size in ETH | | `currentTrade.pnlUsd` | number | Live P\&L in USD | | `currentTrade.pnlPct` | number | Live P\&L as % of position cost | | `currentTrade.tp1Hit` | bool | Whether TP1 partial close has fired | | `currentTrade.stopLoss` | number | Stop loss price (USD). Reads from `eth_ghost_trades.stop_loss`; falls back to `entryPrice ร— 0.975` when NULL | | `currentTrade.tp1Target` | number | TP1 target price = `entryPrice ร— 1.015` (+1.5%) | | `currentTrade.tp2Target` | number | TP2 target price = `entryPrice ร— 1.035` (+3.5%) | | `latestVerdict` | object \| null | Latest ETH council verdict | | `latestVerdict.ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` | | `latestVerdict.confidence` | number | 0.0โ€“1.0 | | `latestVerdict.createdAt` | string | ISO 8601 timestamp | | `regime` | string \| null | Market regime (e.g. `ACCUMULATION`) | | `rsi1h` | number \| null | ETH 1H RSI | | `ema200` | number \| null | ETH 1H EMA(200) | | `ethPrice` | number \| null | Latest ETH/USD | | `generatedAt` | string | Response timestamp | ```bash curl theme={null} curl https://api.aioka.io/v1/eth/status ``` ```json 200 theme={null} { "status": "WAITING", "currentTrade": null, "latestVerdict": { "ruling": "ACCUMULATE", "confidence": 0.72, "createdAt": "2026-04-28T10:15:00+00:00" }, "regime": "ACCUMULATION", "rsi1h": 52.4, "ema200": 3210.5, "ethPrice": 3265.0, "generatedAt": "2026-04-28T10:30:00+00:00" } ``` # ETH Ghost Trader Track Record Source: https://docs.aioka.io/api-reference/eth/track-record GET /v1/eth/track-record Full validated ETH trade history with derived performance stats > [!NOTE] > > Public endpoint โ€” no API key required. Powers the ETH tab on > aioka.io/track-record. (Sprint 258 โ€” first multi-asset expansion after BTC.) **Tier:** Public โœ… **Cache:** 5 min (Redis response cache) **Read-only:** No writes. โš ๏ธ **Paper-trading data.** AIOKA ETH Ghost Trader is a simulation and never places real orders. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `trades` | array | Closed validated ETH trades, oldest first | | `stats.totalTrades` | int | Count of closed validated trades | | `stats.winRate` | number | % of trades with `pnlUsd > 0` | | `stats.totalPnl` | number | Cumulative USD P\&L | | `stats.avgHoldMinutes` | number | Average hold duration | | `stats.bestTrade` | number | Best single-trade P\&L | | `stats.worstTrade` | number | Worst single-trade P\&L | ### Per-trade | Field | Type | Meaning | | - | - | - | | `id` | string | UUID | | `entryTime` / `exitTime` | string | ISO 8601 | | `entryPrice` / `exitPrice` | number | USD | | `sizeEth` | number | Position size | | `pnlUsd` | number | Total P\&L (entry-to-exit, includes TP1 partial when applicable) | | `pnlPct` | number | P\&L as % of position cost | | `tp1PnlUsd` | number \| null | TP1 partial P\&L when TP1 fired | | `result` | string | `"WIN"` / `"LOSS"` | | `mode` | string | Entry mode (`A` / `B` / `C`) | ```bash curl theme={null} curl https://api.aioka.io/v1/eth/track-record ``` ```json 200 theme={null} { "trades": [], "stats": { "totalTrades": 0, "winRate": 0.0, "totalPnl": 0.0, "avgHoldMinutes": 0.0, "bestTrade": 0.0, "worstTrade": 0.0 } } ``` ## Track Record Restart ETH track record begins at first ETH trade close โ€” the table is empty until the first validated ETH trade lands. (BTC track record similarly restarted on Apr 12 2026 per Sprint 164.1 clean slate.) # EUR/USD Forex Ghost Trader Status Source: https://docs.aioka.io/api-reference/forex/eurusd/status GET /v1/forex/eurusd/status Live EUR/USD Forex Ghost Trader status -- current trade, latest verdict, regime, RSI, EMA, live spread (Gate 8), session label, 6 specialist agent votes, all 9 entry gates > [!NOTE] > > This endpoint is public -- no API key required. Powers the EUR/USD panel > on aioka.io/live. (Sprint 186 -- first non-crypto, non-commodity asset.) **Tier:** Public (no auth) **Cache:** 60 s (Redis response cache) **Read-only:** Never writes to any trading table. > EUR/USD council uses 6 specialist agents unique to Forex: > MACRO\_SAGE (VETO), TECH\_ANALYST, SESSION\_GUARDIAN (VETO), > FLOW\_WARDEN, MOMENTUM\_HUNTER, RISK\_WARDEN (VETO). > Three veto agents -- AVOID confidence > 0.7 forces a hard AVOID > regardless of the chief judge ruling. EUR/USD is more macro-sensitive > than any other AIOKA asset, hence the extra VETO compared to ETH/Gold. > โš ๏ธ This is a paper-trading status snapshot, not financial advice. > AIOKA EUR/USD Ghost Trader is a simulation in Sprint 186. Never make > real financial decisions based solely on this signal. ## Sprint 186 field-naming convention This endpoint returns **snake\_case** field names exclusively. No camelCase aliases. Other AIOKA endpoints (ETH / SOL / TAO / Gold) use camelCase aliases via Pydantic populate\_by\_name; EUR/USD does not. TypeScript clients should write interfaces matching exactly what the JSON contains. > [!WARNING] > > Since 2026-10-04 only the Bitcoin council runs. While the EUR/USD council is paused this > endpoint answers `"status": "PAUSED"` with no verdict and no trade data, instead of > serving its last (stale) verdict. (Sprint 414) ## Response Fields EUR/USD evaluates **9 entry gates** (Gate 0 news blackout through Gate 8 spread). Gates 0, 7, and 8 are unique to EUR/USD vs crypto: * Gate 0 (news blackout) blocks entry around FOMC, NFP, CPI, ECB, Fed Chair Speech, FOMC Minutes (TIER-1 = full-day block; TIER-2 = ยฑN min symmetric window). * Gate 7 (session) blocks entry outside London / NY / Overlap (Tokyo and Sydney sessions are intentionally blocked for EUR/USD due to thin liquidity). * Gate 8 (spread) blocks entry when live ZEURZUSD spread is >= 2 pips (microstructure stress signal). ### Top-level | Field | Type | Meaning | | - | - | - | | `status` | string | `"WAITING"` (no open EUR/USD trade) or `"IN_TRADE"`, or `"PAUSED"` when this council is paused (no verdict is returned) | | `current_trade` | object \| null | Open EUR/USD trade details when `status == "IN_TRADE"` | | `latest_verdict` | object \| null | Latest EUR/USD council verdict with agent votes | | `regime` | string \| null | Market regime (e.g. `ACCUMULATION`, `BULL_TRENDING`, `RECOVERY`) | | `rsi_1h` | number \| null | EUR/USD 1H RSI | | `ema_200` | number \| null | EUR/USD 1H EMA(200), 5 decimal places | | `eurusd_price` | number \| null | Latest EUR/USD spot price (last trade), 5 dp | | `eurusd_bid` | number \| null | Live best bid (5 dp) | | `eurusd_ask` | number \| null | Live best ask (5 dp) | | `spread_pips` | number \| null | Live (ask - bid) in pips. Must be \< 2.0 for Gate 8 to pass. | | `session_label` | string | `"LONDON"` / `"OVERLAP"` / `"NEW_YORK"` / `"WEEKEND"` / `"CLOSED"`. Entry only during London / Overlap / NY. | | `paper_trades_validated` | int | Count of closed validated EUR/USD paper trades (0 -- 10 milestone before live capital). | | `paper_mode` | bool | `true` while EUR/USD is in paper mode. Becomes `false` after 10 validated paper closes AND post-validation approval. | | `generated_at` | string | Response timestamp (ISO 8601 UTC) | | `gates` | object | Per-gate boolean evaluator (9 gates for EUR/USD) | ### current\_trade fields (when `status == "IN_TRADE"`) | Field | Type | Meaning | | - | - | - | | `entry_price` | number | EUR/USD entry price (5 dp) | | `size_units` | number | Position size in base-currency units (EUR) | | `pnl_usd` | number | Live P\&L in USD | | `pnl_pips` | number | Live P\&L in pips (Forex-native unit) | | `tp1_hit` | bool | Whether TP1 partial close has fired | | `stop_loss` | number | Stop loss price (5 dp). Hard stop = entry ร— 0.995 (0.50% / \~50 pips floor) | | `tp1_price` | number | TP1 target price = entry ร— 1.003 (+0.30% / \~30 pips) | | `tp2_price` | number | TP2 target price = entry ร— 1.007 (+0.70% / \~70 pips) | | `hwm` | number \| null | High-water mark for TSL ratchet | | `session` | string \| null | Session label at entry (`LONDON`/`OVERLAP`/`NEW_YORK`) | | `spread_at_entry` | number \| null | Live spread in pips at entry fill (Gate 8 audit) | ### latest\_verdict fields | Field | Type | Meaning | | - | - | - | | `ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `AVOID` | | `confidence` | number | 0.0 -- 1.0. Entry requires confidence โ‰ฅ 0.65. | | `agent_votes` | object | Per-agent verdict from all 6 specialist agents | | `agent_votes.` | object | Each agent entry has `ruling` and `confidence` | | `plain_explanation` | string \| null | Plain-English, jargon-free 2-3 sentence summary of WHY the council reached its ruling, synthesized by the Chief Judge in the same call. `null` for historical verdicts recorded before this feature. | | `created_at` | string | ISO 8601 timestamp of verdict | ### gates fields | Field | Type | Meaning | | - | - | - | | `news_blackout` | bool | Gate 0 -- no high-impact macro event within window | | `judiciary` | bool | Gate 1 -- Judiciary Agent bullish | | `council` | bool | Gate 2 -- EUR/USD council โ‰ฅ 65% confidence and bullish | | `ema_proximity` | bool | Gate 3 -- price +0.05% to +0.30% above EMA 200 | | `regime` | bool | Gate 4 -- regime is ACCUMULATION / BULL\_TRENDING / RECOVERY | | `quality` | bool | Gate 5 -- composite quality score โ‰ฅ 65 | | `momentum` | bool | Gate 6 -- 1H momentum not FALLING | | `session` | bool | Gate 7 -- inside London / NY / Overlap; weekend hard block | | `spread` | bool | Gate 8 -- live ZEURZUSD spread \< 2 pips | | `session_label` | string | Current session label (see top-level fields) | | `spread_pips` | number \| null | Live spread (Gate 8 input) | | `macro_event_clear` | bool | Gate 0 outcome (TRUE = no event in window) | | `gates_met` | int | Count of passing gates (0 -- 9) | | `trigger` | string \| null | Description of the first failing gate, or `null` when all 9 pass | ## Specialist Agents (6) | Agent | Weight | Veto | Domain | | - | - | - | - | | `MACRO_SAGE` | 0.25 | โœ… | Fed-ECB rate diff, DXY, US-EU surprise, macro event proximity | | `TECH_ANALYST` | 0.20 | -- | RSI multi-timeframe, MACD, Bollinger Bands, EMA 200 distance | | `SESSION_GUARDIAN` | 0.20 | โœ… | Session detection, spread, weekend block, vol ratio | | `FLOW_WARDEN` | 0.15 | -- | CFTC COT institutional positioning, DXY momentum | | `MOMENTUM_HUNTER` | 0.10 | -- | 1H momentum, MTF alignment, tick activity heuristic | | `RISK_WARDEN` | 0.10 | โœ… | Hard stop math, TSL monotonicity, BE Shield, weekend gap, drawdown | Three VETO agents (vs ETH's two and Gold's two): AVOID with confidence > 0.7 from any of MACRO\_SAGE, SESSION\_GUARDIAN, or RISK\_WARDEN forces a > council ruling of AVOID regardless of the chief judge synthesis. ## EUR/USD-specific risk flags The council surfaces these risk flags on the verdict object (visible in the internal `/eurusd_council` Telegram command output; not persisted on the public verdict row): * `MACRO_HEADWIND` -- DXY rising or rate differential bearish * `SESSION_BLOCKED` -- outside London / NY / Overlap or weekend approaching * `SPREAD_RISK` -- live spread >= 1.5 pips (approaching 2-pip Gate 8) * `MACRO_EVENT_IMMINENT` -- high-impact event within 30 min * `WEEKEND_GAP_RISK` -- Friday afternoon, insufficient exit runway * `USD_STRENGTH` -- DXY 7d change > +1% # EUR/USD Forex Ghost Trader Track Record Source: https://docs.aioka.io/api-reference/forex/eurusd/track-record GET /v1/forex/eurusd/track-record Full EUR/USD Forex trade history with derived stats. Paper-trading data; AIOKA EUR/USD runs in paper mode until 10 validated paper trades close. > [!NOTE] > > This endpoint is public -- no API key required. Powers the EUR/USD tab > on aioka.io/track-record. (Sprint 186 -- first non-crypto, non-commodity > asset.) **Tier:** Public (no auth) **Cache:** 5 min (Redis response cache) **Read-only:** Pure read of `forex_eurusd_trades` table. > โš ๏ธ Paper-trading data. AIOKA EUR/USD Ghost Trader is a simulation in > Sprint 186. Live capital does not flow through this loop until 10 > validated paper trades have closed AND post-validation approval is > documented. ## Sprint 186 field-naming convention This endpoint returns **snake\_case** field names exclusively. No camelCase aliases. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `trades` | array | List of closed validated EUR/USD trades, oldest first | | `stats` | object | Derived performance statistics | ### trades\[i] fields | Field | Type | Meaning | | - | - | - | | `id` | string | Trade UUID | | `entry_time` | string | ISO 8601 entry timestamp | | `exit_time` | string | ISO 8601 exit timestamp | | `entry_price` | number | Entry price (5 dp) | | `exit_price` | number | Exit price (5 dp) | | `size_units` | number | Position size in base-currency units (EUR) | | `pnl_usd` | number | Total P\&L in USD (TP1 partial + final exit) | | `pnl_pips` | number | Total P\&L in pips (Forex-native unit) | | `pnl_pct` | number | P\&L as % of position cost | | `tp1_pnl_usd` | number \| null | TP1 partial-sell locked P\&L in USD (null if TP1 didn't fire) | | `session` | string \| null | Session label at entry (`LONDON`/`OVERLAP`/`NEW_YORK`) | | `spread_at_entry` | number \| null | Live spread in pips at entry fill (Gate 8 audit) | | `is_paper` | bool | Always `true` until live mode unlocked | | `result` | string | `"WIN"` (pnl\_usd > 0) or `"LOSS"` | | `mode` | string | Entry mode (`"B"` = Balanced, currently the only mode) | ### stats fields | Field | Type | Meaning | | - | - | - | | `total_trades` | int | Count of closed validated trades | | `validated_paper_trades` | int | Closed validated paper trades (0 -- 10 milestone) | | `paper_validation_target` | int | 10 -- closed validated paper trades required before live mode | | `win_rate` | number | Percentage 0 -- 100 | | `total_pnl_usd` | number | Sum of pnl\_usd across all trades | | `total_pnl_pips` | number | Sum of pnl\_pips across all trades | | `avg_hold_minutes` | number | Mean hold duration | | `best_trade_usd` | number | Max pnl\_usd | | `worst_trade_usd` | number | Min pnl\_usd | ## Why P\&L in both pips AND USD? EUR/USD performance has two natural units: * **Pips** -- the Forex-native unit. Lets you compare EUR/USD performance across days regardless of position size and across pairs (a 30-pip EUR/USD trade is comparable in technical-execution terms to a 30-pip GBP/USD trade). * **USD** -- the portfolio-comparable unit. Lets you stack EUR/USD P\&L alongside crypto / Gold P\&L on the same scale. Both are persisted at trade close so analytical tools can pivot on either without re-deriving from the other. # Performance by Regime (Multi-Asset) Source: https://docs.aioka.io/api-reference/ghost/regime-performance GET /v1/ghost/regime-performance Ghost Trader win rate and P&L aggregated by market regime across all 7 councils ## Overview Returns Ghost Trader performance aggregated by market regime across **all 7 councils** โ€” BTC, ETH, SOL, ADA, TAO, Gold, EUR/USD. Each validated closed trade carries the regime label that was persisted at entry time; the endpoint UNIONs every per-asset table and groups by regime so the aioka.io "Performance by Regime" widget can paint a single chart spanning the whole system. **Tier:** Public โœ… โ€” No API key required **Cache TTL:** 300 seconds (5 min) **Rate limit:** 60 calls / IP / minute > [!NOTE] > > Only validated closed trades with a non-NULL regime are counted. Legacy > rows that lack a regime label simply do not appear in any bucket โ€” they do > not break the response. Each asset writes its **own native** regime: BTC / > ETH / SOL / ADA / TAO read from `regime_history`; Gold writes Gold-native > regimes (`SAFE_HAVEN_DEMAND`, `INFLATION_HEDGE`, โ€ฆ) via its dedicated > detector; EUR/USD writes the same way. ## Response Fields | Field | Type | Description | | - | - | - | | `regimes` | array | Per-regime rows, sorted by `trades` DESC, then `win_rate` DESC | | `total_trades` | integer | Sum of trades across all regimes (excludes NULL-regime trades) | | `assets_included` | array of strings | Asset tables that contributed (`["BTC","ETH","SOL","ADA","TAO","GOLD","EURUSD"]`) | | `since` | string | Clean-slate cutoff date (`"2026-04-12"`) | | `generated_at` | string | UTC ISO timestamp | | `cached` | boolean | Whether response was served from cache | | `cache_ttl_seconds` | integer | Cache TTL | ### Per-regime row | Field | Type | Description | | - | - | - | | `regime` | string | Regime label (e.g. `BULL_TRENDING`, `SAFE_HAVEN_DEMAND`) | | `trades` | integer | Total trades closed in this regime | | `wins` | integer | Trades with `pnl > 0` | | `losses` | integer | Trades with `pnl <= 0` | | `win_rate` | float | **Fraction 0.0โ€“1.0** (e.g. `0.833` = 83.3%) | | `avg_pnl_pct` | float | Mean PnL per trade as percentage points (`1.24` = +1.24%) | | `total_pnl` | float | Cumulative USD PnL within this regime | > [!WARNING] > > `win_rate` is a fraction (0.0โ€“1.0), not a percentage (0โ€“100). Multiply by > 100 for display. This differs from `/v1/regime/stats` which returns the > percentage form for BTC-only. ```bash curl theme={null} curl https://api.aioka.io/v1/ghost/regime-performance ``` ```python Python theme={null} import httpx resp = httpx.get("https://api.aioka.io/v1/ghost/regime-performance") for row in resp.json()["regimes"]: print(f"{row['regime']:<22} trades={row['trades']:>3} " f"win_rate={row['win_rate'] * 100:5.1f}% " f"pnl=${row['total_pnl']:>8.2f}") ``` ```typescript TypeScript (Next.js SSR) theme={null} export const revalidate = 300; // ISR โ€” W-1 compliant export default async function Page() { const data = await fetch( "https://api.aioka.io/v1/ghost/regime-performance", { next: { revalidate: 300 } }, ).then(r => r.json()); return ; } ``` ```json 200 theme={null} { "regimes": [ { "regime": "BULL_TRENDING", "trades": 12, "wins": 10, "losses": 2, "win_rate": 0.833, "avg_pnl_pct": 1.24, "total_pnl": 847.50 }, { "regime": "WHALE_ACCUMULATION", "trades": 4, "wins": 3, "losses": 1, "win_rate": 0.75, "avg_pnl_pct": 0.92, "total_pnl": 312.10 }, { "regime": "SAFE_HAVEN_DEMAND", "trades": 2, "wins": 2, "losses": 0, "win_rate": 1.0, "avg_pnl_pct": 1.85, "total_pnl": 124.40 } ], "total_trades": 18, "assets_included": ["BTC", "ETH", "SOL", "ADA", "TAO", "GOLD", "EURUSD"], "since": "2026-04-12", "generated_at": "2026-05-13T10:00:00Z", "cached": false, "cache_ttl_seconds": 300 } ``` # Ghost Trader Signal Source: https://docs.aioka.io/api-reference/ghost/signal GET /v1/ghost/signal Current entry signal from AIOKA Ghost Trader > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires PRO tier key (\$199/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Pro (\$199/mo) ๐Ÿ”’ **Cache TTL:** 30 seconds > โš ๏ธ This is a paper-trading signal, not financial advice. > Ghost Trader is a simulation. Never make real financial decisions > based solely on this signal. ## Signal Values | Signal | Meaning | | - | - | | `ENTER` | All 7 entry conditions met | | `HOLD` | Conditions not fully met | | `IN_POSITION` | Ghost Trader has an open trade | ```bash curl theme={null} curl https://api.aioka.io/v1/ghost/signal \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "signal": "HOLD", "entry_mode": "B", "conditions_met": 5, "conditions_required": 7, "entry_quality": null, "has_open_position": false, "rsi": 42.3, "ema_distance_pct": 0.85, "regime": "BULL_TRENDING", "timestamp": "2026-04-03T10:22:00Z", "cached": false, "cache_ttl_seconds": 30 } ``` # Ghost Trader Stats Source: https://docs.aioka.io/api-reference/ghost/stats GET /v1/ghost/stats Public validated trade count since production launch ## Overview Returns the count of validated (real, non-synthetic) Ghost Trader trades since the Sprint 164 deployment on 2026-04-12 (clean-slate track record restart). Used by the aioka.io website for public track record display. **Tier:** Public โœ… โ€” No API key required **Cache:** 300s (Redis) **Rate limit:** None ## Response Fields | Field | Type | Description | | - | - | - | | `validated_trades` | integer | Number of validated trades with `is_valid=true` since launch | | `since` | string | Track record restart date (`"2026-04-12"`) | | `total_pnl` | float | Sum of P\&L (USD) across all validated closed trades. Returns `0.0` if no closed trades. | | `win_rate` | float | Percentage of validated closed trades that were profitable (0.0โ€“100.0). Returns `0.0` if no closed trades. | > [!NOTE] > > Only trades marked `is_valid=true` are included in all calculations. Backfilled, synthetic, or > test trades are excluded. `total_pnl` and `win_rate` are computed from **closed** validated trades only โ€” > an open position is counted in `validated_trades` but not in P\&L or win rate until it closes. ```bash curl theme={null} curl https://api.aioka.io/v1/ghost/stats ``` ```python Python theme={null} import httpx resp = httpx.get("https://api.aioka.io/v1/ghost/stats") data = resp.json() print(f"{data['validated_trades']} validated trades") print(f"Win rate: {data['win_rate']}% | Total P&L: ${data['total_pnl']:.2f}") ``` ```json 200 theme={null} { "validated_trades": 3, "since": "2026-04-12", "total_pnl": 155.77, "win_rate": 67.0, "sprint": 336, "tests_passing": 5320 } ``` # Ghost Trader Status Source: https://docs.aioka.io/api-reference/ghost/status GET /v1/ghost/status Live 7-condition Ghost Trader entry gate breakdown > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Don't have a key? [Get one free โ†’](/api-reference/keys/generate) **Tier:** Pro โœ… **Cache TTL:** 60 seconds > โš ๏ธ This is a status snapshot, not financial advice. > AIOKA Ghost Trader is a paper-trading simulation. Never make real financial > decisions based solely on this signal. ## Gate Results | Value | Meaning | | - | - | | `conditions_met == 7` | All hard gates pass โ€” Ghost Trader would enter | | `conditions_met < 7` | One or more gates failing โ€” waiting for alignment | | `has_open_position == true` | Ghost Trader already holds an open trade | ## Open trade fields Present when `has_open_position` is `true` (practice trade, paper money): | Field | Meaning | | - | - | | `entry_price` / `current_price` | Fill price and latest BTC price (USD) | | `pnl_pct` | Price move since entry, in percent | | `pnl_usd` | Unrealized P\&L in USD on the practice position still open (after TP1, the remaining half) | | `tp1_executed` | `true` once the first take-profit closed half the position (stop moved to break-even) | | `tp1_pnl` | Profit locked by TP1 in USD (`null` before TP1) โ€” total trade P\&L = `tp1_pnl` + `pnl_usd` | | `stop_loss` / `tp1_price` / `tp2_target` | Current stop and the two take-profit levels (USD) | When no trade is open, `entry_price`, `stop_loss`, `tp1_price` and `tp2_target` carry the proposed levels for the next entry. ```bash curl theme={null} curl https://api.aioka.io/v1/ghost/status \ -H "X-API-Key: aik_pro_yourkeyhere" ``` ```json 200 theme={null} { "judiciary_ok": true, "council_ok": true, "ema_ok": true, "regime_favorable": true, "session_favorable": true, "momentum_ok": true, "quality_ok": true, "conditions_met": 7, "conditions_required": 7, "ema_distance_pct": 0.85, "current_rsi": 38.2, "regime": "WHALE_ACCUMULATION", "council_ruling": "BUY", "council_confidence": 0.78, "entry_mode": "B", "council_mode": "council", "has_open_position": false, "btc_price": 72340.5, "generated_at": "2026-04-13T08:22:00Z", "cached": false, "cache_ttl_seconds": 60 } ``` # Ghost Trader Track Record Source: https://docs.aioka.io/api-reference/ghost/track-record GET /v1/ghost/track-record Full validated trade history with per-trade detail, aggregates, and equity curve ## Overview Returns the complete Ghost Trader track record since the Sprint 164 clean-slate restart (2026-04-12 17:55 UTC). Powers the [aioka.io/track-record](https://aioka.io/track-record) page. Every field is JSON-encoded in **camelCase** to match the website TypeScript interface one-for-one. Only trades with `is_valid = true` and `status = 'CLOSED'` are included. Backfilled, synthetic, and open trades are excluded. `/v1/ghost/stats` remains the lightweight 5-field homepage widget endpoint โ€” this endpoint is the full-history counterpart. **Tier:** Public โœ… โ€” No API key required **Cache:** 300s (Redis) **Rate limit:** None ## Response Fields โ€” Aggregates | Field | Type | Description | | - | - | - | | `validatedTrades` | integer | Number of closed validated trades in the history | | `tradingMode` | string | `"LIVE"` once any trade has a real Kraken fill, otherwise `"PAPER"` | | `winRate` | float | Percentage of validated closed trades that were profitable (0.0โ€“100.0) | | `totalPnlUsd` | float | Sum of P\&L (USD) across all validated closed trades | | `avgHoldTimeMinutes` | float | Mean hold duration across all validated trades | | `bestTradeUsd` | float | Best single-trade P\&L | | `worstTradeUsd` | float | Worst single-trade P\&L | | `avgPnlPerTrade` | float | Mean P\&L per trade | | `since` | string | Track record restart date (`"2026-04-12"`) | | `trades` | array | Per-trade detail (see below) | | `equityCurve` | array | Cumulative P\&L points for charting | ## Response Fields โ€” Each Trade | Field | Type | Description | | - | - | - | | `id` | string | Trade UUID | | `entryTime` | string (ISO 8601) | UTC entry timestamp | | `exitTime` | string (ISO 8601) | UTC exit timestamp | | `entryPrice` | float | BTC price at entry (USD) | | `exitPrice` | float | BTC price at exit (USD) | | `holdTimeMinutes` | integer | Trade duration in minutes | | `pnlUsd` | float | Total trade P\&L including TP1 partial | | `pnlPercent` | float | Percentage move from entry to exit | | `result` | string | `"WIN"` or `"LOSS"` | | `mode` | string | Entry mode โ€” `"A"`, `"B"`, or `"C"` | | `tp1Hit` | boolean | Whether TP1 fired during the trade | | `exitReason` | string | Human-readable exit cause (`"TP2 (Final Exit โ€” Remaining 50%)"`, `"TSL"`, `"Stop Loss"`, etc.) | | `entryConditions` | object \| null | Entry snapshot โ€” `councilVerdict`, `rsi`, `emaDistance`, `confidence` | ## Response Fields โ€” Equity Curve Point | Field | Type | Description | | - | - | - | | `date` | string | Exit timestamp for this point | | `cumulativePnl` | float | Running total P\&L up to and including this trade | | `tradeId` | string \| null | Trade UUID for cross-reference | | `result` | string \| null | `"WIN"` or `"LOSS"` | > [!NOTE] > > P\&L accounting includes both the TP1 partial close and the final exit. A trade where > TP1 locked +$670 and the remaining 50% exited at โˆ’$268 reports `pnlUsd = 401.35`. ```bash curl theme={null} curl https://api.aioka.io/v1/ghost/track-record ``` ```python Python theme={null} import httpx resp = httpx.get("https://api.aioka.io/v1/ghost/track-record") data = resp.json() print(f"{data['validatedTrades']} validated trades โ€” mode: {data['tradingMode']}") print(f"Win rate: {data['winRate']}% | Total P&L: ${data['totalPnlUsd']:.2f}") for t in data["trades"]: print(f" {t['id']} {t['result']} ${t['pnlUsd']:+.2f} ({t['holdTimeMinutes']}m)") ``` ```json 200 theme={null} { "validatedTrades": 1, "tradingMode": "LIVE", "winRate": 100.0, "totalPnlUsd": 795.28, "avgHoldTimeMinutes": 1470.0, "bestTradeUsd": 795.28, "worstTradeUsd": 0.0, "avgPnlPerTrade": 795.28, "since": "2026-04-12", "trades": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "entryTime": "2026-04-12T20:00:00+00:00", "exitTime": "2026-04-13T20:30:00+00:00", "entryPrice": 71070.60, "exitPrice": 73329.50, "holdTimeMinutes": 1470, "pnlUsd": 795.28, "pnlPercent": 3.18, "result": "WIN", "mode": "A", "tp1Hit": true, "exitReason": "TP2 (Final Exit โ€” Remaining 50%)", "entryConditions": { "councilVerdict": "BUY", "rsi": 35.44, "emaDistance": 0.6577, "confidence": 0.82 } } ], "equityCurve": [ { "date": "2026-04-13T20:30:00+00:00", "cumulativePnl": 795.28, "tradeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "result": "WIN" } ] } ``` # Health Check Source: https://docs.aioka.io/api-reference/health GET /v1/health Public service health check โ€” no API key required ## Overview Public endpoint used by Railway for container health checks and uptime monitors. Returns service status, version, and environment. No authentication required. **Tier:** Public โœ… โ€” No API key required **Cache:** None ## Aliases The health check is available at multiple paths for convenience: | Path | Purpose | | - | - | | `GET /v1/health` | Primary health endpoint | | `GET /v1/health/live` | Railway liveness probe (same response, not in OpenAPI spec) | ## Response Fields | Field | Type | Description | | - | - | - | | `status` | string | Always `"ok"` when healthy | | `version` | string | Current API version | | `environment` | string | Deployment environment | | `timestamp` | string | Current UTC timestamp (ISO 8601) | ```bash curl theme={null} curl https://api.aioka.io/v1/health ``` ```python Python theme={null} import httpx resp = httpx.get("https://api.aioka.io/v1/health") print(resp.json()) ``` ```json 200 theme={null} { "status": "ok", "version": "1.0.0", "environment": "production", "timestamp": "2026-04-03T10:22:00Z" } ``` # Zapier / n8n Signal Source: https://docs.aioka.io/api-reference/integrations/zapier GET /v1/integrations/zapier/signal Compact signal payload for Zapier and n8n automation workflows. ## Overview The Zapier / n8n signal endpoint delivers a compact, flat JSON payload designed for automation platform polling. Use it to build Zaps or n8n workflows that trigger on new AIOKA verdicts โ€” without writing any code. **Tier:** Basic (\$49/mo) ๐Ÿ”’ **Cache TTL:** 60 seconds (server-side) **Rate limit:** Basic 1,000/day, 30/min. Pro 10,000/day, 100/min. *** ## Response Fields | Field | Type | Description | | - | - | - | | `id` | string | SHA-256\[:16] of `ruling:ruled_at`. Changes every time the verdict changes โ€” use this as Zapier's deduplication key | | `verdict` | string | Judiciary ruling: `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` / `PENDING` | | `confidence` | float | Judiciary composite confidence 0โ€“100 | | `regime` | string | Current HMM market regime | | `dark_pool` | int | Dark Pool composite score 0โ€“100, built only from inputs with real data (exchange flow 40%, stablecoin mint 35%, entity pressure 25%) and rescaled to 0โ€“100. Stablecoin mint and entity pressure currently have no data source, so today the score reflects exchange flow only. `0` when no input is available. | | `rsi` | float | BTC 1H RSI(14). 0 if unavailable | | `ema_200` | float | BTC 1H EMA(200). 0 if unavailable | | `btc_price` | float | Live BTC spot price. 0 if unavailable | | `ghost_status` | string | Ghost Trader status: `WAITING` or `IN_POSITION` | | `timestamp` | string | ISO 8601 datetime with Prague timezone offset, e.g. `2026-04-24T10:00:00+02:00` | | `readable_time` | string | Human-readable Prague CEST/CET time, e.g. `24 Apr 2026, 10:00 CEST` | *** ## Zapier Quick Start **1. Get your API key** Generate a Basic-tier key at `POST /v1/keys/generate` or upgrade at [aioka.io/pricing](https://aioka.io/pricing). **2. Create a Schedule trigger** In Zapier, create a new Zap with **Schedule by Zapier** โ†’ every **5 minutes**. **3. Add HTTP Request action** Add an **HTTP by Zapier** action: * **Method:** `GET` * **URL:** `https://api.aioka.io/v1/integrations/zapier/signal` * **Headers:** `X-API-Key: YOUR_KEY` **4. Add a Filter for new verdicts** Add a **Filter by Zapier** step: * **Only continue if** `id` **does not equal** the previous `id` Store the previous `id` in a Zapier Storage by Zapier step or use the built-in deduplication on the `id` field โ€” it changes every time the verdict changes. **5. Post to Slack or Telegram** Add a final action โ€” **Slack** or **Telegram**: * Message body: `AIOKA Verdict: {{verdict}} ({{confidence}}% confidence) โ€” {{readable_time}}` *** ## n8n Quick Start Import the ready-made n8n workflow template: 1. Download [n8n-workflow.json](/integrations/n8n-workflow.json) 2. Open n8n โ†’ **Workflows** โ†’ **Import from File** 3. Set the `X-API-Key` credential in the **HTTP Request** node 4. Activate the workflow See the full [n8n setup guide](/integrations/n8n) for step-by-step screenshots. *** ## Example Response ```json theme={null} { "id": "a1b2c3d4e5f6a7b8", "verdict": "ACCUMULATE", "confidence": 76.8, "regime": "LOW_VOLATILITY", "dark_pool": 65, "rsi": 49.5, "ema_200": 76196.0, "btc_price": 77882.0, "ghost_status": "WAITING", "timestamp": "2026-04-24T10:00:00+02:00", "readable_time": "24 Apr 2026, 10:00 CEST" } ``` *** ## Deduplication Strategy The `id` field is a SHA-256\[:16] fingerprint of `f"{ruling}:{ruled_at}"`. It is stable across the 60-second cache window and changes the instant a new verdict is issued. **Zapier:** Set up a **Filter** action that compares `id` to the previous stored value. Only continue when they differ. **n8n:** Use the built-in **IF node** with `={{$json.id}} !== {{$node["Set"].json.lastId}}`. *** ## Error Responses | Status | Error | Cause | | - | - | - | | `401` | `missing_api_key` | No `X-API-Key` header | | `401` | `invalid_api_key` | Key not found or inactive | | `403` | `tier_required` | Free tier key โ€” Basic or higher required | | `429` | `daily_limit_exceeded` | Daily quota exhausted | | `429` | `rate_limit_exceeded` | Per-minute burst exceeded | # Generate API Key Source: https://docs.aioka.io/api-reference/keys/generate POST /v1/keys/generate Generate a free tier API key instantly **Tier:** Public โ€” No API key required **Rate limit:** None (open endpoint) > โš ๏ธ Store your key safely โ€” it **cannot be recovered** after this response! # Cross-Asset Macro Correlation Source: https://docs.aioka.io/api-reference/macro/correlation GET https://api.aioka.io/v1/macro/correlation Assess how current macro conditions affect BTC using rules-based analysis. ## Overview Evaluates DXY, US 10Y Treasury yield, Gold (XAU), BTC-Nasdaq correlation, and BTC dominance. Returns a directional assessment and per-signal breakdown. **Tier:** Basic (\$49/mo) ๐Ÿ”’ **Cache TTL:** 300 seconds **Rate limit:** 1,000 calls/day, 30/minute ## Score Interpretation | btc\_macro\_score | overall\_assessment | | - | - | | โ‰ฅ 0.60 | BULLISH -- macro environment supports BTC | | 0.41โ€“0.59 | NEUTRAL -- mixed signals | | โ‰ค 0.40 | BEARISH -- macro headwinds for BTC | ## Signals Evaluated | Signal | Description | | - | - | | DXY | US Dollar Index -- falling dollar = BTC tailwind | | US10Y | 10-Year Treasury yield -- falling yields = lower opportunity cost | | XAU\_SPOT | Gold spot price -- spiking gold = risk-off headwind | | BTC\_NDX\_CORR | BTC-Nasdaq 7-day correlation | | BTC\_DOMINANCE | BTC market share -- rising dominance = capital rotation in | ```json theme={null} { "timestamp": "2026-04-18T10:00:00Z", "btc_macro_score": 0.70, "overall_assessment": "BULLISH", "signals": [ { "asset": "DXY", "current_value": 99.2, "trend": "FALLING", "btc_impact": "BULLISH", "explanation": "Dollar weakening supports BTC as alternative store of value" }, { "asset": "US10Y", "current_value": 4.25, "trend": "STABLE", "btc_impact": "NEUTRAL", "explanation": "Treasury yields stable -- no significant BTC pressure" }, { "asset": "XAU_SPOT", "current_value": 3280.0, "trend": "CONSOLIDATING", "btc_impact": "BULLISH", "explanation": "Gold volatility declining -- rotation to BTC historically follows" }, { "asset": "BTC_NDX_CORR", "current_value": 0.58, "trend": "RISING", "btc_impact": "BULLISH", "explanation": "High BTC-Nasdaq correlation with Nasdaq at ATH supports BTC" }, { "asset": "BTC_DOMINANCE", "current_value": 62.4, "trend": "RISING", "btc_impact": "BULLISH", "explanation": "Rising BTC dominance confirms early bull cycle positioning" } ], "summary": "Macro environment is broadly supportive of BTC.", "cached": false, "cache_ttl_seconds": 300 } ``` # Subscribe to Newsletter Source: https://docs.aioka.io/api-reference/newsletter/subscribe POST /v1/newsletter/subscribe Subscribe an email to the AIOKA newsletter โ€” public, no API key required ## Overview Public endpoint used by the newsletter signup form on `aioka.io`. Stores the email in the `newsletter_subscribers` table, sends a welcome email via Resend, and fires an admin Telegram notification. **Tier:** Public โœ… โ€” No API key required **Rate limit:** 3 requests per IP per hour ## Spam Protection * **Honeypot:** a hidden `website` field must be empty. Any non-empty value returns `400`. * **Rate limit:** 3 attempts per IP per hour (Redis-backed sliding window). * **Silent duplicate:** already-subscribed emails return `200` silently โ€” no error, no resent welcome email. This prevents email enumeration and harvesting attacks. ## Request Fields | Field | Type | Required | Description | | - | - | - | - | | `email` | string | โœ… | Valid email address, max 254 chars | | `name` | string | โŒ | Optional name, max 100 chars | | `website` | string | โŒ | Honeypot โ€” must be empty | ## Response Fields | Field | Type | Description | | - | - | - | | `message` | string | Confirmation message | ```bash curl theme={null} curl -X POST https://api.aioka.io/v1/newsletter/subscribe \ -H "Content-Type: application/json" \ -d '{"email": "user@example.com", "name": "Alice"}' ``` ```python Python theme={null} import httpx resp = httpx.post( "https://api.aioka.io/v1/newsletter/subscribe", json={"email": "user@example.com", "name": "Alice"}, ) print(resp.json()) ``` ```json 200 theme={null} { "message": "Successfully subscribed to newsletter" } ``` ```json 400 theme={null} { "detail": "Invalid email address" } ``` ```json 429 theme={null} { "detail": "Too many requests. Please try again later." } ``` ## What Happens Next 1. Your email is stored in the `newsletter_subscribers` table. 2. A welcome email is sent to you via Resend with the subject *"Welcome to AIOKA โ€” The Council Is Now Watching For You ๐Ÿ‘ป"*. 3. The AIOKA owner is notified via Telegram. 4. You'll start receiving verdicts, council rulings, and market intelligence directly from the Judiciary Engine. Visit [aioka.io/live](https://aioka.io/live) to watch the Council in real time. # Current Regime Source: https://docs.aioka.io/api-reference/regime/current GET /v1/regime/current Current HMM-detected market regime with enrichment > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Don't have a key? [Get one free โ†’](/api-reference/keys/generate) **Tier:** Free โœ… **Cache TTL:** 300 seconds (5 min) ## Regime States | Regime | Description | | - | - | | `BULL_TRENDING` | Strong uptrend with momentum | | `BEAR_TRENDING` | Strong downtrend with distribution | | `HIGH_VOLATILITY` | Elevated vol โ€” reduced sizing | | `DISTRIBUTION` | Smart money offloading | | `WHALE_ACCUMULATION` | Large entity accumulation | | `RISK_ON` | Risk appetite elevated | | `LOW_VOLATILITY` | Compression โ€” breakout pending | | `ACCUMULATION` | Stealth accumulation at support | ## Response Fields | Field | Type | Description | | - | - | - | | `regime` | string | Current regime label | | `confidence` | float | HMM confidence score (0โ€“1) | | `btc_price` | float \| null | BTC price at detection time | | `detected_at` | datetime \| null | When the regime was detected | | `cached` | bool | Whether response is from cache | | `cache_ttl_seconds` | int | Seconds remaining in cache | | `strength` | string \| null | `STRONG` / `MODERATE` / `WEAK` based on confidence | | `sub_regime` | string \| null | Granular sub-classification (e.g. `MOMENTUM_CONFIRMED`) | | `volatility_state` | string \| null | `EXPANDING` / `COMPRESSED` / `NORMAL` / `ELEVATED` / `CONTRACTING` | | `chop_score` | float \| null | Market choppiness 0.0 (trending) โ†’ 1.0 (choppy) | | `breakout_imminent` | bool \| null | `true` when `LOW_VOLATILITY` + confidence โ‰ฅ 0.70 | | `compatible_strategies` | string\[] \| null | Strategy types that suit this regime | | `incompatible_strategies` | string\[] \| null | Strategy types to avoid in this regime | | `transition_probabilities` | object \| null | Probability of transitioning to each next regime | | `regime_age_hours` | float \| null | Hours the current regime has been active | ```bash curl theme={null} curl https://api.aioka.io/v1/regime/current \ -H "X-API-Key: aik_free_your_key_here" ``` ```json 200 theme={null} { "regime": "BULL_TRENDING", "confidence": 0.84, "btc_price": 67124.0, "detected_at": "2026-04-03T10:00:00Z", "cached": true, "cache_ttl_seconds": 290, "strength": "STRONG", "sub_regime": "MOMENTUM_CONFIRMED", "volatility_state": "NORMAL", "chop_score": 0.22, "breakout_imminent": false, "compatible_strategies": ["momentum", "trend_following", "breakout", "dip_buying"], "incompatible_strategies": ["short_momentum", "mean_reversion"], "transition_probabilities": { "BULL_TRENDING": 0.72, "WHALE_ACCUMULATION": 0.18, "HIGH_VOLATILITY": 0.10 }, "regime_age_hours": 4.5 } ``` # Regime History Source: https://docs.aioka.io/api-reference/regime/history GET /v1/regime/history Paginated regime detection history (last 7 days) > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires BASIC tier key (\$49/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Basic (\$49/mo) ๐Ÿ”’ **Cache TTL:** 300 seconds ```bash curl theme={null} curl "https://api.aioka.io/v1/regime/history?page=1&per_page=48" \ -H "X-API-Key: aik_basic_your_key_here" ``` ```json 200 theme={null} { "regimes": [ { "regime": "BULL_TRENDING", "confidence": 0.84, "recorded_at": "2026-04-03T10:00:00Z" } ], "total": 336, "page": 1, "per_page": 48, "cached": false, "cache_ttl_seconds": 300 } ``` # Regime Performance Stats Source: https://docs.aioka.io/api-reference/regime/stats GET /v1/regime/stats Historical Ghost Trader win rate and P&L aggregated by market regime > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Don't have a key? [Get one free โ†’](/api-reference/keys/generate) **Tier:** Free โœ… **Cache TTL:** 300 seconds (5 min) **Rate limit:** Free 100/day, 2/min. Basic 1,000/day, 30/min. Pro 10,000/day, 100/min. Historical Ghost Trader performance broken down by HMM market regime. Only `is_valid=TRUE` validated trades since the 2026-04-12 clean-slate cutoff are counted. Regimes are sorted by win rate descending so the best-performing regime always appears first. Use this endpoint to understand which market conditions AIOKA's Ghost Trader performs best in โ€” and which regimes to watch out for. ## Response Fields | Field | Type | Description | | - | - | - | | `regimes` | array | Per-regime stats sorted by `win_rate` DESC | | `best_regime` | string \| null | Regime with the highest win rate (null when no trades) | | `worst_regime` | string \| null | Regime with the lowest win rate (null when no trades) | | `total_trades` | int | Total validated closed trades across all regimes | | `overall_win_rate` | float | Win rate across all regimes (0โ€“100) | | `since` | string | Clean-slate cutoff date (ISO 8601) | | `generated_at` | string | Human-readable Prague CEST/CET timestamp | | `cached` | bool | Whether the response was served from cache | | `cache_ttl_seconds` | int | Remaining cache TTL in seconds | ### RegimeStatsItem fields | Field | Type | Description | | - | - | - | | `regime` | string | HMM regime name (e.g. `BULL_TRENDING`, `HIGH_VOLATILITY`) | | `trades` | int | Total trades recorded in this regime | | `wins` | int | Winning trades (total P\&L > 0) | | `losses` | int | Losing trades (total P\&L โ‰ค 0) | | `win_rate` | float | Win rate 0โ€“100 | | `avg_pnl_pct` | float | Average P\&L % per trade | | `avg_hold_hours` | float | Average hold time in hours | | `total_pnl_usd` | float | Cumulative USD P\&L for this regime | ```bash curl theme={null} curl https://api.aioka.io/v1/regime/stats \ -H "X-API-Key: aik_free_yourkeyhere" ``` ```json 200 theme={null} { "regimes": [ { "regime": "BULL_TRENDING", "trades": 5, "wins": 4, "losses": 1, "win_rate": 80.0, "avg_pnl_pct": 2.14, "avg_hold_hours": 18.3, "total_pnl_usd": 1240.50 }, { "regime": "ACCUMULATION", "trades": 3, "wins": 2, "losses": 1, "win_rate": 66.7, "avg_pnl_pct": 1.08, "avg_hold_hours": 12.5, "total_pnl_usd": 485.20 } ], "best_regime": "BULL_TRENDING", "worst_regime": "HIGH_VOLATILITY", "total_trades": 8, "overall_win_rate": 62.5, "since": "2026-04-12", "generated_at": "24 Apr 2026, 10:00 CEST", "cached": false, "cache_ttl_seconds": 300 } ``` # Signal History Source: https://docs.aioka.io/api-reference/signals/history GET /v1/signals/history Historical values for any of the 27 signals > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires PRO tier key (\$199/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Pro (\$199/mo) ๐Ÿ”’ **Cache TTL:** 300 seconds ## Query Parameters | Parameter | Type | Default | Description | | - | - | - | - | | `signal_key` | string | `BTC_RSI` | Signal key (e.g. `FEAR_GREED_INDEX`) | | `page` | integer | `1` | Page number | | `per_page` | integer | `100` | Results per page (max 500) | ```bash curl theme={null} curl "https://api.aioka.io/v1/signals/history?signal_key=FEAR_GREED_INDEX&per_page=48" \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "items": [ { "recorded_at": "2026-04-03T10:00:00Z", "signal_key": "FEAR_GREED_INDEX", "display_name": "Fear & Greed Index", "value": 38.0 } ], "total": 720, "page": 1, "per_page": 48, "cached": false, "cache_ttl_seconds": 300 } ``` # Latest Signals Source: https://docs.aioka.io/api-reference/signals/latest GET /v1/signals/latest Current snapshot of all 27 market signals > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires BASIC tier key (\$49/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Basic (\$49/mo) ๐Ÿ”’ **Cache TTL:** 30 seconds ## Signal Categories * **On-chain**: SOPR, MVRV Z-Score, NUPL, Hash Ribbon, Exchange Flow * **Macro**: US10Y, DXY, Gold, BTC-NASDAQ Correlation * **Options**: Put/Call Ratio, DVOL, Options OI * **Liquidity**: Stablecoin Mint, Whale Flow, Entity Pressure * **Liquidation**: Directional Bias, Cascade Risk, Proximity Alert ## Signal status | `status` | Meaning | | - | - | | `LIVE` | Fresh value from a real data source | | `STALE` | Value is older than the signal's freshness window | | `DEAD` | No real data source right now โ€” the provider has no key or is running a stand-in. `value` is `null`; do not use it | `live_count`, `stale_count` and `dead_count` count the signals in each status; `coverage_pct` is the share that is `LIVE`. Signals currently reported `DEAD`: stablecoin mint (`STABLE_MINT`, `STABLECOIN_MINT_IMPULSE`), entity pressure (`ENTITY_PRESS`, `ENTITY_SELL_PRESSURE`) and long liquidations (`LONG_LIQUIDATIONS`). ## Macro Calendar The `macro_calendar` object reports the current ForexFactory economic-calendar status โ€” FOMC, Non-Farm Payrolls, and CPI awareness shared across all AIOKA councils. | Field | Description | | - | - | | `tier` | `NONE` / `TIER1` / `TIER2` / `TIER3` โ€” tier of the active or next event | | `event_name` | Name of the active or next high-impact event (`null` if none) | | `hours_until` | Hours until that event (`0.0` when an event is active now) | | `is_active` | `true` when a high-impact event is happening now | | `status` | `CLEAR` / `WATCH` / `WARNING` / `BLACKOUT` โ€” UI-ready summary | A `BLACKOUT` status (TIER-1 event) means every council is paused for the day. ```bash curl theme={null} curl https://api.aioka.io/v1/signals/latest \ -H "X-API-Key: aik_basic_your_key_here" ``` ```json 200 theme={null} { "signals": [ { "key": "BTC_RSI", "display_name": "BTC RSI (14)", "value": 42.3, "status": "LIVE", "last_updated": "2026-04-03T10:20:00Z" }, { "key": "FEAR_GREED_INDEX", "display_name": "Fear & Greed Index", "value": 38.0, "status": "LIVE", "last_updated": "2026-04-03T10:00:00Z" } ], "total_signals": 27, "live_count": 24, "stale_count": 2, "dead_count": 1, "coverage_pct": 88.9, "macro_calendar": { "tier": "NONE", "event_name": "Core CPI m/m", "hours_until": 19.4, "is_active": false, "status": "CLEAR" }, "timestamp": "2026-04-03T10:22:00Z", "cached": false, "cache_ttl_seconds": 30 } ``` # Adaptive Signal Weights Source: https://docs.aioka.io/api-reference/signals/weights GET /v1/signals/weights Per-signal, per-regime adaptive multipliers learned from recent Ghost Trader outcomes > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires PRO tier key (\$199/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Pro (\$199/mo) ๐Ÿ”’ **Cache TTL:** 300 seconds ## What this returns AIOKA applies a **learned multiplier** to every raw signal before the AI council and Judiciary Engine combine them into a verdict. This endpoint exposes those multipliers so Pro-tier clients can audit exactly how each signal is being weighted in the current market regime. Multipliers are updated every 6 hours from the outcomes of the most recent closed Ghost Trader trades. A multiplier above 1.0 means AIOKA currently amplifies that signal; below 1.0 means it is damped. ## Safeguards Every returned multiplier has passed the following guarantees at write time: * **Range**: clamped to `[0.30, 2.00]` โ€” no signal is fully suppressed and none is tripled. * **Data floor**: when `data_points < 10` the stored multiplier falls back to `1.0`. * **Gradual adjustment**: no multiplier shifts by more than 20% per update cycle. * **Regime isolation**: every row is keyed on `(signal_key, regime)` โ€” weights never bleed between regimes. ## Query parameters | Parameter | Required | Description | | - | - | - | | `regime` | optional | Filter to a single regime (e.g. `BULL_TRENDING`). Omit to return every regime. | ```bash curl theme={null} curl 'https://api.aioka.io/v1/signals/weights?regime=BULL_TRENDING' \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "regime": "BULL_TRENDING", "weights": [ { "signal_key": "BTC_RSI", "regime": "BULL_TRENDING", "multiplier": 1.32, "accuracy": 0.68, "data_points": 22, "last_updated": "2026-04-23T10:00:00Z" }, { "signal_key": "WHALE_FLOW", "regime": "BULL_TRENDING", "multiplier": 0.81, "accuracy": 0.41, "data_points": 18, "last_updated": "2026-04-23T10:00:00Z" } ], "avg_accuracy": 0.545, "window_size": 22, "last_updated": "2026-04-23T10:00:00Z", "cached": false, "cache_ttl_seconds": 300 } ``` # SOL Council Verdict Source: https://docs.aioka.io/api-reference/sol/council GET /v1/sol/council Latest SOL AI Council verdict with 6 specialist agent votes, confidence score, SOL-specific signal overlay, and network health context > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. The SOL council > runs 6 specialist agents tuned to Solana-specific intelligence > (Sprint SOL Phase 2). **Tier:** Pro (\$199/mo) **Cache:** None **Rate limit:** 30/min (per tier) **Read-only:** Never writes to any trading table. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `verdict` | object \| null | Latest SOL council verdict. `null` if no verdict has been produced yet (first 30 minutes after deploy). | | `nextRefreshMinutes` | int | Minutes until the next scheduled council auto-refresh. Always `30`. | ### verdict fields | Field | Type | Meaning | | - | - | - | | `id` | string | UUID of this verdict record | | `ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `AVOID` | | `confidence` | number | 0.0 -- 1.0. SOL entry threshold is confidence >= 0.65. | | `agentVotes` | object | Per-agent breakdown from all 6 SOL specialist agents | | `agentVotes.` | object | Each agent entry has `ruling` (string) and `confidence` (number) | | `chiefRationale` | string \| null | Chief Judge's plain-language explanation of the ruling and why agent disagreements were resolved as they were | | `plainExplanation` | string \| null | Plain-English, jargon-free 2-3 sentence summary of WHY the council reached its ruling, synthesized by the Chief Judge in the same call. `null` for historical verdicts recorded before this feature. | | `snapshotSignals` | object | Raw signal readings at the time of council deliberation (key-value pairs) | | `createdAt` | string | ISO 8601 timestamp of verdict | ## Specialist Agents The SOL council replaces the generic BTC agent personas with 6 specialists calibrated for Solana-specific intelligence. Each agent produces an independent ruling and confidence score. The Chief Judge aggregates all 6 votes into the final verdict. | Agent | Weight | Veto | Domain | | - | - | - | - | | `NETWORK_SENTINEL` | 0.20 | No | Solana TPS, network health, staking participation | | `MACRO_SAGE` | 0.15 | No | DXY, US10Y, BTC dominance, Fear & Greed, BTC trend | | `ECOSYSTEM_ANALYST` | 0.20 | No | DeFi TVL, memecoin activity, SOL/BTC ratio | | `MOMENTUM_HUNTER` | 0.20 | No | RSI 1H/4H, MACD, EMA distance, SOL funding rate | | `LIQUIDITY_GUARDIAN` | 0.10 | **Yes** | Funding rate squeeze, TPS execution risk, whale exchange flows | | `RISK_WARDEN` | 0.15 | **Yes** | Tail risks, network outages, memecoin crash risk, protocol exploits | The `agentVotes` object in every verdict response maps each agent name to its individual `ruling` and `confidence`. Disagreement between agents is reflected in the final confidence score -- unanimous verdicts carry the highest confidence. ## Veto Rules LIQUIDITY\_GUARDIAN and RISK\_WARDEN carry veto power. When either returns AVOID with confidence > 0.7, the council ruling becomes AVOID regardless of what the other four agents vote. Vetoes are enforced deterministically in Python -- never trusted to LLM compliance. | Veto Agent | Trigger | Effect | | - | - | - | | `LIQUIDITY_GUARDIAN` | AVOID + confidence > 0.7 | Council ruling forced to AVOID | | `RISK_WARDEN` | AVOID + confidence > 0.7 | Council ruling forced to AVOID | ```bash curl theme={null} curl https://api.aioka.io/v1/sol/council \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "verdict": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "ruling": "ACCUMULATE", "confidence": 0.70, "agentVotes": { "NETWORK_SENTINEL": {"ruling": "BUY", "confidence": 0.74}, "MACRO_SAGE": {"ruling": "HOLD", "confidence": 0.61}, "ECOSYSTEM_ANALYST": {"ruling": "ACCUMULATE", "confidence": 0.69}, "MOMENTUM_HUNTER": {"ruling": "BUY", "confidence": 0.76}, "LIQUIDITY_GUARDIAN": {"ruling": "ACCUMULATE", "confidence": 0.65}, "RISK_WARDEN": {"ruling": "ACCUMULATE", "confidence": 0.63} }, "chiefRationale": "Solana network TPS healthy at 3,200. MACRO_SAGE cautious on rising DXY. ECOSYSTEM_ANALYST confirms rising DeFi TVL and low memecoin euphoria -- early-cycle accumulation setup. Confidence trimmed to 0.70 reflecting macro uncertainty.", "plainExplanation": "The council turned cautious because Solana network health is steady but momentum has cooled and broader risk appetite is fading. With no strong bullish edge, the council preferred to wait rather than open new exposure.", "snapshotSignals": { "sol_price": 89.4, "rsi_1h": 52.1, "ema_200": 85.2, "sol_network_tps": 3200.0, "sol_defi_tvl_trend": 0.028, "sol_staking_participation": 0.72 }, "createdAt": "2026-05-06T08:30:00+00:00" }, "nextRefreshMinutes": 30 } ``` # SOL Live Signals Source: https://docs.aioka.io/api-reference/sol/signals GET /v1/sol/signals Latest readings of all 7 SOL-specific signals plus the Solana network health probe (Gate 0) > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. Fetches fresh > signal readings on every request (expect 1 -- 3 seconds response time). **Tier:** Pro (\$199/mo) **Cache:** None -- fetches fresh on every request **Rate limit:** 30/min (per tier) **Read-only:** No writes. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `signals` | array | Latest readings for each SOL signal, one entry per signal key | | `networkHealth` | string | Gate 0 result: `"HEALTHY"` / `"DEGRADED"` / `"UNKNOWN"`. `DEGRADED` blocks all SOL entries. | | `networkTps` | number \| null | Current Solana network throughput (TPS) from `getRecentPerformanceSamples`. `null` when probe fails. | | `generatedAt` | string | Response timestamp (ISO 8601) | ### Per-signal (signals array) | Field | Type | Meaning | | - | - | - | | `key` | string | Signal identifier (see signal catalog below) | | `value` | number \| null | Latest numeric reading. `null` when the source is temporarily unavailable. | | `direction` | string | `"BULLISH"` / `"BEARISH"` / `"NEUTRAL"` / `"UNKNOWN"` | | `source` | string | Data source identifier | | `detail` | string | Human-readable description of the current reading | | `fetchedAt` | string | ISO 8601 timestamp of when this reading was captured | ## SOL Signal Catalog All 7 SOL-specific signals feed the council deliberation every 30 minutes. Signals are cached with a 60-second TTL to avoid hammering external APIs. | Signal Key | Description | Source | Agent | | - | - | - | - | | `SOL_NETWORK_TPS` | Current Solana network throughput (transactions per second). HEALTHY threshold: โ‰ฅ 1000 TPS. | Solana RPC `getRecentPerformanceSamples` | NETWORK\_SENTINEL | | `SOL_NETWORK_HEALTH` | Gate 0 network health label: `HEALTHY` / `DEGRADED`. Derived from TPS threshold + `status.solana.com` check. `DEGRADED` blocks all entries. | Solana RPC + status.solana.com | NETWORK\_SENTINEL | | `SOL_DEFI_TVL_TREND` | 7-day TVL trend on the Solana chain across all protocols (DeFiLlama Solana filter). Positive values = growing ecosystem liquidity. | DeFiLlama | ECOSYSTEM\_ANALYST | | `SOL_STAKING_PARTICIPATION` | % of total SOL supply currently delegated to active validators. Higher = stronger network security signal. | Solana Beach / validators.app (graceful fallback) | NETWORK\_SENTINEL | | `SOL_BTC_RATIO_TREND` | SOL/BTC ratio 7-day trend direction. Positive = SOL outperforming BTC (alt-season momentum signal). | Internal (Kraken prices) | MOMENTUM\_HUNTER | | `SOL_FUNDING_RATE` | Perpetual futures funding rate on Deribit `SOL_USDC-PERPETUAL`. Positive = longs paying (bullish sentiment), Negative = shorts paying (bearish bias). | Deribit | LIQUIDITY\_GUARDIAN | | `SOL_MEMECOIN_ACTIVITY` | 7-day memecoin volume aggregate on Solana from DeFiLlama. High memecoin activity signals retail engagement and network fee revenue. | DeFiLlama | ECOSYSTEM\_ANALYST | ## Notes * `SOL_NETWORK_HEALTH` and `SOL_NETWORK_TPS` are always fresh (60s probe cache) and duplicated in the top-level `networkHealth` / `networkTps` fields for convenience. * `SOL_STAKING_PARTICIPATION` uses Solana Beach as the primary source and falls back to `validators.app` on timeout. Both may return `null` during maintenance windows. * Deribit is used instead of Binance for `SOL_FUNDING_RATE` because Binance is geo-blocked on the Railway US deployment. ```bash curl theme={null} curl https://api.aioka.io/v1/sol/signals \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "signals": [ { "key": "SOL_NETWORK_TPS", "value": 2850.5, "direction": "BULLISH", "source": "solana_rpc", "detail": "Network TPS 2850 -- well above HEALTHY threshold of 1000", "fetchedAt": "2026-05-06T10:29:45+00:00" }, { "key": "SOL_NETWORK_HEALTH", "value": 1.0, "direction": "BULLISH", "source": "solana_rpc", "detail": "HEALTHY -- TPS 2850, status.solana.com nominal", "fetchedAt": "2026-05-06T10:29:45+00:00" }, { "key": "SOL_DEFI_TVL_TREND", "value": 0.034, "direction": "BULLISH", "source": "defi_llama", "detail": "Solana DeFi TVL +3.4% over 7 days ($8.2B -> $8.48B)", "fetchedAt": "2026-05-06T10:25:00+00:00" }, { "key": "SOL_STAKING_PARTICIPATION", "value": 0.681, "direction": "BULLISH", "source": "solana_beach", "detail": "68.1% of supply staked -- above 65% strong-participation threshold", "fetchedAt": "2026-05-06T10:25:00+00:00" }, { "key": "SOL_BTC_RATIO_TREND", "value": 0.0021, "direction": "BULLISH", "source": "kraken", "detail": "SOL/BTC ratio +0.21% over 7 days -- mild SOL outperformance", "fetchedAt": "2026-05-06T10:29:30+00:00" }, { "key": "SOL_FUNDING_RATE", "value": 0.00042, "direction": "BULLISH", "source": "deribit", "detail": "Funding rate +0.042% per 8h -- longs paying, mild bullish bias", "fetchedAt": "2026-05-06T10:28:00+00:00" }, { "key": "SOL_MEMECOIN_ACTIVITY", "value": 142000000.0, "direction": "NEUTRAL", "source": "defi_llama", "detail": "7-day Solana memecoin volume $142M -- stable vs prior week", "fetchedAt": "2026-05-06T10:25:00+00:00" } ], "networkHealth": "HEALTHY", "networkTps": 2850.5, "generatedAt": "2026-05-06T10:30:00+00:00" } ``` # SOL Ghost Trader Status Source: https://docs.aioka.io/api-reference/sol/status GET /v1/sol/status Live SOL Ghost Trader status -- current trade, latest verdict, regime, RSI, EMA, Solana network health (Gate 0) > [!NOTE] > > This endpoint is public -- no API key required. Powers the SOL panel > on aioka.io/live. (Sprint 183 -- second multi-asset expansion after ETH.) **Tier:** Public โœ… **Cache:** 60 s (Redis response cache) **Read-only:** Never writes to any trading table. > โš ๏ธ This is a paper-trading status snapshot, not financial advice. > AIOKA SOL Ghost Trader is a simulation. Never make real financial > decisions based solely on this signal. > [!WARNING] > > Since 2026-10-04 only the Bitcoin council runs. While the SOL council is paused this > endpoint answers `"status": "PAUSED"` with no verdict and no trade data, instead of > serving its last (stale) verdict. (Sprint 414) ## Response Fields SOL status mirrors the ETH schema but adds two SOL-specific fields: `networkHealth` and `networkTps` (the Solana network health probe used by Gate 0). SOL evaluates **8 entry gates** -- one more than BTC/ETH (7 gates) -- because Gate 0 (network health) is mandatory for SOL. | Field | Type | Meaning | | - | - | - | | `status` | string | `"WAITING"` (no open SOL trade) or `"IN_TRADE"`, or `"PAUSED"` when this council is paused (no verdict is returned) | | `currentTrade` | object \| null | Open SOL trade details when `status == "IN_TRADE"` | | `currentTrade.entryPrice` | number | SOL entry price (USD) | | `currentTrade.sizeSol` | number | Position size in SOL | | `currentTrade.pnlUsd` | number | Live P\&L in USD | | `currentTrade.pnlPct` | number | Live P\&L as % of position cost | | `currentTrade.tp1Hit` | bool | Whether TP1 partial close has fired | | `currentTrade.stopLoss` | number | Stop loss price (USD). Reads from `sol_ghost_trades.stop_loss`; falls back to `entryPrice ร— 0.97` (-3.0% floor) when NULL | | `currentTrade.tp1Target` | number | TP1 target price = `entryPrice ร— 1.02` (+2.0%) | | `currentTrade.tp2Target` | number | TP2 target price = `entryPrice ร— 1.05` (+5.0%) | | `currentTrade.networkHealthAtEntry` | string | Solana network health label captured at entry (`HEALTHY` / `DEGRADED` / `UNKNOWN`) | | `latestVerdict` | object \| null | Latest SOL council verdict | | `latestVerdict.ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` | | `latestVerdict.confidence` | number | 0.0 -- 1.0 | | `latestVerdict.createdAt` | string | ISO 8601 timestamp | | `regime` | string \| null | Market regime (e.g. `ACCUMULATION`) | | `rsi1h` | number \| null | SOL 1H RSI | | `ema200` | number \| null | SOL 1H EMA(200) | | `solPrice` | number \| null | Latest SOL/USD | | `networkHealth` | string | **SOL-specific.** Solana network health label: `HEALTHY` / `DEGRADED` / `UNKNOWN`. `DEGRADED` blocks ALL SOL entries. | | `networkTps` | number \| null | **SOL-specific.** Current Solana network throughput (transactions per second) from RPC `getRecentPerformanceSamples`. Threshold for HEALTHY = 1000 TPS. | | `generatedAt` | string | Response timestamp | | `gates` | object | Per-gate boolean evaluator (8 gates for SOL) | | `gates.network` | bool | **SOL-specific Gate 0.** `true` when Solana network is HEALTHY | | `gates.networkHealth` | string | Network health label mirrored into the gates block | | `gates.judiciary` | bool | Judiciary ruling is bullish | | `gates.council` | bool | SOL council bullish AND confidence โ‰ฅ 65% | | `gates.emaProximity` | bool | Price within EMA 200 sweet-spot band (+0.5% to +4.0%) | | `gates.regime` | bool | Regime favorable for SOL entries | | `gates.quality` | bool | Real composite entry quality score โ‰ฅ 60.0 (mirrors trader-side `calculate_entry_quality()` byte-for-byte) | | `gates.momentum` | bool | RSI(1H) โ‰ฅ 45 (momentum heuristic) | | `gates.session` | bool | Not in weekend low-liquidity block (Fri 22:00 -- Sun 06:00 Europe/Prague) | | `gates.gatesMet` | int | Count of gates currently passing (0 -- 8) | | `gates.trigger` | string \| null | Human-readable reason the next gate is failing, or `null` when all 8 pass | ```bash curl theme={null} curl https://api.aioka.io/v1/sol/status ``` ```json 200 theme={null} { "status": "WAITING", "currentTrade": null, "latestVerdict": { "ruling": "ACCUMULATE", "confidence": 0.71, "createdAt": "2026-05-05T10:15:00+00:00" }, "regime": "ACCUMULATION", "rsi1h": 54.2, "ema200": 152.3, "solPrice": 156.8, "networkHealth": "HEALTHY", "networkTps": 2850.5, "generatedAt": "2026-05-05T10:30:00+00:00", "gates": { "network": true, "networkHealth": "HEALTHY", "judiciary": true, "council": true, "emaProximity": true, "regime": true, "quality": true, "momentum": true, "session": true, "gatesMet": 8, "trigger": null } } ``` ## SOL-Specific: Gate 0 (Network Health) SOL is the first AIOKA asset with a dedicated network-health gate. The public status endpoint probes Solana mainnet RPC (`getRecentPerformanceSamples`) and `status.solana.com` summary every 60 seconds and exposes the result via `networkHealth` + `networkTps`. When `networkHealth == "DEGRADED"`, ALL SOL entries are blocked regardless of judiciary, council, or any other gate. This is by design and mirrors the trader-side TW-2-equivalent rule -- Gate 0 must never be disabled. # SOL Ghost Trader Track Record Source: https://docs.aioka.io/api-reference/sol/track-record GET /v1/sol/track-record Full validated SOL trade history with derived performance stats > [!NOTE] > > Public endpoint -- no API key required. Powers the SOL tab on > aioka.io/track-record. (Sprint 183 -- second multi-asset expansion after ETH.) **Tier:** Public โœ… **Cache:** 5 min (Redis response cache) **Read-only:** No writes. โš ๏ธ **Paper-trading data.** AIOKA SOL Ghost Trader is a simulation and never places real orders until 10 validated paper trades have been completed. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `trades` | array | Closed validated SOL trades, oldest first | | `stats.totalTrades` | int | Count of closed validated trades | | `stats.winRate` | number | % of trades with `pnlUsd > 0` | | `stats.totalPnl` | number | Cumulative USD P\&L | | `stats.avgHoldMinutes` | number | Average hold duration | | `stats.bestTrade` | number | Best single-trade P\&L | | `stats.worstTrade` | number | Worst single-trade P\&L | ### Per-trade | Field | Type | Meaning | | - | - | - | | `id` | string | UUID | | `entryTime` / `exitTime` | string | ISO 8601 | | `entryPrice` / `exitPrice` | number | USD | | `sizeSol` | number | Position size in SOL | | `pnlUsd` | number | Total P\&L (entry-to-exit, includes TP1 partial when applicable) | | `pnlPct` | number | P\&L as % of position cost | | `tp1PnlUsd` | number \| null | TP1 partial P\&L when TP1 fired | | `networkHealthAtEntry` | string | **SOL-specific.** Solana network health label at entry (`HEALTHY` / `DEGRADED` / `UNKNOWN`) | | `result` | string | `"WIN"` / `"LOSS"` | | `mode` | string | Entry mode (`A` / `B` / `C`) | ```bash curl theme={null} curl https://api.aioka.io/v1/sol/track-record ``` ```json 200 theme={null} { "trades": [], "stats": { "totalTrades": 0, "winRate": 0.0, "totalPnl": 0.0, "avgHoldMinutes": 0.0, "bestTrade": 0.0, "worstTrade": 0.0 } } ``` ## Track Record Restart SOL track record begins at first SOL trade close -- the table is empty until the first validated SOL trade lands. Per the SOL paper-mode rule (SOL\_PAPER\_MODE, Sprint 183), 10 validated paper trades must complete before SOL can graduate to live Kraken capital. # TAO Council Verdict Source: https://docs.aioka.io/api-reference/tao/council GET /v1/tao/council Latest TAO AI Council verdict with 6 specialist agent votes, risk flags, chief rationale, and signal snapshot > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. The TAO council > runs 6 specialist agents tuned to Bittensor-specific intelligence. **Tier:** Pro (\$199/mo) **Cache:** None **Rate limit:** 30/min (per tier) **Read-only:** Never writes to any trading table. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `verdict` | object \| null | Latest TAO council verdict. `null` if no verdict has been produced yet (first 30 minutes after deploy). | | `nextRefreshMinutes` | int | Minutes until the next scheduled council auto-refresh. Always `30`. | ### verdict fields | Field | Type | Meaning | | - | - | - | | `id` | string | UUID of this verdict record | | `ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` / `AVOID` | | `confidence` | number | 0.0 -- 1.0. TAO entry threshold is confidence โ‰ฅ 0.72. | | `agentVotes` | object | Per-agent breakdown from all 6 TAO specialist agents | | `agentVotes.` | object | Each agent entry has `ruling` (string) and `confidence` (number) | | `riskFlags` | array | Active risk flags raised by RISK\_WARDEN or LIQUIDITY\_GUARDIAN. Possible values: `LIQUIDITY_RISK`, `MANIPULATION_RISK`, `INSUFFICIENT_DATA`, `ETF_EVENT_WINDOW`, `CENTRALIZED_AI_OVERHANG`, `INSTITUTIONAL_REBAL` | | `chiefRationale` | string \| null | Chief Judge's plain-language explanation of the ruling and why agent disagreements were resolved as they were | | `plainExplanation` | string \| null | Plain-English, jargon-free 2-3 sentence summary of WHY the council reached its ruling, synthesized by the Chief Judge in the same call. `null` for historical verdicts recorded before this feature. | | `snapshotSignals` | object | Raw signal readings at the time of council deliberation (key-value pairs) | | `createdAt` | string | ISO 8601 timestamp of verdict | ## Specialist Agents The TAO council replaces the generic BTC/ETH agent personas with 6 specialists calibrated for Bittensor-specific intelligence: | Agent | Domain | | - | - | | `SUBNET_ORACLE` | On-chain Bittensor: subnet count, staking ratio, emission rate, validator Nakamoto coefficient | | `MACRO_SAGE` | Global macro environment: DXY, US10Y, risk-on/off regime, Fed tone | | `AI_NARRATIVE` | AI sector sentiment: NVDA, BOTZ/IRBO ETF flows, GitHub commit velocity | | `MOMENTUM_HUNTER` | Price momentum: TAO/BTC ratio trend, RSI, EMA proximity, 4H/1D bias | | `LIQUIDITY_GUARDIAN` | Order-book and on-chain liquidity: Kraken depth, volume surge, stablecoin flows | | `RISK_WARDEN` | Tail-event detection: manipulation flags, ETF event windows, institutional rebalancing | ## Risk Flags Risk flags are raised by RISK\_WARDEN and LIQUIDITY\_GUARDIAN during deliberation. One or more flags in the response does not automatically block an entry -- the Chief Judge weighs flags against confidence scores. However, `LIQUIDITY_RISK` in combination with a low `liquidityDepthUsd` typically results in an `AVOID` or `HOLD` ruling. | Flag | Trigger | | - | - | | `LIQUIDITY_RISK` | Gate 0 liquidity probe returns INSUFFICIENT | | `MANIPULATION_RISK` | Volume spike without matching price or depth confirmation | | `INSUFFICIENT_DATA` | One or more critical signals unavailable (e.g. taostats.io timeout) | | `ETF_EVENT_WINDOW` | Upcoming BTC or crypto ETF event within ยฑ48h (macro contagion risk) | | `CENTRALIZED_AI_OVERHANG` | Major centralized AI model release within ยฑ72h (TAO narrative headwind) | | `INSTITUTIONAL_REBAL` | 13F filing window or end-of-quarter rebalancing detected | ```bash curl theme={null} curl https://api.aioka.io/v1/tao/council \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "verdict": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "ruling": "ACCUMULATE", "confidence": 0.74, "agentVotes": { "SUBNET_ORACLE": {"ruling": "BUY", "confidence": 0.78}, "MACRO_SAGE": {"ruling": "ACCUMULATE", "confidence": 0.71}, "AI_NARRATIVE": {"ruling": "BUY", "confidence": 0.82}, "MOMENTUM_HUNTER": {"ruling": "ACCUMULATE", "confidence": 0.69}, "LIQUIDITY_GUARDIAN": {"ruling": "ACCUMULATE", "confidence": 0.73}, "RISK_WARDEN": {"ruling": "HOLD", "confidence": 0.61} }, "riskFlags": [], "chiefRationale": "Subnet growth and AI narrative tailwinds support accumulation. RISK_WARDEN's HOLD dissent noted -- liquidity probe marginally above floor. Confidence trimmed to 0.74 to reflect uncertainty.", "plainExplanation": "The council leaned bullish on TAO because subnet activity and the AI narrative are gaining strength while liquidity conditions remain healthy. Momentum supports the move, so the stance is a measured buy.", "snapshotSignals": { "tao_price": 289.40, "rsi_1h": 54.2, "ema_200": 281.30, "subnet_count_growth": 0.034, "staking_ratio": 0.621 }, "createdAt": "2026-05-06T08:30:00+00:00" }, "nextRefreshMinutes": 30 } ``` # Latest TAO Council Verdict Source: https://docs.aioka.io/api-reference/tao/council-run POST /v1/tao/council/run Return the latest stored TAO Council verdict (does not start a new deliberation) > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. Rate-limited to > 5/min per tier (council deliberation is Anthropic API-cost heavy). > [!WARNING] > > This endpoint does **not** start a council deliberation. It returns the most recent > verdict already stored by the internal service. Earlier versions of these docs said > otherwise. (Sprint 414) **Tier:** Pro (\$199/mo) **Rate limit:** 5/min **Cache:** None ## How It Works The TAO council auto-refreshes every 30 minutes via an internal background loop running inside the AIOKA core service. This endpoint allows a manual out-of-band refresh when you need a verdict before the next scheduled run. > **Implementation note:** Due to A-1 service isolation (the public API > cannot import from the internal service), this endpoint returns the > latest verdict from the database. The actual Anthropic API call to > deliberate is triggered via the internal `/tao_council` Telegram command > or by the 30-minute auto-refresh loop. If no new verdict has been > produced in the last 2 minutes, the response reflects the last known > verdict with `success: true` and a `detail` message explaining the > trigger mechanism. ## Request No request body required -- `POST` with your API key is sufficient. ## Response Fields | Field | Type | Meaning | | - | - | - | | `success` | bool | `true` if a verdict was returned. `false` if no verdict exists yet (first 30 minutes after deploy). | | `verdict` | object \| null | The latest persisted TAO council verdict. Same structure as `GET /v1/tao/council`. | | `verdict.id` | string | UUID | | `verdict.ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` / `AVOID` | | `verdict.confidence` | number | 0.0 -- 1.0 | | `verdict.agentVotes` | object | Per-agent breakdown from all 6 TAO specialist agents | | `verdict.riskFlags` | array | Active risk flags | | `verdict.chiefRationale` | string \| null | Chief Judge plain-language rationale | | `verdict.plainExplanation` | string \| null | Plain-English, jargon-free 2-3 sentence summary of WHY the council reached its ruling, synthesized by the Chief Judge in the same call. `null` for historical verdicts recorded before this feature. | | `verdict.snapshotSignals` | object | Signal readings at deliberation time | | `verdict.createdAt` | string | ISO 8601 timestamp | | `detail` | string \| null | Human-readable note on trigger status or error context | ```bash curl theme={null} curl -X POST https://api.aioka.io/v1/tao/council/run \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 (verdict returned) theme={null} { "success": true, "verdict": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "ruling": "ACCUMULATE", "confidence": 0.74, "agentVotes": { "SUBNET_ORACLE": {"ruling": "BUY", "confidence": 0.78}, "MACRO_SAGE": {"ruling": "ACCUMULATE", "confidence": 0.71}, "AI_NARRATIVE": {"ruling": "BUY", "confidence": 0.82}, "MOMENTUM_HUNTER": {"ruling": "ACCUMULATE", "confidence": 0.69}, "LIQUIDITY_GUARDIAN": {"ruling": "ACCUMULATE", "confidence": 0.73}, "RISK_WARDEN": {"ruling": "HOLD", "confidence": 0.61} }, "riskFlags": [], "chiefRationale": "Subnet growth and AI narrative tailwinds support accumulation. RISK_WARDEN's HOLD dissent noted.", "plainExplanation": "The council leaned bullish on TAO because subnet activity and the AI narrative are gaining strength while liquidity conditions remain healthy. Momentum supports the move, so the stance is a measured buy.", "snapshotSignals": { "tao_price": 289.40, "rsi_1h": 54.2, "ema_200": 281.30 }, "createdAt": "2026-05-06T08:30:00+00:00" }, "detail": "Latest verdict returned. Out-of-band trigger via /tao_council Telegram command on the internal service." } ``` ```json 200 (no verdict yet) theme={null} { "success": false, "verdict": null, "detail": "No verdict yet -- TAO council auto-refreshes every 30 minutes. First verdict expected within 2 minutes of deploy." } ``` ```json 503 (council unavailable) theme={null} { "error": "tao_council_unavailable", "message": "TAO council read failed; retry in a moment." } ``` # TAO Live Signals Source: https://docs.aioka.io/api-reference/tao/signals GET /v1/tao/signals Latest readings of all 9 TAO-specific signals plus the Kraken liquidity floor probe (Gate 0) > [!NOTE] > > Pro tier endpoint -- requires a valid Pro API key. Fetches fresh > signal readings on every request (expect 1 -- 3 seconds response time). **Tier:** Pro (\$199/mo) **Cache:** None -- fetches fresh on every request **Rate limit:** 30/min (per tier) **Read-only:** No writes. ## Response Fields ### Top-level | Field | Type | Meaning | | - | - | - | | `signals` | array | Latest readings for each TAO signal, one entry per signal key | | `liquidityStatus` | string | Gate 0 result: `"SUFFICIENT"` / `"INSUFFICIENT"` / `"UNKNOWN"` | | `liquidityDepthUsd` | number \| null | Kraken order-book depth (USD) within ยฑ0.5% of mid-price. `null` when probe fails. | | `generatedAt` | string | Response timestamp (ISO 8601) | ### Per-signal (signals array) | Field | Type | Meaning | | - | - | - | | `key` | string | Signal identifier (see signal catalog below) | | `value` | number \| null | Latest numeric reading. `null` when the source is temporarily unavailable. | | `direction` | string | `"BULLISH"` / `"BEARISH"` / `"NEUTRAL"` / `"UNKNOWN"` | | `source` | string | Data source identifier (e.g. `"taostats.io"`, `"github"`, `"defi_llama"`) | | `detail` | string | Human-readable description of the current reading | | `fetchedAt` | string | ISO 8601 timestamp of when this reading was captured | ## TAO Signal Catalog All 9 TAO-specific signals are listed below. Signals feed the specialist agent deliberation every 30 minutes and are written to `tao_signal_history`. | Signal Key | Description | Source | Agent | | - | - | - | - | | `SUBNET_COUNT_GROWTH` | 30-day growth rate of active Bittensor subnets (%) | taostats.io | SUBNET\_ORACLE | | `TAO_STAKING_RATIO` | % of total TAO supply currently staked to validators | taostats.io | SUBNET\_ORACLE | | `TAO_EMISSION_RATE` | Current block emission rate relative to pre-halving baseline. \< 1.0 = post-halving compression. | taostats.io | SUBNET\_ORACLE | | `VALIDATOR_NAKAMOTO_COEFFICIENT` | Nakamoto coefficient of the validator set -- minimum validators needed for 51% stake control. Higher = more decentralized. | taostats.io | SUBNET\_ORACLE | | `TAO_BTC_RATIO_TREND` | TAO/BTC ratio 7-day trend direction (positive = TAO outperforming BTC) | Internal (Kraken) | MOMENTUM\_HUNTER | | `BITTENSOR_GITHUB_ACTIVITY` | Weekly commit count on `opentensor/bittensor` repo (normalized z-score vs 90-day baseline) | GitHub API | AI\_NARRATIVE | | `AI_SECTOR_SENTIMENT` | Composite AI sector sentiment from NVDA 5-day momentum, BOTZ ETF flow, and IRBO ETF flow | Yahoo Finance | AI\_NARRATIVE | | `SUBNET_REVENUE` | Estimated 7-day subnet revenue (USD) across top Bittensor subnets -- proxy for network economic activity | DeFiLlama | SUBNET\_ORACLE | | `INSTITUTIONAL_POSITIONING` | 13F filing signal -- net change in institutional TAO exposure vs prior quarter. `null` outside filing windows (45-day lag). | SEC/EDGAR | RISK\_WARDEN | ## Notes * Signals sourced from taostats.io are polled every 30 minutes during the council refresh cycle. Individual signal age is visible in `fetchedAt`. * `INSTITUTIONAL_POSITIONING` is only populated during SEC 13F filing windows (quarterly, with a 45-day lag). It returns `null` between filing periods. * `AI_SECTOR_SENTIMENT` is a composite -- a single score derived from three underlying components (NVDA, BOTZ, IRBO). Detail is exposed in the `detail` string of each entry. * The `liquidityStatus` and `liquidityDepthUsd` fields in the top-level response are always fresh (60s probe cache) -- they are NOT pulled from `tao_signal_history`. ```bash curl theme={null} curl https://api.aioka.io/v1/tao/signals \ -H "X-API-Key: aik_pro_your_key_here" ``` ```json 200 theme={null} { "signals": [ { "key": "SUBNET_COUNT_GROWTH", "value": 0.034, "direction": "BULLISH", "source": "taostats.io", "detail": "Active subnets grew 3.4% in the past 30 days (64 -> 66)", "fetchedAt": "2026-05-06T08:00:00+00:00" }, { "key": "TAO_STAKING_RATIO", "value": 0.621, "direction": "BULLISH", "source": "taostats.io", "detail": "62.1% of supply staked -- above 60% threshold", "fetchedAt": "2026-05-06T08:00:00+00:00" }, { "key": "TAO_EMISSION_RATE", "value": 0.512, "direction": "BULLISH", "source": "taostats.io", "detail": "Post-halving compression: emission at 51.2% of pre-halving rate. 157 days since 2025-12-01 halving.", "fetchedAt": "2026-05-06T08:00:00+00:00" }, { "key": "VALIDATOR_NAKAMOTO_COEFFICIENT", "value": 12.0, "direction": "NEUTRAL", "source": "taostats.io", "detail": "12 validators control 51% of stake (unchanged vs last week)", "fetchedAt": "2026-05-06T08:00:00+00:00" }, { "key": "TAO_BTC_RATIO_TREND", "value": 0.0048, "direction": "BULLISH", "source": "kraken", "detail": "TAO/BTC ratio up 0.48% over 7 days -- TAO outperforming BTC", "fetchedAt": "2026-05-06T10:28:00+00:00" }, { "key": "BITTENSOR_GITHUB_ACTIVITY", "value": 1.4, "direction": "BULLISH", "source": "github", "detail": "Weekly commit count z-score +1.4 vs 90-day baseline (above average dev activity)", "fetchedAt": "2026-05-06T08:00:00+00:00" }, { "key": "AI_SECTOR_SENTIMENT", "value": 0.62, "direction": "BULLISH", "source": "yahoo_finance", "detail": "NVDA +2.1% (5d), BOTZ +0.8% (5d), IRBO +1.2% (5d) -- composite bullish", "fetchedAt": "2026-05-06T10:25:00+00:00" }, { "key": "SUBNET_REVENUE", "value": 142500.0, "direction": "NEUTRAL", "source": "defi_llama", "detail": "7-day subnet revenue $142,500 -- stable vs prior week", "fetchedAt": "2026-05-06T08:00:00+00:00" }, { "key": "INSTITUTIONAL_POSITIONING", "value": null, "direction": "UNKNOWN", "source": "sec_edgar", "detail": "Outside 13F filing window -- next data expected Q3 2026", "fetchedAt": "2026-05-06T08:00:00+00:00" } ], "liquidityStatus": "SUFFICIENT", "liquidityDepthUsd": 82500.0, "generatedAt": "2026-05-06T10:30:00+00:00" } ``` # TAO Ghost Trader Status Source: https://docs.aioka.io/api-reference/tao/status GET /v1/tao/status Live TAO Ghost Trader status -- current trade, latest verdict, regime, RSI, EMA, Kraken liquidity floor (Gate 0), risk flags, 6 specialist agent votes > [!NOTE] > > This endpoint is public -- no API key required. Powers the TAO panel > on aioka.io/live. (Sprint TAO -- third multi-asset expansion after ETH and SOL.) **Tier:** Public **Cache:** 60 s (Redis response cache) **Read-only:** Never writes to any trading table. > TAO council uses 6 specialist agents unique to Bittensor: SUBNET\_ORACLE, > MACRO\_SAGE, AI\_NARRATIVE, MOMENTUM\_HUNTER, LIQUIDITY\_GUARDIAN, RISK\_WARDEN. > These replace the generic BTC/ETH council personas and reflect TAO-specific > on-chain and AI-sector intelligence. > โš ๏ธ This is a paper-trading status snapshot, not financial advice. > AIOKA TAO Ghost Trader is a simulation. Never make real financial > decisions based solely on this signal. > [!WARNING] > > Since 2026-10-04 only the Bitcoin council runs. While the TAO council is paused this > endpoint answers `"status": "PAUSED"` with no verdict and no trade data, instead of > serving its last (stale) verdict. (Sprint 414) ## Response Fields TAO status mirrors the SOL schema but replaces `networkHealth`/`networkTps` with `liquidityStatus`/`liquidityDepthUsd` (the Kraken order-book probe used by Gate 0). TAO evaluates **8 entry gates** -- Gate 0 is a Kraken liquidity floor rather than a network health check. ### Top-level | Field | Type | Meaning | | - | - | - | | `status` | string | `"WAITING"` (no open TAO trade) or `"IN_TRADE"`, or `"PAUSED"` when this council is paused (no verdict is returned) | | `currentTrade` | object \| null | Open TAO trade details when `status == "IN_TRADE"` | | `latestVerdict` | object \| null | Latest TAO council verdict with agent votes and risk flags | | `regime` | string \| null | Market regime (e.g. `ACCUMULATION`) | | `rsi1h` | number \| null | TAO 1H RSI | | `ema200` | number \| null | TAO 1H EMA(200) | | `taoPrice` | number \| null | Latest TAO/USD | | `networkHealth` | string | Always `"HEALTHY"` -- TAO has no network outage gate. Included for multi-asset dashboard compatibility. | | `liquidityStatus` | string | **TAO-specific (Gate 0).** `"SUFFICIENT"` / `"INSUFFICIENT"` / `"UNKNOWN"`. `INSUFFICIENT` blocks ALL TAO entries. | | `liquidityDepthUsd` | number \| null | **TAO-specific.** Kraken order-book depth (USD) within ยฑ0.5% of mid-price. `null` when probe fails. | | `paperTradesValidated` | int | Count of closed validated TAO paper trades (0 -- 10 milestone before live capital). | | `paperMode` | bool | `true` while TAO is in paper mode. Becomes `false` after 10 validated paper closes and explicit K-1 sign-off. | | `generatedAt` | string | Response timestamp (ISO 8601) | | `gates` | object | Per-gate boolean evaluator (8 gates for TAO) | ### currentTrade fields (when `status == "IN_TRADE"`) | Field | Type | Meaning | | - | - | - | | `entryPrice` | number | TAO entry price (USD) | | `sizeTao` | number | Position size in TAO | | `pnlUsd` | number | Live P\&L in USD | | `pnlPct` | number | Live P\&L as % of position cost | | `tp1Hit` | bool | Whether TP1 partial close has fired | | `stopLoss` | number | Stop loss price (USD). Reads from `tao_ghost_trades.stop_loss`; falls back to `entryPrice ร— 0.97` (-3.0% floor) when NULL | | `tp1Target` | number | TP1 target price = `entryPrice ร— 1.02` (+2.0%) | | `tp2Target` | number | TP2 target price = `entryPrice ร— 1.045` (+4.5%) | | `hwm` | number \| null | High-water mark for TSL ratchet. Persisted to DB on every ratchet. | | `liquidityAtEntry` | number \| null | **TAO-specific.** Kraken depth (USD) at entry time -- audit field. | | `taoBtcRatioAtEntry` | number \| null | **TAO-specific.** TAO/BTC ratio at entry -- momentum audit. | | `daysSinceHalving` | int \| null | **TAO-specific.** Days elapsed since the 2025-12-01 TAO emission halving. | ### latestVerdict fields | Field | Type | Meaning | | - | - | - | | `ruling` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` / `AVOID` | | `confidence` | number | 0.0 -- 1.0. Entry requires confidence โ‰ฅ 0.72 (TAO council threshold). | | `riskFlags` | array | Active risk flags. Possible values: `LIQUIDITY_RISK`, `MANIPULATION_RISK`, `INSUFFICIENT_DATA`, `ETF_EVENT_WINDOW`, `CENTRALIZED_AI_OVERHANG`, `INSTITUTIONAL_REBAL` | | `agentVotes` | object | Per-agent verdict from all 6 TAO specialist agents (see Specialist Agents section below) | | `agentVotes.` | object | Each agent entry has `ruling` (string) and `confidence` (number 0.0 -- 1.0) | | `createdAt` | string | ISO 8601 timestamp of verdict | ### gates fields | Field | Type | Meaning | | - | - | - | | `gates.liquidity` | bool | **TAO-specific Gate 0.** `true` when Kraken depth โ‰ฅ \$50,000 AND 1H volume โ‰ฅ 1.5ร— 24H average | | `gates.liquidityStatus` | string | Liquidity label mirrored into the gates block (`"SUFFICIENT"` / `"INSUFFICIENT"`) | | `gates.judiciary` | bool | Judiciary ruling is bullish | | `gates.council` | bool | TAO council bullish AND confidence โ‰ฅ 72% | | `gates.emaProximity` | bool | Price within EMA 200 sweet-spot band (+0.3% to +3.5%) | | `gates.regime` | bool | Regime favorable for TAO entries | | `gates.quality` | bool | Real composite entry quality score โ‰ฅ 65.0 (mirrors trader-side `calculate_entry_quality()` byte-for-byte) | | `gates.momentum` | bool | RSI(1H) โ‰ฅ 45 | | `gates.session` | bool | Not in weekend low-liquidity block (Fri 22:00 -- Sun 06:00 Europe/Prague). Asian-early block (00:00 -- 04:00) is overridden when liquidity is SUFFICIENT. | | `gates.gatesMet` | int | Count of gates currently passing (0 -- 8) | | `gates.trigger` | string \| null | Human-readable reason the next gate is failing, or `null` when all 8 pass | ```bash curl theme={null} curl https://api.aioka.io/v1/tao/status ``` ```json 200 theme={null} { "status": "WAITING", "currentTrade": null, "latestVerdict": { "ruling": "ACCUMULATE", "confidence": 0.74, "riskFlags": [], "agentVotes": { "SUBNET_ORACLE": {"ruling": "BUY", "confidence": 0.78}, "MACRO_SAGE": {"ruling": "ACCUMULATE", "confidence": 0.71}, "AI_NARRATIVE": {"ruling": "BUY", "confidence": 0.82}, "MOMENTUM_HUNTER": {"ruling": "ACCUMULATE", "confidence": 0.69}, "LIQUIDITY_GUARDIAN": {"ruling": "ACCUMULATE", "confidence": 0.73}, "RISK_WARDEN": {"ruling": "HOLD", "confidence": 0.61} }, "createdAt": "2026-05-06T08:30:00+00:00" }, "regime": "ACCUMULATION", "rsi1h": 54.2, "ema200": 281.30, "taoPrice": 289.40, "networkHealth": "HEALTHY", "liquidityStatus": "SUFFICIENT", "liquidityDepthUsd": 82500.0, "paperTradesValidated": 0, "paperMode": true, "generatedAt": "2026-05-06T10:30:00+00:00", "gates": { "liquidity": true, "liquidityStatus": "SUFFICIENT", "judiciary": true, "council": true, "emaProximity": true, "regime": true, "quality": true, "momentum": true, "session": true, "gatesMet": 8, "trigger": null } } ``` ## TAO-Specific: Gate 0 (Liquidity Floor) TAO is the first AIOKA asset with a dedicated Kraken order-book liquidity gate. The status endpoint probes the Kraken `Depth` and `OHLC` endpoints every 60 seconds and exposes the result via `liquidityStatus` and `liquidityDepthUsd`. The gate fires on two conditions, both of which must be true: 1. **Depth floor** -- Kraken bid + ask depth within ยฑ0.5% of mid-price โ‰ฅ \$50,000 USD. 2. **Volume surge** -- Last 1H volume โ‰ฅ 1.5ร— the 24H hourly average (confirms institutional participation, filters manipulation signals). When `liquidityStatus == "INSUFFICIENT"`, ALL TAO entries are blocked regardless of judiciary, council, or any other gate. This is by design and mirrors the trader-side K-1-equivalent rule -- Gate 0 must never be disabled. This design reflects TAO's lower Kraken liquidity relative to BTC/ETH. An entry during a thin order book risks high slippage, which is worse than missing the trade entirely. ## Specialist Agents TAO runs 6 custom specialist agents tuned to Bittensor-specific signals. Each agent produces an independent ruling and confidence score. The Chief Judge aggregates all 6 votes into the final verdict. | Agent | Domain | Key Signals | | - | - | - | | `SUBNET_ORACLE` | On-chain Bittensor network | Subnet count growth, staking ratio, emission rate, validator Nakamoto coefficient | | `MACRO_SAGE` | Global macro environment | DXY, US10Y yield, risk-on/off sentiment, Fed tone | | `AI_NARRATIVE` | AI sector market sentiment | NVDA price action, BOTZ/IRBO ETF flows, GitHub activity on `opentensor/bittensor` | | `MOMENTUM_HUNTER` | Price momentum + technicals | TAO/BTC ratio trend, RSI, EMA proximity, 4H/1D bias alignment | | `LIQUIDITY_GUARDIAN` | Order-book and on-chain liquidity | Kraken depth, volume surge factor, stablecoin flows | | `RISK_WARDEN` | Risk and tail-event detection | Concentration risk, manipulation flags, ETF event windows, institutional rebalancing signals | The `agentVotes` object in every verdict response maps each agent name to its individual `ruling` and `confidence`. Disagreement between agents is reflected in the final confidence score -- unanimous verdicts carry the highest confidence. # TAO Ghost Trader Track Record Source: https://docs.aioka.io/api-reference/tao/track-record GET /v1/tao/track-record Full validated TAO trade history with derived performance stats and paper validation progress > [!NOTE] > > Public endpoint -- no API key required. Powers the TAO tab on > aioka.io/track-record. (Sprint TAO -- third multi-asset expansion after ETH and SOL.) **Tier:** Public **Cache:** 5 min (Redis response cache) **Read-only:** No writes. โš ๏ธ **Paper-trading data.** AIOKA TAO Ghost Trader is a simulation and never places real orders until 10 validated paper trades have been completed. The `stats.validatedPaperTrades` field tracks progress toward this milestone. ## Response Fields TAO track record mirrors the SOL schema but adds three TAO-specific per-trade audit fields: `liquidityAtEntry`, `daysSinceHalving`, and `isPaper`. The stats block also exposes the paper validation gate progress via `validatedPaperTrades` and `paperValidationTarget`. ### Top-level | Field | Type | Meaning | | - | - | - | | `trades` | array | Closed validated TAO trades, oldest first | | `stats.totalTrades` | int | Count of closed validated trades | | `stats.validatedPaperTrades` | int | **TAO-specific.** Count of validated paper trades closed (0 -- 10). Milestone: at 10, live capital gates open for K-1 sign-off. | | `stats.paperValidationTarget` | int | Always `10` -- the milestone before live trading. | | `stats.winRate` | number | % of trades with `pnlUsd > 0` | | `stats.totalPnl` | number | Cumulative USD P\&L | | `stats.avgHoldMinutes` | number | Average hold duration in minutes | | `stats.bestTrade` | number | Best single-trade P\&L (USD) | | `stats.worstTrade` | number | Worst single-trade P\&L (USD) | ### Per-trade | Field | Type | Meaning | | - | - | - | | `id` | string | UUID | | `entryTime` / `exitTime` | string | ISO 8601 | | `entryPrice` / `exitPrice` | number | USD | | `sizeTao` | number | Position size in TAO | | `pnlUsd` | number | Total P\&L (entry-to-exit, includes TP1 partial when applicable) | | `pnlPct` | number | P\&L as % of position cost | | `tp1PnlUsd` | number \| null | TP1 partial P\&L when TP1 fired | | `liquidityAtEntry` | number \| null | **TAO-specific.** Kraken order-book depth (USD) at the moment of entry -- audit field for Gate 0 compliance. | | `daysSinceHalving` | int \| null | **TAO-specific.** Days since the 2025-12-01 TAO emission halving at entry time -- cycle-position audit. | | `isPaper` | bool | `true` for all paper trades. Becomes `false` after live capital is enabled. | | `result` | string | `"WIN"` / `"LOSS"` | | `mode` | string | Entry mode (`A` / `B` / `C`) | ```bash curl theme={null} curl https://api.aioka.io/v1/tao/track-record ``` ```json 200 theme={null} { "trades": [], "stats": { "totalTrades": 0, "validatedPaperTrades": 0, "paperValidationTarget": 10, "winRate": 0.0, "totalPnl": 0.0, "avgHoldMinutes": 0.0, "bestTrade": 0.0, "worstTrade": 0.0 } } ``` ## Track Record Restart TAO track record begins at the first TAO trade close -- the trades array is empty until the first validated TAO paper trade lands. Per the TAO paper-mode rule (TAO\_PAPER\_MODE), 10 validated paper trades must complete before TAO can graduate to live Kraken capital. The `validatedPaperTrades` / `paperValidationTarget` fields provide a real-time view of this milestone. When `validatedPaperTrades` reaches 10, an explicit K-1 sign-off sprint activates live trading with Kraken. # TradingView Pine Script Signal Source: https://docs.aioka.io/api-reference/tradingview/signal GET /v1/tradingview/signal Compact, flat JSON payload consumed by the AIOKA Pine Script v5 indicator > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Don't have a key? [Get one free โ†’](/api-reference/keys/generate) **Tier:** Free โœ… **Cache TTL:** 60 seconds **Rate limit:** Free 100/day, 2/min. Basic 1,000/day, 30/min. Pro 10,000/day, 100/min. This endpoint powers the **AIOKA AI Signals** Pine Script indicator published on TradingView. The response is intentionally kept **under 200 bytes** โ€” no nested objects, no lists, Unix-epoch timestamp โ€” so high-frequency polling from a charting platform stays cheap on bandwidth and fast to parse. ## Response Fields | Field | Type | Description | | - | - | - | | `verdict` | string | Judiciary ruling: `STRONG_BUY`, `BUY`, `ACCUMULATE`, `HOLD`, `REDUCE`, `SELL`, `STRONG_SELL`, `PENDING` | | `confidence` | float | Judiciary composite confidence 0-100 | | `regime` | string | Current HMM regime (`BULL_TRENDING`, `LOW_VOLATILITY`, `WHALE_ACCUMULATION`, โ€ฆ) | | `dark_pool` | int | Dark Pool composite score 0โ€“100, built only from inputs with real data (exchange flow 40%, stablecoin mint 35%, entity pressure 25%) and rescaled to 0โ€“100. Stablecoin mint and entity pressure currently have no data source, so today the score reflects exchange flow only. `0` when no input is available. | | `rsi` | float | BTC 1H RSI(14) | | `ema_200` | float | BTC 1H EMA(200) | | `btc_price` | float | Live BTC spot price | | `ghost_status` | string | `WAITING`, `READY`, or `IN_POSITION` | | `timestamp` | int | Unix epoch seconds | ## Pine Script Quick Start Download the free AIOKA indicator from the [TradingView integration guide](/tradingview), paste your API key into the indicator settings, and it will poll this endpoint once per bar close. ```bash curl theme={null} curl https://api.aioka.io/v1/tradingview/signal \ -H "X-API-Key: aik_free_yourkeyhere" ``` ```json 200 theme={null} { "verdict": "ACCUMULATE", "confidence": 76.8, "regime": "LOW_VOLATILITY", "dark_pool": 65, "rsi": 48.0, "ema_200": 75963, "btc_price": 77781, "ghost_status": "WAITING", "timestamp": 1745441234 } ``` # Verdict History Source: https://docs.aioka.io/api-reference/verdict/history GET /v1/verdict/history Paginated verdict history for the last 24 hours > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Requires BASIC tier key (\$49/mo). Contact [info@aioka.io](mailto:info@aioka.io) to upgrade. **Tier:** Basic (\$49/mo) ๐Ÿ”’ **Cache TTL:** 120 seconds ```bash curl theme={null} curl "https://api.aioka.io/v1/verdict/history?page=1&per_page=24" \ -H "X-API-Key: aik_basic_your_key_here" ``` ```json 200 theme={null} { "verdicts": [ { "ruling": "ACCUMULATE", "confidence": 0.782, "score": 0.438, "btc_price": 67124.0, "timestamp": "2026-04-03T10:22:00Z" } ], "total": 48, "page": 1, "per_page": 24, "from_time": "2026-04-03T09:00:00Z", "to_time": "2026-04-03T10:22:00Z", "cached": false, "cache_ttl_seconds": 120 } ``` ```json 403 theme={null} { "detail": { "error": "tier_required", "message": "This endpoint requires Basic tier or higher.", "current_tier": "free", "required_tier": "basic", "upgrade_url": "https://aioka.io/pricing" } } ``` # Latest Verdict Source: https://docs.aioka.io/api-reference/verdict/latest GET /v1/verdict/latest Returns the most recent AI Council verdict with individual agent votes > [!NOTE] > > To use the playground, enter your API key in the **X-API-Key** field above. > Don't have a key? [Get one free โ†’](/api-reference/keys/generate) ## Overview Returns the most recent ruling from AIOKA's Judiciary Engine alongside the AI Council verdict. 6 specialized agents analyze 27 live market signals and vote on BTC market conditions. The Chief Judge synthesizes all votes into a final ruling. Individual agent votes are included in the response. **Tier:** Free โœ… **Cache TTL:** 60 seconds ## Ruling Values | Ruling | Meaning | Action | | - | - | - | | `STRONG_BUY` | High-conviction bullish | Strong entry signal | | `BUY` | Moderate bullish | Consider entry | | `ACCUMULATE` | Cautiously bullish | Scale in gradually | | `HOLD` | Neutral | Wait for confirmation | | `REDUCE` | Cautiously bearish | Reduce exposure | | `SELL` | Moderate bearish | Exit positions | | `STRONG_SELL` | High-conviction bearish | Emergency exit | ## Council Fields The response includes optional AI Council data when available: | Field | Type | Description | | - | - | - | | `council_ruling` | string \| null | Chief Judge's ruling (same scale as `ruling`) | | `council_confidence` | number \| null | Chief Judge's confidence (0.0โ€“1.0) | | `council_consensus` | string \| null | Consensus level (e.g. `"STRONG"`, `"MODERATE"`, `"SPLIT"`) | | `council_explanation` | string \| null | Plain-English, jargon-free 2-3 sentence summary of WHY the council reached its ruling, synthesized by the Chief Judge. `null` if no recent council verdict exists. | | `council_mode` | string \| null | Operating mode: `"council"` (full AI Council active) or `"judiciary"` (fallback โ€” Anthropic API unavailable). `null` if no council data exists yet. | | `agents` | array \| null | Individual agent votes (see below) | | `macro_context` | object \| null | Macro environment context (Sprint 201). Present for all tiers. | > [!NOTE] > > **`council_mode` explained:** When the Anthropic API is unavailable, AIOKA's AI Council > automatically falls back to the Judiciary Engine alone. `council_mode: "judiciary"` means > the verdict was produced with reduced AI consensus (\~47% confidence baseline). Normal operation > resumes automatically when the Anthropic API recovers. The `council_mode` field reflects > the state at the time the response was generated, inferred from council verdict freshness. > [!NOTE] > > `macro_context` is available to all tiers including Free. > For the full cross-asset breakdown with all 5 signals, > use [GET /v1/macro/correlation](/api-reference/macro/correlation) > (Basic tier required). ### Agent Vote Object Each item in the `agents` array: | Field | Type | Description | | - | - | - | | `name` | string | Agent display name (e.g. `"CHAIN ORACLE"`, `"MACRO SAGE"`) | | `vote` | string | Agent's ruling (same scale as `ruling`) | | `confidence` | number | Agent's confidence (0.0โ€“1.0) | | `reasoning` | string \| null | The agent's own 2-3 sentence rationale for its vote. `null` on historical verdicts persisted before per-agent reasoning was exposed. | **6 Agents:** CHAIN ORACLE, MACRO SAGE, SENTIMENT MONK, TECH HAWK, LIQUIDITY GUARDIAN, RISK SHIELD ```bash curl theme={null} curl https://api.aioka.io/v1/verdict/latest \ -H "X-API-Key: aik_free_your_key_here" ``` ```python Python theme={null} import httpx resp = httpx.get( "https://api.aioka.io/v1/verdict/latest", headers={"X-API-Key": "aik_free_your_key_here"}, ) data = resp.json() print(data["ruling"], data["confidence"]) # Access individual agent votes if data.get("agents"): for agent in data["agents"]: print(f" {agent['name']}: {agent['vote']} ({agent['confidence']:.0%})") ``` ```json 200 theme={null} { "ruling": "ACCUMULATE", "confidence": 0.782, "score": 0.438, "btc_price": 67124.0, "timestamp": "2026-04-03T10:22:00Z", "council_ruling": "BUY", "council_confidence": 0.72, "council_consensus": "MODERATE", "council_explanation": "The council leaned bullish because on-chain demand is strengthening while broader market conditions stay supportive. Short-term momentum is soft, so the stance is a measured buy rather than aggressive.", "agents": [ {"name": "CHAIN ORACLE", "vote": "BUY", "confidence": 0.81, "reasoning": "Exchange net flows turned sharply negative as long-term holders accumulate. SOPR above 1 confirms profitable holders are not capitulating."}, {"name": "MACRO SAGE", "vote": "ACCUMULATE", "confidence": 0.65, "reasoning": "A weakening dollar and easing real yields create a supportive backdrop for risk assets and hard-money narratives."}, {"name": "SENTIMENT MONK", "vote": "BUY", "confidence": 0.74, "reasoning": "Fear & Greed sits in neutral territory, leaving room for upside without the froth that precedes local tops."}, {"name": "TECH HAWK", "vote": "HOLD", "confidence": 0.58, "reasoning": "Price is consolidating around the 200 EMA with RSI near 50, an indecisive posture that warrants patience."}, {"name": "LIQUIDITY GUARDIAN", "vote": "BUY", "confidence": 0.77, "reasoning": "Order book depth is balanced and stablecoin reserves on exchanges are rising, signalling dry powder ready to deploy."}, {"name": "RISK SHIELD", "vote": "ACCUMULATE", "confidence": 0.69, "reasoning": "No major macro event is imminent and volatility is contained, so a measured scale-in is acceptable."} ], "council_mode": "council", "macro_context": { "assessment": "BULLISH", "key_driver": "Dollar weakening + Nasdaq ATH", "primary_risk": "DXY reversal could create headwind" }, "cached": true, "cache_ttl_seconds": 45 } ``` ```json 401 theme={null} { "detail": { "error": "missing_api_key", "message": "Provide your API key in the X-API-Key header." } } ``` ```json 429 theme={null} { "detail": { "error": "daily_limit_exceeded", "message": "Daily limit of 100 calls reached for free tier.", "calls_today": 100, "limit": 100, "reset_at": "2026-04-04T00:00:00Z", "upgrade_url": "https://aioka.io/pricing" } } ``` # Delete Webhook Source: https://docs.aioka.io/api-reference/webhooks/delete DELETE /v1/webhooks/{webhook_id} Delete a webhook subscription by ID. ## Overview Permanently deletes a webhook subscription. Only the API key that created the webhook can delete it. **Tier:** Basic ๐Ÿ”’ ## Path Parameters **webhook\_id** `string` *required* UUID of the webhook subscription to delete. ## Response **deleted** `boolean` Always `true` on success. **webhook\_id** `string` UUID of the deleted webhook. ```bash theme={null} curl -X DELETE https://api.aioka.io/v1/webhooks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \ -H "X-API-Key: aik_basic_..." ``` ```json theme={null} { "deleted": true, "webhook_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } ``` # Webhook Delivery History Source: https://docs.aioka.io/api-reference/webhooks/deliveries GET /v1/webhooks/{id}/deliveries Returns the last 50 delivery attempts for a specific webhook subscription. ## Overview Returns up to 50 of the most recent delivery attempts for a webhook subscription. Use this to debug failed deliveries and inspect HMAC signatures. **Tier:** Basic ๐Ÿ”’ **Rate limit:** 60/minute ## Path Parameters **id** `string` *required* UUID of the webhook subscription. ## Response **webhook\_id** `string` UUID of the webhook subscription. **deliveries** `array` Array of delivery attempt objects, newest first. **Delivery object** **delivered\_at** `string` ISO 8601 timestamp of the delivery attempt. **event\_type** `string` The event type delivered (e.g. `verdict.new`, `ghost.signal`). **status\_code** `integer` HTTP status code returned by your endpoint. `null` if the request never reached your server. **success** `boolean` `true` if the endpoint returned 2xx, `false` otherwise. **attempt** `integer` Attempt number (1 = first try, up to 3 retries with exponential backoff). **response\_ms** `integer` Round-trip latency in milliseconds. `null` on network failure. **count** `integer` Number of delivery records returned (max 50). ## HMAC Verification Every delivery includes an `X-AIOKA-Signature` header. Verify it on your server: ```python theme={null} import hmac, hashlib def verify(secret: str, payload: bytes, signature: str) -> bool: expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature) ``` ## Retry Policy Failed deliveries are retried up to 3 times with exponential backoff: **5s โ†’ 25s โ†’ 125s**. After 10 consecutive failures the subscription is automatically disabled. ```bash theme={null} curl https://api.aioka.io/v1/webhooks/3fa85f64-5717-4562-b3fc-2c963f66afa6/deliveries \ -H "X-API-Key: aik_basic_..." ``` ```json theme={null} { "webhook_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "deliveries": [ { "delivered_at": "2026-04-18T14:32:10Z", "event_type": "verdict.new", "status_code": 200, "success": true, "attempt": 1, "response_ms": 143 }, { "delivered_at": "2026-04-18T14:01:55Z", "event_type": "ghost.signal", "status_code": 503, "success": false, "attempt": 3, "response_ms": 5012 } ], "count": 2 } ``` # ghost.closed Event Source: https://docs.aioka.io/api-reference/webhooks/ghost-closed Fired when a Ghost Trader position is fully closed on any supported asset. ## Overview The `ghost.closed` event fires when a Ghost Trader position is fully closed on any supported asset. It includes the final P\&L (net of any TP1 partial sell), the exit price, and a canonical `close_reason` label. **Assets covered:** BTC, ETH, SOL, TAO, GOLD **Latency:** Up to 30 seconds (poll-based dispatcher). ## Subscribe Register via `POST /v1/webhooks` with `"ghost.closed"` in the `events` array. ```json theme={null} { "url": "https://your-server.com/aioka-hook", "events": ["ghost.closed"] } ``` ## Payload ```json theme={null} { "event": "ghost.closed", "timestamp": "2026-05-08T16:45:00.123456Z", "data": { "trade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "asset": "BTC", "entry_price": "96450.00", "exit_price": "97820.50", "pnl": "412.30", "close_reason": "TSL", "closed_at": "2026-05-08 16:44:55+00:00" } } ``` ## Data Fields **trade\_id** `string` UUID of the closed trade. **asset** `string` Asset symbol. One of: `BTC`, `ETH`, `SOL`, `TAO`, `GOLD`. **entry\_price** `decimal` Entry price in USD. **exit\_price** `decimal` Final exit price in USD. **pnl** `decimal` Net P\&L in USD, including TP1 partial sell profit if TP1 fired before close. **close\_reason** `string` Canonical close reason. One of: | Value | Description | | :- | :- | | `STOP_LOSS` | Hard stop loss hit | | `TP1` | Closed at TP1 level (rare -- usually TSL fires after TP1) | | `TP2` | Take Profit 2 hit | | `TSL` | Trailing stop loss triggered | | `BE_SHIELD` | Break-Even Shield triggered | | `MANUAL` | Manually closed via Telegram command | | `EXIT_SIGNAL` | Score-based exit signal | | `REGIME_EXIT` | Market regime change forced exit | | `CONVICTION_EXIT` | AI Council low-conviction exit | | `FLASH_CRASH` | Emergency flash-crash exit | **closed\_at** `string` ISO 8601 timestamp when the trade closed. ## Delivery Delivered as a signed `POST` to your registered URL with: * `X-AIOKA-Event: ghost.closed` * `X-AIOKA-Signature: sha256=` * `X-AIOKA-Timestamp: ` See [Register Webhook](/api-reference/webhooks/register) for signature verification. # ghost.tp1 Event Source: https://docs.aioka.io/api-reference/webhooks/ghost-tp1 Fired when a Ghost Trader position hits TP1 and executes a partial sell. ## Overview The `ghost.tp1` event fires once per trade, at the moment the Ghost Trader executes a TP1 (Take Profit 1) partial sell on any supported asset. TP1 closes 50% of the position and activates the Break-Even Shield, raising the stop-loss to the entry price. **Assets covered:** BTC, ETH, SOL, TAO, GOLD **Latency:** Up to 30 seconds (poll-based dispatcher). ## Subscribe Register via `POST /v1/webhooks` with `"ghost.tp1"` in the `events` array. ```json theme={null} { "url": "https://your-server.com/aioka-hook", "events": ["ghost.tp1"] } ``` ## Payload ```json theme={null} { "event": "ghost.tp1", "timestamp": "2026-05-08T14:32:10.123456Z", "data": { "trade_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "asset": "ETH", "entry_price": "2845.50", "tp1_price": "2903.21", "tp1_pnl": "58.35", "be_shield_active": true, "timestamp": "2026-05-08 14:32:00+00:00" } } ``` ## Data Fields **trade\_id** `string` UUID of the trade that fired TP1. **asset** `string` Asset symbol. One of: `BTC`, `ETH`, `SOL`, `TAO`, `GOLD`. **entry\_price** `decimal` Original entry price in USD. **tp1\_price** `decimal` Price at which the TP1 partial sell executed (may be null if not separately tracked). **tp1\_pnl** `decimal` Locked P\&L from the partial sell in USD. Null if not yet persisted. **be\_shield\_active** `boolean` Always `true` for TP1 events -- TP1 execution always activates the Break-Even Shield. **timestamp** `string` ISO 8601 timestamp when TP1 was detected by the dispatcher. ## Delivery Delivered as a signed `POST` to your registered URL with: * `X-AIOKA-Event: ghost.tp1` * `X-AIOKA-Signature: sha256=` * `X-AIOKA-Timestamp: ` See [Register Webhook](/api-reference/webhooks/register) for signature verification. # List Webhooks Source: https://docs.aioka.io/api-reference/webhooks/list GET /v1/webhooks List all webhook subscriptions for your API key. ## Overview Returns all webhook subscriptions registered for the authenticated API key. **Tier:** Basic ๐Ÿ”’ **Note:** The webhook secret is **not** returned in list responses. It is only shown at registration time. ## Response **webhooks** `array` Array of webhook subscription objects. **count** `integer` Total number of registered webhooks. ```bash theme={null} curl https://api.aioka.io/v1/webhooks \ -H "X-API-Key: aik_basic_..." ``` ```json theme={null} { "webhooks": [ { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "url": "https://your-server.com/aioka-hook", "events": ["verdict.new"], "is_active": true, "created_at": "2026-04-18T10:00:00Z", "last_triggered_at": null, "failures_since_success": 0, "secret": null } ], "count": 1 } ``` # Register Webhook Source: https://docs.aioka.io/api-reference/webhooks/register POST /v1/webhooks Register a webhook URL to receive HMAC-SHA256-signed POST payloads when AIOKA events occur. ## Overview Register a callback URL to receive signed event payloads whenever AIOKA events occur. Each delivery includes a `X-AIOKA-Signature: sha256=` header you can use to verify authenticity. **Tier:** Basic ๐Ÿ”’ **Limit:** 5 webhooks per API key **Delivery:** HMAC-SHA256 signed via `X-AIOKA-Signature: sha256=` header **Retries:** Up to 3 attempts with exponential backoff (5s, 25s, 125s) **Auto-disable:** After 10 consecutive failures, the webhook is deactivated ## Supported Events | Event | Trigger | | :- | :- | | `verdict.new` | New Judiciary verdict produced | | `council.new` | New AI Council verdict produced | | `regime.change` | Market regime changed | | `ghost.signal` | Ghost Trader detects entry opportunity (BTC, ETH, SOL, TAO, GOLD) | | `ghost.tp1` | Ghost Trader TP1 partial sell executed (any asset) | | `ghost.closed` | Ghost Trader trade fully closed (any asset) | | `macro.alert` | Macro correlation crosses ยฑ0.15 threshold | ## Request **url** `string` *required* The HTTPS URL to deliver payloads to. Must start with `https://`. **events** `array` *required* List of event types to subscribe to. Must contain at least 1 and at most 5 items. Duplicates are rejected. ## Response **id** `string` UUID of the webhook subscription. **url** `string` The registered HTTPS callback URL. **events** `array` List of subscribed event types. **is\_active** `boolean` Whether the webhook is currently active. **created\_at** `string` ISO 8601 creation timestamp. **secret** `string` **Shown only once.** The HMAC signing secret. Store it securely -- it cannot be retrieved again. **failures\_since\_success** `integer` Number of consecutive delivery failures since last success. ## Verifying Signatures On receipt, verify every delivery using the secret shown at registration: ```python theme={null} import hmac, hashlib def verify_signature(secret: str, body: bytes, signature_header: str) -> bool: expected = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature_header) ``` ```bash theme={null} curl -X POST https://api.aioka.io/v1/webhooks \ -H "X-API-Key: aik_basic_..." \ -H "Content-Type: application/json" \ -d '{"url": "https://your-server.com/aioka-hook", "events": ["verdict.new", "ghost.signal"]}' ``` ```json theme={null} { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "url": "https://your-server.com/aioka-hook", "events": ["verdict.new", "ghost.signal"], "is_active": true, "created_at": "2026-04-18T10:00:00Z", "last_triggered_at": null, "failures_since_success": 0, "secret": "a1b2c3d4e5f6..." } ``` # Test Webhook Source: https://docs.aioka.io/api-reference/webhooks/test POST /v1/webhooks/test Send a test payload to a registered webhook URL to verify connectivity. ## Overview Fires a single test delivery to the specified webhook URL. Useful for verifying connectivity and signature validation logic before going live. **Tier:** Basic ๐Ÿ”’ ## Request **webhook\_id** `string` *required* UUID of the webhook subscription to test. ## Response **success** `boolean` Whether the delivery received a 2xx HTTP response. **status\_code** `integer` HTTP status code from your endpoint. `null` if the request failed to connect. **message** `string` Human-readable delivery result. ```bash theme={null} curl -X POST https://api.aioka.io/v1/webhooks/test \ -H "X-API-Key: aik_basic_..." \ -H "Content-Type: application/json" \ -d '{"webhook_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"}' ``` ```json theme={null} { "success": true, "status_code": 200, "message": "Test payload delivered successfully" } ``` # Authentication Source: https://docs.aioka.io/authentication How to authenticate with the AIOKA Intelligence API # Authentication All AIOKA Intelligence API endpoints (except `/v1/health` and `/v1/keys/generate`) require an API key passed in the `X-API-Key` header. ## API Key Format ``` aik_{tier}_{20 random characters} ``` **Examples:** * `aik_free_a1b2c3d4e5f6g7h8i9j0` โ€” Free tier * `aik_basic_x9y8z7w6v5u4t3s2r1q0` โ€” Basic tier * `aik_pro_m1n2o3p4q5r6s7t8u9v0` โ€” Pro tier ## Making Authenticated Requests Include your key in the `X-API-Key` header on every request: ```bash curl theme={null} curl https://api.aioka.io/v1/verdict/latest \ -H "X-API-Key: aik_free_your_key_here" ``` ```python Python theme={null} import httpx client = httpx.Client( base_url="https://api.aioka.io", headers={"X-API-Key": "aik_free_your_key_here"}, ) resp = client.get("/v1/verdict/latest") print(resp.json()) ``` ```javascript JavaScript theme={null} const resp = await fetch( "https://api.aioka.io/v1/verdict/latest", { headers: { "X-API-Key": "aik_free_your_key_here" }, } ); const data = await resp.json(); ``` ## Error Responses | Status | Error | Cause | | - | - | - | | `401` | `missing_api_key` | No `X-API-Key` header | | `401` | `invalid_api_key` | Key not found in database | | `401` | `key_inactive` | Key has been deactivated | | `403` | `tier_required` | Endpoint requires a higher tier | | `429` | `daily_limit_exceeded` | Daily call quota exhausted | | `429` | `rate_limit_exceeded` | Per-minute rate limit hit | ## Security * Store your key securely โ€” treat it like a password * Never commit it to version control * Use environment variables: `export AIOKA_API_KEY=aik_free_...` * The key is shown **once** at generation and cannot be recovered ## Get Your Free Key ```bash theme={null} curl -X POST https://api.aioka.io/v1/keys/generate \ -H "Content-Type: application/json" \ -d '{"name": "My Project", "email": "you@example.com"}' ``` [โ†’ Full key generation docs](/api-reference/keys/generate) # Discord Integration Guide Source: https://docs.aioka.io/integrations/discord Connect AIOKA signals to your Discord server โ€” verdict updates, Ghost Trader trades, and regime change alerts via webhooks. ## Overview AIOKA can broadcast trading signals, Ghost Trader trade events, and market regime changes directly to your Discord server using **Discord webhooks** โ€” no bot token or Discord application required. Two channels are supported: * **Main signals channel** โ€” verdict changes, regime changes * **Ghost Trader trades channel** *(optional)* โ€” trade entries, exits, TP1 fires If you only configure one webhook, all messages go to the main channel. *** ## Quick Start **1. Create a Discord webhook** 1. Open your Discord server. 2. Right-click the channel where you want AIOKA signals to appear. 3. Click **Edit Channel** โ†’ **Integrations** โ†’ **Webhooks** โ†’ **New Webhook**. 4. Name the webhook (e.g. `AIOKA Signals`) and click **Copy Webhook URL**. **2. Add the webhook URL to your environment** In your Railway service `aioka` (or local `.env`): ```bash theme={null} DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/123456789/abcdef... ``` Restart the service. AIOKA will detect the webhook on next boot and start posting verdict + regime changes within 60 seconds. **3. (Optional) Separate Ghost Trader trades** Create a second webhook in your trades channel and set: ```bash theme={null} DISCORD_GHOST_WEBHOOK_URL=https://discord.com/api/webhooks/987654321/ghi... ``` Trade entries, TP1 fires, and exits will route to this channel instead. If this variable is unset, all messages go to the main webhook. **4. Verify it works** In Telegram, send `/discord_test` to your AIOKA bot. A test message should appear in your Discord channel within a few seconds. Use `/discord_status` to check current configuration. *** ## Message Types ### Verdict Update Posted to the **main channel** when the AIOKA Judiciary ruling changes. The verdict poller checks the latest verdict every 60 seconds. ``` ๐Ÿ‘ป AIOKA SIGNAL UPDATE โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” โšก ACCUMULATE (was: REDUCE) ๐Ÿ“Š Confidence: 76.8% ๐Ÿ’ฐ BTC: $77,882 ๐ŸŽฏ Regime: ๐Ÿ‹ WHALE_ACCUMULATION ๐Ÿ“‰ RSI: 49.5 ๐ŸŒ‘ Dark Pool: 65/100 ๐Ÿ‘ป Ghost: WAITING โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” View Live Dashboard: https://aioka.io/live ๐Ÿ• 25 Apr 2026, 21:00 CEST ``` ### Ghost Trader โ€” Trade Entered Posted to the **trades channel** the moment a Ghost Trader entry is committed to the database (parallel to the existing Telegram entry alert). ``` ๐Ÿš€ GHOST TRADER โ€” TRADE ENTERED โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Entry: $77,598 TP1: $78,374 ๐ŸŽฏ TP2: $79,538 ๐ŸŽฏ SL: $76,325 Mode: A (RSI Auto-Pilot) โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Track Record: https://aioka.io/track-record ๐Ÿ• 25 Apr 2026, 05:32 CEST ``` ### Ghost Trader โ€” Trade Closed Posted to the **trades channel** on every full close path: TP2, TSL, Stop Loss, Score Sell, Regime Exit, Conviction Exit, and Flash Crash Emergency Exit. ``` โœ… GHOST TRADER โ€” TRADE CLOSED โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Exit: $77,931 | Result: WIN ๐ŸŽฏ P&L: +$261.00 (+1.04%) Hold: 13h 53m TP1 fired: โœ… Exit: TSL (Trailing Stop) โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Track Record: https://aioka.io/track-record ๐Ÿ• 25 Apr 2026, 19:26 CEST ``` ### TP1 Fired Posted to the **trades channel** when the partial 50% sell at TP1 executes and the Break-Even Shield activates. ``` ๐ŸŽฏ GHOST TRADER โ€” TP1 FIRED โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Price: $78,500.00 P&L locked: +$330.00 (+0.85%) Remaining: 0.005000 BTC Shield: Break-Even ACTIVE โœ… โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” ๐Ÿ• 25 Apr 2026, 16:00 CEST ``` ### Regime Change Posted to the **main channel** when the HMM market regime classifier flips. The regime poller checks every 60 seconds. ``` ๐Ÿ”„ REGIME CHANGE โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Previous: RANGING New: ๐Ÿ‹ WHALE_ACCUMULATION Confidence: 94.2% โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Live Dashboard: https://aioka.io/live ๐Ÿ• 25 Apr 2026, 15:30 CEST ``` *** ## Configuration Reference | Env var | Required | Default | Description | | - | - | - | - | | `DISCORD_WEBHOOK_URL` | Recommended | empty | Main signals channel webhook. If unset, Discord notifications are disabled. | | `DISCORD_GHOST_WEBHOOK_URL` | Optional | empty | Ghost Trader trades channel webhook. Falls back to `DISCORD_WEBHOOK_URL` when unset. | Both variables are **optional**. If neither is set, Discord notifications are silently disabled โ€” no error, no log spam, no impact on trading. *** ## Telegram Diagnostic Commands If you also have the AIOKA Telegram bot configured, you can manage Discord from there: | Command | Purpose | | - | - | | `/discord_status` | Check whether webhooks are configured + last successful send timestamp | | `/discord_test` | Send a test message to the Discord channel to verify the webhook is live | Both commands are admin-only (`_require_auth`). *** ## Rate Limits & Reliability * **Rate limit:** AIOKA enforces a global **5-second minimum interval** between any two Discord posts to stay well within Discord's webhook rate limit. * **Truncation:** Messages exceeding Discord's 2,000-character hard limit are automatically truncated with a `... (truncated)` marker. * **Graceful degradation:** Every Discord call is fire-and-forget and wrapped in try/except. Discord outages, DNS failures, or invalid webhooks **never block trading logic** โ€” they're logged as `WARNING` and silently dropped. * **Restart safety:** Verdict + regime polling state is intentionally ephemeral. After a Railway restart, AIOKA establishes a new baseline on the first poll cycle (\~60s) โ€” no duplicate alerts and no missed transitions. *** ## Troubleshooting | Symptom | Likely cause | Fix | | - | - | - | | `/discord_status` says "DISABLED" | `DISCORD_WEBHOOK_URL` not set | Set the variable in Railway env and redeploy. | | `/discord_test` returns โŒ | Webhook deleted or invalid URL | Re-create the Discord webhook and update the env var. | | No verdict updates after deploy | Less than 60s since restart | Wait one poll cycle. The first observed verdict establishes the baseline; the next change fires the alert. | | Messages truncated mid-line | Message exceeded 2000 chars | Expected โ€” Discord enforces a hard 2000-char limit per webhook payload. | | Trading not affected by Discord outage | Working as designed | Discord failures are silent. Check Railway logs for `discord_send_failed` warnings if needed. | *** ## Related Endpoints * [`/v1/tradingview/signal`](/api-reference/tradingview/signal) โ€” same data, polled by Pine Script * [`/v1/integrations/zapier/signal`](/api-reference/integrations/zapier) โ€” same data, polled by Zapier / n8n * [Webhooks API](/webhooks) โ€” programmatic event subscriptions for Basic+ tiers # n8n Integration Guide Source: https://docs.aioka.io/integrations/n8n Step-by-step guide to connect AIOKA signals to n8n workflows โ€” Telegram alerts, Discord notifications, and more. ## Overview n8n is an open-source workflow automation platform. Connect AIOKA to Telegram, Discord, Slack, email, or any webhook destination โ€” without writing code. **Tier:** Basic (\$49/mo) ๐Ÿ”’ **Endpoint:** `GET /v1/integrations/zapier/signal` **Poll interval:** 5 minutes (respects 60s server-side cache) *** ## Quick Start โ€” Import the Template The fastest way to get started is to import the pre-built workflow template. **1. Download the workflow template** Download [n8n-workflow.json](/integrations/n8n-workflow.json) and save it locally. **2. Open n8n and import** In your n8n instance: 1. Go to **Workflows** in the sidebar 2. Click **+ Add Workflow** 3. Click the **โ‹ฎ** menu โ†’ **Import from File** 4. Select the downloaded `n8n-workflow.json` **3. Set your API key credential** The workflow uses an HTTP Request node with a header credential: 1. Open the **HTTP Request** node 2. Under **Authentication**, click **Create New Credential** 3. Set **Header Name:** `X-API-Key` 4. Set **Header Value:** `aik_basic_YOUR_KEY_HERE` 5. Save the credential **4. Configure your Telegram bot (optional)** If you want Telegram alerts: 1. Open the **Telegram** node 2. Click **Create New Credential** 3. Enter your **Bot Token** and **Chat ID** 4. Customize the message template if desired **5. Activate the workflow** Toggle the workflow to **Active**. It will poll AIOKA every 5 minutes and send a Telegram message whenever the verdict changes. *** ## Manual Setup If you prefer to build the workflow from scratch: ### 1. Schedule Trigger Add a **Schedule Trigger** node: * **Trigger at:** Every 5 minutes ### 2. HTTP Request โ€” Fetch AIOKA Signal Add an **HTTP Request** node: * **Method:** `GET` * **URL:** `https://api.aioka.io/v1/integrations/zapier/signal` * **Authentication:** Header Auth * **Name:** `X-API-Key` * **Value:** `aik_basic_YOUR_KEY` ### 3. Store Last Verdict ID Add a **n8n Static Data** node (or a **Set** node writing to workflow static data): ``` lastVerdictId = {{ $json.id }} ``` ### 4. IF Node โ€” Check for New Verdict Add an **IF** node: ``` {{ $json.id }} is not equal to {{ $workflow.staticData.lastVerdictId }} ``` **True branch** โ†’ New verdict detected, continue to notification\ **False branch** โ†’ Same verdict, stop ### 5. Update Stored ID After the IF (true branch), add a **Code** node: ```javascript theme={null} $workflow.staticData.lastVerdictId = $input.item.json.id; return $input.item; ``` ### 6. Send Telegram Message Add a **Telegram** node: * **Operation:** Send Message * **Chat ID:** `YOUR_CHAT_ID` * **Text:** ``` ๐Ÿค– AIOKA Verdict: {{ $json.verdict }} ({{ $json.confidence }}% confidence) ๐Ÿ“Š Regime: {{ $json.regime }} ๐ŸŒŠ Dark Pool: {{ $json.dark_pool }}/100 ๐Ÿ“ˆ RSI: {{ $json.rsi }} ๐Ÿ‘ป Ghost Trader: {{ $json.ghost_status }} ๐Ÿ• {{ $json.readable_time }} ``` *** ## Response Fields Reference | Field | Type | Description | | - | - | - | | `id` | string | SHA-256\[:16] deduplication key โ€” changes on new verdict | | `verdict` | string | `STRONG_BUY` / `BUY` / `ACCUMULATE` / `HOLD` / `REDUCE` / `SELL` / `STRONG_SELL` / `PENDING` | | `confidence` | float | Judiciary composite confidence 0โ€“100 | | `regime` | string | Current HMM market regime | | `dark_pool` | int | Flow score 0โ€“100 from the inputs that have real data (today: exchange flow only) | | `rsi` | float | BTC 1H RSI(14) | | `ema_200` | float | BTC 1H EMA(200) | | `btc_price` | float | Live BTC spot price | | `ghost_status` | string | `WAITING` or `IN_POSITION` | | `timestamp` | string | ISO 8601 with Prague TZ offset | | `readable_time` | string | Human-readable Prague CEST/CET time | *** ## Example: Discord Notification Replace the Telegram node with a **Discord** node: * **Operation:** Send Message * **Message:** ``` **AIOKA** | {{ $json.verdict }} @ {{ $json.confidence }}% confidence Regime: {{ $json.regime }} | Dark Pool: {{ $json.dark_pool }}/100 {{ $json.readable_time }} ``` *** ## Example: Google Sheets Logging Append every verdict change to a spreadsheet for historical tracking: 1. After the IF node (true branch), add **Google Sheets โ†’ Append Row** 2. Map columns: * **A:** `{{ $json.timestamp }}` * **B:** `{{ $json.verdict }}` * **C:** `{{ $json.confidence }}` * **D:** `{{ $json.regime }}` * **E:** `{{ $json.btc_price }}` * **F:** `{{ $json.id }}` *** ## Troubleshooting | Symptom | Cause | Fix | | - | - | - | | HTTP 401 | Missing or wrong API key | Check `X-API-Key` header value | | HTTP 403 | Free tier key | Upgrade to Basic at [aioka.io/pricing](https://aioka.io/pricing) | | HTTP 429 | Rate limit exceeded | Reduce poll frequency โ€” 5 min is the recommended minimum | | Duplicate alerts | Deduplication not wired | Add the IF node checking `id` field | | Always same `id` | Verdict hasn't changed | This is expected โ€” `id` only changes when AIOKA issues a new ruling | *** ## Related * [Zapier Quick Start](/api-reference/integrations/zapier) * [GET /v1/integrations/zapier/signal](/api-reference/integrations/zapier) * [API Keys](/api-reference/keys/generate) # Introduction Source: https://docs.aioka.io/introduction AI-powered crypto market intelligence for developers # AIOKA Intelligence API AIOKA Intelligence API gives you programmatic access to our AI Council verdicts, live market signals, regime detection, and Ghost Trader entry signals. > [!NOTE] > > **Start in 60 seconds โ€” free forever.** > No credit card required. 100 API calls/day. > [Generate your free API key โ†’](https://api.aioka.io/v1/keys/generate) ## What is AIOKA? AIOKA runs councils of **specialized AI agents** that analyze live market signals 24/7 and reach consensus verdicts on crypto, commodities, and FX market conditions. Every ruling is backed by on-chain data, macro environment analysis, options market signals, and liquidity intelligence. > [!WARNING] > > **Current status (October 2026):** since 4 October 2026 only the Bitcoin council runs -- > nine specialist agents plus a Chief Judge -- and the Ghost Trader trades in paper mode > (simulated trades at live Kraken prices, no real capital). The other councils listed below > are paused; their status endpoints answer `"status": "PAUSED"`. The Ghost Trader framework supports seven assets (all paper mode): * BTC (Bitcoin) -- frozen reference path, the only council running today * ETH (Ethereum) -- 6-agent crypto council * SOL (Solana) -- 6-agent crypto council * TAO (Bittensor) -- 6-agent crypto council, AI-narrative * Gold (XAU/USD) -- 6-agent commodities council, real-rate Gate 8 * EUR/USD -- 6-agent Forex council, weekend gap protection, news blackout for FOMC/NFP/CPI/ECB (Sprint 186) * ADA (Cardano) -- 6-agent crypto council, 7-gate framework (no network gate), 4-decimal pricing (Sprint 184) Each asset runs an isolated trader and council loop. None touch the BTC reference path (rule F-1). All ship with paper-mode validation gates: 10 closed paper trades plus a documented sprint approval before real capital is unlocked. TAO ("AI trading AI") is AIOKA's most advanced council asset -- 6 Bittensor-specific specialist agents (SUBNET\_ORACLE, MACRO\_SAGE, AI\_NARRATIVE, MOMENTUM\_HUNTER, LIQUIDITY\_GUARDIAN, RISK\_WARDEN) deliberate on subnet growth, staking dynamics, AI sector sentiment, and a Kraken order-book liquidity floor (Gate 0) unique to TAO. > [card] AI Council Verdicts > > Real-time rulings from the Bitcoin council's nine specialist agents with confidence scores and consensus > [card] Agent Accuracy Stats > > Historical hit rate of each AI Council agent, graded against the outcome of every closed BTC trade > [card] 27 Live Signals > > On-chain, macro, options, liquidation, and liquidity data โ€” all in one feed > [card] Regime Detection > > HMM-powered market regime classification with 5 granular v2 regime labels > [card] Ghost Trader Signals (BTC + ETH + SOL + TAO + ADA) > > Live entry gate conditions -- BTC in paper mode (no real capital); the ETH, SOL, TAO and ADA traders are paused since 2026-10-04. SOL adds Gate 0 (Solana network health); TAO adds Gate 0 (Kraken liquidity floor) plus 6 Bittensor specialist agents. ADA runs the standard 7-gate framework with 4-decimal pricing. > [card] Dark Pool Monitoring > > OTC and institutional flow intelligence โ€” dark pool score, exchange reserve changes, stablecoin minting > [card] News NLP & Fed Sentiment > > Keyword-based hawkish/dovish Fed tone analysis and macro news risk scoring > [card] Flash Crash Protection > > Circuit breaker detection across 5/15/30-minute windows โ€” emergency exit signals before TSL triggers > [card] Monte Carlo Stress Testing > > Probabilistic BTC price path simulations for risk management and portfolio stress testing > [card] [Get your free API key](https://docs.aioka.io/quickstart) > > Free forever. 100 calls/day. No credit card. Live in 60 seconds. ## Get Started in 60 Seconds **1. Get your free API key** Generate a free key instantly โ€” no credit card required. ```bash theme={null} curl -X POST https://api.aioka.io/v1/keys/generate \ -H "Content-Type: application/json" \ -d '{ "name": "My Trading Bot", "email": "you@example.com" }' ``` You'll receive your key instantly: ```json theme={null} { "api_key": "aik_free_xxxxxxxxxxxx", "tier": "free", "calls_per_day": 100, "message": "Welcome to AIOKA!" } ``` **2. Make your first call** ```bash theme={null} curl https://api.aioka.io/v1/verdict/latest \ -H "X-API-Key: aik_free_your_key_here" ``` **3. Upgrade for more data** Basic (\$49/mo) unlocks signals and history. Pro (\$199/mo) unlocks AI Council and Ghost Trader signals. [View pricing โ†’](/tiers) ## Architecture AIOKA Intelligence API is a **read-only** window into the AIOKA trading system. It never modifies trading positions, verdicts, or any operational state. > [card] AIOKA Core > > **Railway Service #1** โ€” writes to Neon DB > > **Ghost Trader BTC** โ€” Live trading > > **Ghost Trader ETH** โ€” Paper mode (building track record) > > **Ghost Trader SOL** โ€” Paper mode (building track record) > > **Ghost Trader TAO** -- Paper mode (building track record) > > **Ghost Trader ADA** -- Paper mode (building track record) > [card] AIOKA Intelligence API > > **Railway Service #2** โ€” reads from Neon DB > > Read-only window into the trading system. > > You are here. Data flows **one way**: the AIOKA core writes to a shared Neon database, and the Intelligence API reads from it. Your calls never affect the trading logic. # Quickstart Source: https://docs.aioka.io/quickstart Get AIOKA market intelligence into your app in under 5 minutes # Quickstart ## 1. Generate a Free Key ```bash theme={null} curl -X POST https://api.aioka.io/v1/keys/generate \ -H "Content-Type: application/json" \ -d '{"name": "My Trading Bot", "email": "you@example.com"}' ``` Response: ```json theme={null} { "api_key": "aik_free_a1b2c3d4e5f6g7h8i9j0", "tier": "free", "calls_per_day": 10, "calls_per_minute": 2, "message": "Store this key safely โ€” it cannot be recovered!" } ``` ## 2. Get the Latest Verdict ```bash theme={null} curl https://api.aioka.io/v1/verdict/latest \ -H "X-API-Key: aik_free_a1b2c3d4e5f6g7h8i9j0" ``` Response: ```json theme={null} { "ruling": "ACCUMULATE", "confidence": 0.782, "score": 0.438, "btc_price": 67124.0, "timestamp": "2026-04-03T10:22:00Z", "cached": false, "cache_ttl_seconds": 60 } ``` ## 3. Check the Market Regime ```bash theme={null} curl https://api.aioka.io/v1/regime/current \ -H "X-API-Key: aik_free_a1b2c3d4e5f6g7h8i9j0" ``` Response: ```json theme={null} { "regime": "BULL_TRENDING", "confidence": 0.84, "btc_price": 67124.0, "detected_at": "2026-04-03T10:00:00Z", "cached": true, "cache_ttl_seconds": 290 } ``` ## 4. Build a Simple Alert Bot ```python theme={null} import httpx import time API_KEY = "aik_free_your_key_here" BASE_URL = "https://api.aioka.io" client = httpx.Client( base_url=BASE_URL, headers={"X-API-Key": API_KEY}, ) def check_verdict(): resp = client.get("/v1/verdict/latest") data = resp.json() ruling = data["ruling"] confidence = data["confidence"] if ruling in ("STRONG_BUY", "BUY") and confidence > 0.75: print(f"๐ŸŸข BULLISH SIGNAL: {ruling} ({confidence:.0%} confidence)") elif ruling in ("STRONG_SELL", "SELL"): print(f"๐Ÿ”ด BEARISH SIGNAL: {ruling}") else: print(f"โšช {ruling} โ€” waiting") # Poll every 5 minutes (respects free tier limits) while True: check_verdict() time.sleep(300) ``` ## Next Steps > [card] [Upgrade to Basic](/tiers) > > Get 27 live signals and verdict history for \$49/mo > [card] [API Reference](/api-reference/verdict/latest) > > Full endpoint documentation with examples # Pricing & Tiers Source: https://docs.aioka.io/tiers Choose the right AIOKA Intelligence API plan for your use case # Pricing & Tiers > [!WARNING] > > **Current status (October 2026):** paid plans are paused, and since 4 October 2026 only the > Bitcoin council runs. The Ghost Trader trades in paper mode -- simulated trades at live Kraken > prices, no real capital. Status endpoints for the paused assets (ETH, SOL, TAO, ADA, Gold, > EUR/USD) answer `"status": "PAUSED"`; their track records stay available as history. | Feature | Free | Basic | Pro | | - | - | - | - | | **Price** | \$0 | \$49/mo | \$199/mo | | **Calls/day** | 100 | 1,000 | 10,000 | | **Calls/minute** | 2 | 30 | 100 | | **Latest Verdict** | โœ… | โœ… | โœ… | | **Current Regime** | โœ… | โœ… | โœ… | | **Health Check** | โœ… | โœ… | โœ… | | **27 Live Signals** | โŒ | โœ… | โœ… | | **Verdict History** | โŒ | โœ… | โœ… | | **Regime History** | โŒ | โœ… | โœ… | | **Cross-Asset Macro Correlation** | โŒ | โœ… | โœ… | | **Dark Pool Score** | โŒ | โœ… | โœ… | | **News NLP / Fed Tone** | โŒ | โœ… | โœ… | | **Flash Crash Alerts** | โŒ | โœ… | โœ… | | **Monte Carlo Results** | โŒ | โœ… | โœ… | | **AI Council Session** | โŒ | โŒ | โœ… | | **Ghost Trader Signals (BTC + ETH ๐Ÿงช + SOL ๐Ÿงช)** | โŒ | โŒ | โœ… | | **SOL Ghost Trader Signals** | โœ… | โœ… | โœ… | | **SOL Network Health (Gate 0)** | โœ… | โœ… | โœ… | | **TAO Ghost Trader Status + Track Record** | โœ… | โœ… | โœ… | | **TAO Council Verdict (6 Specialist Agents)** | โŒ | โŒ | โœ… | | **TAO Live Signals (9 signals)** | โŒ | โŒ | โœ… | | **TAO Council Run (manual trigger)** | โŒ | โŒ | โœ… | | **ADA Ghost Trader Status + Track Record** | โœ… | โœ… | โœ… | | **Multi-Asset Performance by Regime** | โœ… | โœ… | โœ… | | **Signal History** | โŒ | โŒ | โœ… | | **Backtesting** | โŒ | โŒ | โœ… | ## Free Tier Perfect for getting started, building proof-of-concepts, or integrating AIOKA signals into personal dashboards. * 100 API calls per day * Access: `verdict/latest`, `agents/performance`, `regime/current`, `health` * No credit card required ### AI Council Agent Accuracy (Sprint 354) * `GET /v1/agents/performance` -- historical directional accuracy of each AI Council agent, graded against the outcome of every closed BTC trade (BTC only; cached 1h) ### EUR/USD Forex Ghost Trader (Sprint 186) * `GET /v1/forex/eurusd/status` -- live EUR/USD trader state, 9 gate evaluations, latest council verdict, live spread + bid/ask * `GET /v1/forex/eurusd/track-record` -- full EUR/USD trade history with stats (P\&L in both pips and USD, validated paper trades X/10) EUR/USD is AIOKA's first non-crypto, non-commodity asset. Field names use snake\_case throughout. ### ADA (Cardano) Ghost Trader (Sprint 184) * `GET /v1/ada/status` -- live ADA Ghost Trader state, latest council verdict, regime, ADA price, RSI(1H), EMA 200 * `GET /v1/ada/track-record` -- full ADA trade history with derived stats (total trades, win rate, total PnL, avg hold, best/worst) ADA prices use **4 decimal places** (e.g. `$0.4812`). ADA uses the **7-gate** entry framework -- no Gate 0 (network health) because Cardano has no significant network outages. Paper-mode only: AIOKA ADA Ghost Trader simulates entries until 10 validated paper trades have closed. ### Multi-Asset Performance by Regime (Sprint A2) * `GET /v1/ghost/regime-performance` -- Ghost Trader win rate and P\&L aggregated by market regime across **all 7 councils** (BTC, ETH, SOL, ADA, TAO, Gold, EUR/USD). UNIONs every per-asset ghost-trade table, groups by the regime label persisted at entry, returns one row per regime sorted by trade count. Public, no API key required. 300-second cache. Powers the aioka.io "Performance by Regime" widget. ### Bitcoin Cycle Context (Sprint 365) * `GET /v1/cycle/status` -- deterministic cycle phase, Pi Cycle Top status, halving timing, on-chain valuation (MVRV-Z, NUPL, SOPR) and the cycle agent's plain-English summary. Public, no API key required. 300-second cache. [Get your free key โ†’](/api-reference/keys/generate) ## Basic Tier โ€” \$49/month For active traders who want the full signal picture. * 1,000 API calls per day * Everything in Free, plus: * All 27 live market signals * Verdict history (last 24h) * Regime history (last 7 days) * Cross-asset macro correlation (DXY, US10Y, Gold, BTC-Nasdaq, BTC Dominance) * Dark Pool Score โ€” OTC/institutional flow intelligence * News NLP & Fed Tone โ€” keyword-based Fed hawkish/dovish sentiment * Flash Crash Alerts โ€” circuit breaker detection across 5/15/30-min windows * Monte Carlo stress testing results [Contact us to upgrade โ†’ info@aioka.io](mailto:info@aioka.io) ## Pro Tier โ€” \$199/month For algorithmic traders and research teams who need the full intelligence stack. * 10,000 API calls per day * Everything in Basic, plus: * AI Council -- BTC (nine specialist agents + Chief Judge). The ETH / SOL / TAO / ADA / Gold / EUR-USD councils are paused since 2026-10-04. * Ghost Trader entry signals -- BTC, in paper mode (simulated trades at live Kraken prices, no real capital) * TAO Council (paused since 2026-10-04) -- 6 Bittensor specialist agents (SUBNET\_ORACLE, MACRO\_SAGE, AI\_NARRATIVE, MOMENTUM\_HUNTER, LIQUIDITY\_GUARDIAN, RISK\_WARDEN) + Chief Judge. Pro-only due to taostats.io data costs and specialist agent complexity. * TAO Live Signals (9 signals) -- subnet growth, staking ratio, emission rate, GitHub activity, AI sector sentiment, DeFi revenue, institutional positioning * Signal history for any of 27 signals * Historical backtesting (up to 90 days) [Contact us to upgrade โ†’ info@aioka.io](mailto:info@aioka.io) ## Rate Limit Headers All responses include these headers: ``` X-RateLimit-Tier: free X-RateLimit-Calls-Today: 3 X-RateLimit-Calls-Limit: 100 X-RateLimit-Reset-At: 2026-04-04T00:00:00Z ``` ## Caching Responses are cached in Redis to reduce load and improve latency. The `cached` field in every response indicates whether the data came from cache: ```json theme={null} { "ruling": "ACCUMULATE", "cached": true, "cache_ttl_seconds": 45 } ``` Cache TTLs by endpoint: | Endpoint | TTL | | - | - | | `verdict/latest` | 60s | | `agents/performance` | 3600s | | `verdict/history` | 120s | | `regime/current` | 300s | | `regime/history` | 300s | | `signals/latest` | 30s | | `signals/history` | 300s | | `council/latest` | 60s | | `ghost/signal` | 30s | | `ghost/status` | 60s | | `eth/status` | 60s | | `eth/track-record` | 300s | | `sol/status` | 60s | | `sol/track-record` | 300s | | `tao/status` | 60s | | `tao/track-record` | 300s | | `tao/council` | 60s | | `tao/signals` | None (always fresh) | | `ada/status` | 60s | | `ada/track-record` | 300s | | `commodities/gold/status` | 60s | | `commodities/gold/track-record` | 300s | | `forex/eurusd/status` | 60s | | `forex/eurusd/track-record` | 300s | | `cycle/status` | 300s | | `backtest` | 3600s | | `monte-carlo/btc` | 3600s | # TradingView Integration Source: https://docs.aioka.io/tradingview Overlay AIOKA AI signals on any BTC chart with the free Pine Script v5 indicator > [!NOTE] > > The AIOKA Pine Script indicator is **free** on TradingView. It requires an > AIOKA API key to fetch live signals. > [Get a free key โ†’](/api-reference/keys/generate) ## What The Indicator Shows The AIOKA Pine Script indicator overlays these signals on any BTC chart: * **ACCUMULATE / REDUCE labels** above and below candles when the Judiciary verdict flips * **Ghost Trader entry / exit markers** โ€” gold triangles at the exact bars the internal paper-trading engine opens and closes positions * **Regime background color** โ€” a subtle tint reflecting the current HMM regime (bull trend, low volatility, whale accumulation, etc.) * **EMA 200 overlay** โ€” the exact 1H EMA(200) Ghost Trader uses, not a TradingView recomputation * **Bottom info panel** โ€” a compact table in the lower-right showing: * Verdict * Confidence % * Dark Pool score (0-100) * 1H RSI * Ghost Trader status ## Installation **1. Get a free AIOKA API key** Generate a key at [api.aioka.io/v1/keys/generate](https://api.aioka.io/v1/keys/generate). Save the value โ€” it is shown once. **2. Open the Pine Editor on TradingView** On any chart, click **Pine Editor** at the bottom of the screen. **3. Paste the indicator source** Copy the source from [`aioka-signals.pine`](https://github.com/aioka-io/aioka/blob/main/docs/tradingview/aioka-signals.pine) into the Pine Editor and click **Save**, then **Add to chart**. **4. Paste your API key** In the indicator settings, paste your key into the **API Key** field. ## Free vs Paid Limits | Tier | Daily calls | Per-minute | Price | | - | - | - | - | | **Free** | 100 | 2 | \$0 | | **Basic** | 1,000 | 30 | \$49/mo | | **Pro** | 10,000 | 100 | \$199/mo | The indicator polls `GET /v1/tradingview/signal` once per bar close. On a 1H chart that is 24 calls/day โ€” well inside the Free tier. On a 1m chart you will burn through 100 calls in under two hours; upgrade to **Basic** to stay live around the clock. ## How The Data Gets Into Pine Script Pine Script v5 cannot issue arbitrary HTTP requests, so AIOKA publishes its signals as a set of numeric symbols under the `AIOKA:*` namespace: | Symbol | Value | | - | - | | `AIOKA:VERDICT` | Numeric ruling code (-3 โ€ฆ +3) | | `AIOKA:CONFIDENCE` | 0-100 composite confidence | | `AIOKA:DARK_POOL` | 0-100 dark pool score | | `AIOKA:RSI` | BTC 1H RSI(14) | | `AIOKA:EMA200` | BTC 1H EMA(200) | | `AIOKA:REGIME` | Numeric regime code | | `AIOKA:GHOST` | 0 WAITING / 1 READY / 2 IN\_POSITION | The indicator uses `request.security()` to pull each of these series. Your API key authenticates your AIOKA publisher account so TradingView can serve the feed to your chart; the key is **never transmitted from your browser** to an external host. ## Alerts The indicator exposes four native TradingView alerts you can wire into your normal notification flow (email, SMS, webhook, push): * **Ghost Trader Entered** โ€” fires at the bar Ghost opens a new position * **Ghost Trader Exited** โ€” fires at the bar Ghost closes a position * **Bullish Verdict Flip** โ€” fires when the verdict becomes STRONG\_BUY / BUY / ACCUMULATE * **Bearish Verdict Flip** โ€” fires when the verdict becomes REDUCE / SELL / STRONG\_SELL To enable, right-click on the chart โ†’ **Add Alert** โ†’ pick the condition from the `AIOKA AI Signals` group. ## Screenshots *Screenshot placeholder โ€” see docs.aioka.io/tradingview for latest rendering.* BTC 1H chart with AIOKA AI Signals โ€” ACCUMULATE label fires below a Ghost Trader entry ## Troubleshooting > [accordion] The indicator shows 'n/a' on every field > > The indicator is waiting for the `AIOKA:*` feed to publish its first bar. > Give it one full hour after installation. > [accordion] I get a '429 rate limit exceeded' alert > > You are polling faster than your tier allows. Switch to a higher timeframe > (1H is enough for 24 calls/day) or upgrade your API key tier. > [accordion] Ghost Trader markers never appear > > The internal Ghost Trader engine is only active on BTC. If you load the > indicator on ETH / SOL / other charts the gold triangles will be quiet > until the multi-asset council spec ships. ## Related Endpoints * [`GET /v1/tradingview/signal`](/api-reference/tradingview/signal) โ€” the raw feed the indicator consumes * [`GET /v1/verdict/latest`](/api-reference/verdict/latest) โ€” full Judiciary verdict including explanation context * [`GET /v1/ghost/status`](/api-reference/ghost/status) โ€” Ghost Trader 7/7 gate breakdown # Webhooks Source: https://docs.aioka.io/webhooks Receive real-time push events for verdicts, regime changes, and Ghost Trader signals โ€” no polling required # Webhooks Webhooks let you subscribe to AIOKA events and receive HTTP POST notifications the moment something happens โ€” no polling needed. **Available to:** Basic tier and above (`$49/mo`) *** ## How It Works 1. Register a webhook endpoint URL with the event types you want to receive 2. AIOKA signs every delivery with an HMAC-SHA256 signature using your webhook secret 3. Your server verifies the signature and processes the payload 4. AIOKA retries failed deliveries up to 3 times with exponential backoff (5s โ†’ 25s โ†’ 125s) 5. A subscription is auto-disabled after 10 consecutive delivery failures *** ## Supported Events | Event Type | Trigger | | - | - | | `verdict.new` | New Judiciary ruling produced (every \~5 min cycle) | | `council.new` | New AI Council session completed (every \~30 min) | | `regime.change` | Market regime transition detected | | `ghost.signal` | Ghost Trader entry/exit signal fired | | `macro.alert` | Cross-asset macro alert (Risk-Off Score โ‰ฅ 70, Fed hawkishness spike) | *** ## Registering a Webhook ```bash theme={null} curl -X POST https://api.aioka.io/v1/webhooks \ -H "X-API-Key: your_api_key" \ -H "Content-Type: application/json" \ -d '{ "url": "https://yourserver.com/aioka-webhook", "events": ["verdict.new", "regime.change"] }' ``` Response includes your `webhook_secret` โ€” **store it securely**. It is shown only once and cannot be retrieved later. ```json theme={null} { "id": "wh_abc123", "url": "https://yourserver.com/aioka-webhook", "events": ["verdict.new", "regime.change"], "secret": "whsec_a1b2c3d4...", "is_active": true, "created_at": "2026-04-20T12:00:00Z" } ``` *** ## Verifying Signatures Every delivery includes an `X-AIOKA-Signature` header containing an HMAC-SHA256 hex digest of the raw request body, signed with your webhook secret. ```python theme={null} import hmac import hashlib def verify_webhook(payload_bytes: bytes, signature_header: str, secret: str) -> bool: expected = hmac.new( secret.encode(), payload_bytes, hashlib.sha256 ).hexdigest() return hmac.compare_digest(expected, signature_header) ``` **Always verify signatures** before processing a payload. Reject requests that fail verification with a `401`. *** ## Payload Format All events share a common envelope: ```json theme={null} { "event": "verdict.new", "timestamp": "2026-04-20T14:32:00Z", "data": { ... } } ``` ### `verdict.new` ```json theme={null} { "event": "verdict.new", "timestamp": "2026-04-20T14:32:00Z", "data": { "ruling": "STRONG_BUY", "composite_score": 0.82, "confidence": 0.79, "regime": "BULL_TRENDING" } } ``` ### `council.new` ```json theme={null} { "event": "council.new", "timestamp": "2026-04-20T14:00:00Z", "data": { "ruling": "BUY", "confidence": 0.76, "consensus_level": "STRONG", "agents_succeeded": 6 } } ``` ### `regime.change` ```json theme={null} { "event": "regime.change", "timestamp": "2026-04-20T13:45:00Z", "data": { "from_regime": "ACCUMULATION", "to_regime": "BULL_TRENDING", "confidence": 0.83 } } ``` *** ## Limits | Constraint | Value | | - | - | | Max webhooks per API key | 5 | | URL scheme | HTTPS only | | Max retries on failure | 3 (backoff: 5s โ†’ 25s โ†’ 125s) | | Auto-disable after failures | 10 consecutive failures | *** ## Managing Webhooks | Action | Endpoint | | - | - | | Register | `POST /v1/webhooks` | | List all | `GET /v1/webhooks` | | Delete | `DELETE /v1/webhooks/{id}` | | Send test event | `POST /v1/webhooks/test` | See the [API Reference โ†’ Webhooks](/api-reference/webhooks/register) section for full request/response schemas. *** ## Best Practices * **Respond quickly.** Return `200` as soon as you receive the delivery. Do heavy processing asynchronously. * **Verify signatures.** Never process a payload without first verifying the HMAC signature. * **Handle duplicates.** On retry, the same event may be delivered more than once. Use the `event` + `timestamp` combination to deduplicate. * **Store your secret securely.** Treat `whsec_*` like a password โ€” never log it or expose it in client-side code.