guardrail/deploy/trader/entrypoint.sh
caelum0x 9233588e80 feat(render): move daily trader to a Render Cron Job; remove GitHub Actions
- deploy/trader/{Dockerfile,entrypoint.sh}: node+python+twak image; restores the
  wallet keystore from TWAK_WALLET_JSON_B64 at runtime, runs daily_trade.py --live
- render.yaml: add 'guardrail-trader' cron (12:00 UTC daily); env vars set in
  dashboard (Render cron requires a paid plan; free tier is web-only)
- remove .github/workflows/daily-trade.yml + its secrets (avoid double-trading)
2026-06-19 01:50:32 +03:00

17 lines
597 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Render Cron Job entrypoint: restore the TWAK wallet keystore from a secret env
# var, then run one daily competition trade. The trader's own window guard
# (June 22–28) makes runs outside the window a safe no-op.
set -euo pipefail
if [ -z "${TWAK_ACCESS_ID:-}" ] || [ -z "${TWAK_WALLET_JSON_B64:-}" ]; then
echo "ERROR: TWAK_ACCESS_ID / TWAK_WALLET_JSON_B64 env vars are required" >&2
exit 2
fi
mkdir -p "$HOME/.twak"
echo "$TWAK_WALLET_JSON_B64" | base64 -d > "$HOME/.twak/wallet.json"
chmod 600 "$HOME/.twak/wallet.json"
exec python3 scripts/daily_trade.py --live