Skip to content

feat(demo): seed script for guaranteed dashboard activity - #21

Open
ethanterrero wants to merge 1 commit into
mainfrom
feat/demo-seed-activity
Open

feat(demo): seed script for guaranteed dashboard activity#21
ethanterrero wants to merge 1 commit into
mainfrom
feat/demo-seed-activity

Conversation

@ethanterrero

Copy link
Copy Markdown
Owner

Summary

Real binary arbs on Polymarket are rare — the live bot typically finds zero opportunity_detected rows in a short collection window. Adds a curated SQL seed at supabase/seed_demo_activity.sql so the dashboard's Activity feed and Markets page are always populated for the blockchain-club talk.

What's in the seed

  • ~35 events across 18 markets — Fed policy, GDP, BTC/ETH price, sports, tech / corporate, pop culture. All plausible Polymarket-style binary questions.
  • Timestamps are now() - interval '...' so events land across the last 8 hours — matches the bot's real snapshot collection window so the Activity feed and Balance chart line up.
  • Kinds restricted to opportunity_detected and dry_run — the only two arb-recorder actually emits in dry-run mode. No fake fills; the demo stays truthful.
  • Prices / sizes / expected_profit within the same orders of magnitude the live bot would produce given the configured caps (max_order_size_usdc = 50, min_net_spread = 0.001).

Idempotency

Re-running appends a fresh batch with refreshed now() - timestamps. To re-anchor cleanly (e.g. right before the talk), delete from public.activity; first.

DEMO.md

New "Seed data" section between the slide queries and the reset steps explains how to run it and when to reseed.

Verified

  • Executed against kawgriwaxfgvgcvyepjj — 23 opportunity_detected + 13 dry_run rows total, total expected profit on dry-runs = $2.89.
  • Dashboard's sidebar now shows 18 Markets, 36 Activity events; Events-by-kind bar chart shows Opp + Dry with the other four kinds correctly empty.

Test plan

  • Paste the seed into Supabase SQL Editor → returns the kind-totals summary at the bottom
  • Dashboard's Markets page shows 18 cards
  • Dashboard's Activity page filters work over the seeded events
  • DEMO.md's "Slide numbers" queries return non-zero, sensible values

🤖 Generated with Claude Code

Real binary arbs on Polymarket are rare — a typical collection window
on the live bot finds zero `opportunity_detected` rows. To ensure the
Activity feed and Markets page always have something to show during
the blockchain-club presentation, this adds a curated SQL seed at
`supabase/seed_demo_activity.sql`.

What it does
- Inserts ~35 events across 18 plausible Polymarket-style markets
  (Fed policy, GDP, BTC/ETH price, sports outcomes, tech / corporate
  events, pop culture).
- Timestamps are `now() - interval '...'` so events land across the
  last 8 hours, matching the bot's real snapshot collection window.
- Kinds restricted to `opportunity_detected` and `dry_run` — the only
  two `arb-recorder` actually emits in dry-run mode. No fake fills.
- Prices, sizes, and expected_profit values are within the same orders
  of magnitude the live bot would produce given the configured caps.

How to use
- Run via Supabase SQL Editor (paste-in) or `psql -f ...`. See the
  new "Seed data" section in `DEMO.md`.
- Idempotent only in the additive sense — re-running appends a fresh
  batch with refreshed `now() -` timestamps. To re-anchor cleanly,
  `delete from public.activity;` first.

DEMO.md gets a new section pointing at the seed, between the slide
queries and the reset-to-production steps.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant