Skip to content

Add cooldown enforcement to bonding curve trade functions #974

Description

@Chucks1093

Summary

Extend the bonding curve buy and sell functions with per-wallet cooldown enforcement, blocking trades within the creator-configured cooldown window after the last trade.

Scope

  • cooldown_duration stored per key in creator config
  • buy and sell functions check last_trade_time per wallet before executing
  • set_cooldown(key_id, duration) — creator-only config update
  • get_cooldown_status(key_id, wallet) — returns active flag and expires_at
  • CooldownViolation error returned with time_remaining on blocked trade

Acceptance Criteria

  • Trade blocked correctly within cooldown window
  • Trade succeeds after cooldown expires
  • set_cooldown validates duration within allowed range
  • get_cooldown_status returns correct expires_at
  • CooldownViolation error includes seconds_remaining

ETA

24 hours

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions