Skip to content

Add price alert webhook registration for creator key price thresholds #423

@Chucks1093

Description

@Chucks1093

Summary

Fans who want to buy into a creator at a specific price have no way to know when that price is reached without manually checking. A price alert system lets a fan register a target price and a callback URL, and the server fires the webhook when the creator's key price crosses that threshold. This turns passive watchers into active buyers at the right moment.

Scope

  • Add POST /alerts to register an alert: { creator_id, wallet_address, target_price, direction, callback_url }
    • direction is either above (fire when price rises past target) or below (fire when price drops below target)
  • Add DELETE /alerts/:id to cancel a registered alert
  • When the indexer processes a trade event and the new price crosses any registered threshold, fire the registered callback_url via HTTP POST with payload: { creator_id, triggered_price, target_price, direction, timestamp }
  • A fired alert is automatically deleted after delivery (one-shot)
  • Failed webhook delivery is retried up to 3 times with exponential backoff

Acceptance Criteria

  • Alert registration returns a unique alert ID
  • Alert fires when price moves in the registered direction past the target
  • Alert does not fire if price moves in the opposite direction
  • Alert is deleted after successful delivery
  • Failed delivery is retried up to 3 times before the alert is marked failed
  • DELETE /alerts/:id cancels a pending alert before it fires
  • Integration test covers: above trigger, below trigger, cancellation, failed delivery retry

Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions