[object Object]

← back to Ken

Ken: scoped set-confidence.sh — fix endpoint to /api/trading/mode (was /api/risk → silent no-op); adjusts ONLY min_confidence 50-99

c49a8e1efe4171f00242e6c7870f6bbf0e2f8d28 · 2026-07-15 11:55:04 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit c49a8e1efe4171f00242e6c7870f6bbf0e2f8d28
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 15 11:55:04 2026 -0700

    Ken: scoped set-confidence.sh — fix endpoint to /api/trading/mode (was /api/risk → silent no-op); adjusts ONLY min_confidence 50-99
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 kalshi-dash/set-confidence.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/kalshi-dash/set-confidence.sh b/kalshi-dash/set-confidence.sh
new file mode 100755
index 0000000..6018893
--- /dev/null
+++ b/kalshi-dash/set-confidence.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Adjust ONLY Ken's auto-trader min_confidence threshold (real-money entry filter).
+# Deliberately narrow: it cannot touch safe_mode, enabled, budget, or position caps —
+# so a permission grant for this script pre-approves *only* the confidence knob.
+# Usage: set-confidence.sh <50-99>
+set -euo pipefail
+cd "$(dirname "$0")"
+
+VAL="${1:-}"
+if ! [[ "$VAL" =~ ^[0-9]+$ ]] || (( VAL < 50 || VAL > 99 )); then
+  echo "usage: set-confidence.sh <integer 50-99>  (got: '${VAL}')" >&2
+  exit 2
+fi
+
+set -a; source .env; set +a
+: "${ADMIN_USER:?ADMIN_USER not set in .env}" "${ADMIN_PASSWORD:?ADMIN_PASSWORD not set in .env}"
+
+curl -s -u "$ADMIN_USER:$ADMIN_PASSWORD" -X POST http://127.0.0.1:7810/api/trading/mode \
+  -H 'Content-Type: application/json' \
+  -d "{\"action\":\"update_trade_config\",\"min_confidence\":${VAL}}" \
+| python3 -c "import sys,json;d=json.load(sys.stdin);tc=d.get('trade_config',{});print('min_confidence ->',tc.get('min_confidence'),'| unchanged: sources',tc.get('min_sources'),'budget',tc.get('budget_cents'),'maxpos',tc.get('max_position_cents'),'stoploss',tc.get('daily_loss_limit_cents'),'enabled',tc.get('enabled'))"

← d83c6ee Ken: retry/backoff in geminiAnalyze for shared-Ollama 'serve  ·  back to Ken  ·  Ken: set-confidence.sh fails loud (exit 1 + stderr) on any n 0331471 →