Skip to main content

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 ChannelIntegrationsWebhooksNew 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):
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:
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.

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 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.

TP1 Fired

Posted to the trades channel when the partial 50% sell at TP1 executes and the Break-Even Shield activates.

Regime Change

Posted to the main channel when the HMM market regime classifier flips. The regime poller checks every 60 seconds.

Configuration Reference

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: 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