Skip to content

docs: add price alert bot recipe (closes #100)#108

Open
BigNathan1 wants to merge 1 commit into
Miracle656:mainfrom
BigNathan1:docs/alert-bot-recipe
Open

docs: add price alert bot recipe (closes #100)#108
BigNathan1 wants to merge 1 commit into
Miracle656:mainfrom
BigNathan1:docs/alert-bot-recipe

Conversation

@BigNathan1

Copy link
Copy Markdown

What

Adds a cookbook recipe and runnable example for an "if XLM > X notify me"
price alert bot, built on the existing WebSocket price stream (#L018).

Changes

  • docs/cookbook/alert-bot.md (new) — worked walkthrough covering the
    data flow, the price_update message shape, the bot code, run
    instructions, HMAC-signed notify forwarding, x402-gated streams, and the
    server-side webhook alternative. Includes a live-demo section
    (GraphiQL at http://localhost:3002/graphiql, the published OpenAPI
    reference, and the local ws://localhost:3002/ws stream).
  • examples/alert-bot/alert-bot.ts (new) — a minimal runnable bot that
    connects to /ws, watches a pair, and fires when the price crosses the
    threshold. Follows the existing oracle-relay example conventions
    (--help/--once, env-driven config, guarded entrypoint) and reuses
    crossesThreshold, buildThresholdAlertPayload, and
    deliverJsonWithRetries from src/alerts so the bot and server agree
    on crossing semantics.
  • examples/alert-bot/README.md (new) — environment table and run notes.
  • package.json — adds the alert:bot script.
  • .env.example — documents the ALERT_BOT_* variables.
  • README.md — links the new example and cookbook page.

Acceptance criteria

  • Worked example: yes — both the cookbook page and a runnable
    npm run alert:bot.
  • Live demo link: yes — GraphiQL IDE, published OpenAPI reference, and the
    local /ws stream.

Verification

Validated end-to-end with a temporary smoke harness (mirroring
scripts/ws-smoke.ts): a non-crossing update was ignored and a
0.14 -> 0.16 crossing fired ALERT XLM/USDC is above 0.15. No
production source files were changed.

closes #100

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@BigNathan1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Recipe: price alert bot

1 participant