← back to Ken Trade Siren

alert-real-trade.sh

35 lines

#!/bin/bash
# Fired by the siren's server-side watch loop when a NEW real Ken trade lands.
# Three channels so a real-money buy is never silent, browser tab open or not:
#   1) local sound (afplay + say) — works with no browser
#   2) CNCP parking-lot card
#   3) George email to steve-office
# Arg $1 = human label of the latest trade (e.g. "KXHIGHNY... yes x1 @ 0.76").
LABEL="${1:-a real Ken trade}"
CNCP="${CNCP:-http://127.0.0.1:3333}"
TS="$(date '+%Y-%m-%d %H:%M:%S %Z')"

# 1) LOCAL SOUND — non-blocking, best-effort
( afplay /System/Library/Sounds/Sosumi.aiff 2>/dev/null; \
  afplay /System/Library/Sounds/Sosumi.aiff 2>/dev/null; \
  say -r 190 "Ken just placed a real money trade. $LABEL" 2>/dev/null ) &

# 2) CNCP parking-lot card
curl -sS --max-time 10 "$CNCP/api/parking-lot" -H 'Content-Type: application/json' \
  -d "{\"url\":\"ken://real-trade\",\"note\":\"[KEN SIREN] Real-money trade placed at $TS — $LABEL. Ken is LIVE (real Kalshi order on the books).\"}" \
  >/dev/null 2>&1 && echo "[siren] CNCP card posted" || echo "[siren] CNCP post failed"

# 3) George email (steve-office)
if [ -f "$HOME/.claude/skills/_shared/george-send.sh" ]; then
  . "$HOME/.claude/skills/_shared/george-send.sh"
  HTML="<h2 style=\"color:#b23b3b\">🚨 Ken placed a REAL-money trade</h2>\
<div><b>${LABEL}</b></div><div style=\"color:#666\">${TS}</div>\
<div style=\"margin-top:10px\">Ken has a real Kalshi order on the books. \
Dashboard: <a href=\"http://127.0.0.1:7810\">127.0.0.1:7810</a> \
(real-money view: <a href=\"http://127.0.0.1:7810/?real=1\">/?real=1</a>).</div>"
  george_send steve-office steve@designerwallcoverings.com "🚨 Ken real-money trade placed — ${LABEL}" "$HTML" \
    >/dev/null 2>&1 && echo "[siren] George email sent" || echo "[siren] George email failed"
else
  echo "[siren] george-send.sh not found — email skipped"
fi