Operator CLI
The layer command runs Layer's matching pipeline by hand. API users don't need it — it's for whoever operates Layer. The scheduled jobs run the same code every 6 hours.
Setup
cd ~/dev/layer
git pull && npm install
npm link # once: puts `layer` on your PATH
Every command says which database it's using, shows live progress, ends with ✓ or ✗, and suggests the next command. Add --local to use a local practice copy instead of the production database.
Commands
| Command | What it does |
|---|---|
layer status |
Health check: database, last pull per venue, schedule, review queue, local and live site. |
layer ingest [kalshi|polymarket] |
Pull every open market from both venues (about 3 minutes). Only changed rows are written. |
layer candidates [--category sports] [--series KXFEDDECISION] [--limit 500] [--recheck] |
Find possible matches and apply the hard checks. --recheck redoes a scope; decisions are kept. |
layer grade [--limit 50] [--category sports] [--apply] |
Claude grades waiting pairs. --apply puts ≥90% same bets live and removes confident mismatches. |
layer jev [--limit 500] [--apply] |
Jev gives a second opinion. Jev checks each confirmed outcome pairing on its own. --apply puts the lines both graders call the same bet (each ≥80%) live. |
layer review list |
Waiting pairs, with Claude's one-line verdict under each. |
layer review show [n] |
Pair #n (top if omitted): both rules and the suggested outcome pairing. |
layer review approve <kalshi_event> <poly_slug> --basis identical|equivalent_with_caveats [--caveats a,b] |
Approve a pair by hand. |
layer review reject <kalshi_event> <poly_slug> [--note "why"] |
Reject a pair; it won't be suggested again. |
layer settle [--limit 500] |
Check how live pairs that closed resolved on both venues. Lists every pair where they disagreed, with the reason, and opens a GitHub issue for each (needs a token saved with savekey github-issues-token). |
layer coverage |
Of upcoming events in core series (NFL, Premier League, Fed…), how many are live, and where the rest drop out of the pipeline. |
layer job <ingest-kalshi|ingest-polymarket|candidates|grade|settle> |
Run one scheduled job now. |
layer help |
All of the above. |
The schedule
Vercel runs the pipeline every 6 hours (UTC): :00 pull Kalshi, :05 pull Polymarket, :15 find candidates, :30 grade, :45 check settled matches. layer status shows whether it's running on time.