Files
winning-wallet-finder_github/.github/workflows/copybot.yml
T
jaxperro 08f87c589e paper-run realism: taker fees, resolved-only scoring, bounded collect, local runner
- copybot: model Polymarket taker fees (V2, since 2026-03-30: shares*rate*p*(1-p),
  sports 0.03) on every paper/live fill; track fees_paid in state + feed; settle
  P&L nets the entry fee. publish_feed now commits state + fills ledger with the
  feed (autostash rebase) so the local poller is the sole state writer.
- validate_timing: copy_pnl/held_pnl are fee-aware -> sharp selection now requires
  clearing real copy costs; conv stats + lead profile use resolved bets only.
- conviction_scan/skill: exclude res_t>now rows (early-sold positions in
  unresolved markets scored at curPrice - a mark, not an outcome; was ~5% of the
  June test window at a 72% pseudo-win rate).
- portfolio: skip unresolved rows (stake used to vanish from equity); missed bets
  of kind=open no longer KeyError - mark-to-market hypothetical P&L.
- collect: cap stale refreshes at STALE_CAP=2500/run (bulk-aged pool turned the
  daily refresh into a ~40h pull holding the DuckDB lock).
- Actions cron disabled: GitHub ran */5 every ~1.5-2.5h and the 10-min stale
  window skipped the rest -> 1 of ~104 qualifying buys copied. launchd --poll 60
  is now the runner; workflow stays as manual backstop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 23:15:14 -06:00

62 lines
2.4 KiB
YAML

name: copybot-paper
# 24/7 paper copy-trade test, run for free on GitHub Actions (public repo).
# Every 5 minutes it does one poll pass — settle resolved bets, copy any new
# conviction trade from the 4 wallets at $50 (cash-gated $1k book) — and commits
# the updated feed (live/copybot_live.json) + state. The dashboard at the top of
# jaxperro.com/trading reads the feed. State persists in the repo, so the book
# carries forward run to run. No server, no secrets: the built-in GITHUB_TOKEN
# pushes the feed. (Paper only — for LIVE real-money trading use a dedicated host,
# not Actions.)
on:
# cron DISABLED 2026-07-01: GitHub throttled "*/5" to one run every ~1.5-2.5h in
# practice, and copybot skips any trade older than RECENT_TRADE_WINDOW_S (10 min)
# — measured result: 1 of ~104 qualifying conviction buys copied June 25-Jul 1.
# The launchd poller (com.jaxperro.copybot.plist, --poll 60) is now the sole
# runner; it commits state + feed + fills itself. Keep this workflow for manual
# runs only — re-enabling the cron alongside the local poller would fork the
# book's state.
# schedule:
# - cron: "*/5 * * * *"
workflow_dispatch: {} # manual backstop from the Actions tab
permissions:
contents: write # GITHUB_TOKEN pushes the feed + state
concurrency:
group: copybot-paper # never overlap runs (state is committed)
cancel-in-progress: false
jobs:
poll:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Poll once
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} # optional; pings on placements
run: |
python3 copybot.py \
--config live/copybot.paper.json \
--state copybot_state.json \
--poll-once
- name: Commit feed + state (only on change)
run: |
git config user.name "copybot[bot]"
git config user.email "copybot@users.noreply.github.com"
git add -f live/copybot_live.json copybot_state.json
git add -f copybot_fills.jsonl 2>/dev/null || true # per-fill lag/slippage ledger
if git diff --cached --quiet; then
echo "no change this run"
exit 0
fi
git commit -m "copybot: paper poll [skip ci]"
git pull --rebase --autostash -q origin main || git rebase --abort || true
git push