The watchlist + alerts system has three layers:Documentation Index
Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt
Use this file to discover all available pages before exploring further.
- Watched objects — what you’re tracking (ticker, query, URL, text).
- Alert rules — conditions on watched objects (
price_above,price_below,econ_release,gov_action,semantic_match). - Webhook endpoints — where alerts get delivered.
Add to watchlist
identify resolves a free-text query, URL, or ticker into a canonical watched object. The CLI handles dedupe and lifecycle.
Create an alert rule
| Condition | Trigger |
|---|---|
price_above | Yes price ≥ threshold (cents) |
price_below | Yes price ≤ threshold (cents) |
econ_release | FRED series prints (e.g., CPI release) |
gov_action | Bill / nomination / treaty status change |
semantic_match | LLM-classified content match |
active, paused, or archived. Test with sf alerts test <id>.
Register a webhook endpoint
Delivery and dedupe
Alert deliveries write to thealert_deliveries table with a stable dedupe key sha256(rule_id + channel + endpoint_id + window). The runtime worker (scripts/workers/alert-runtime.ts) won’t re-fire the same condition more than once per window.
Runtime architecture
A long-running worker on Fly.io (sf-alert-runtime) polls every 30s, prefers WebSocket from wss://app.simplefunctions.dev/ws for active tickers, falls back to REST. Vercel’s 1-min cron minimum couldn’t honor a 30s loop, so the evaluator was moved off Vercel.
Next steps
Watch + alert API
Endpoint shapes and curl examples.
Webhook events
Every event payload shape.
Webhook receiver
Verification + retry handling code samples.
Webhooks
Endpoint registration and signing.