Skip to content

Build cooldown status API for rate-limited creator keys #968

Description

@Chucks1093

Summary

Implement an endpoint that returns the current cooldown state for a wallet/key pair, including time remaining, so the client can enforce trading restrictions accurately.

Scope

  • GET /keys/:keyId/cooldown?wallet= — returns active flag, expires_at, seconds_remaining
  • Cooldown state indexed from last trade event per wallet per key
  • Cooldown policy (duration) returned alongside status
  • Batch endpoint GET /cooldowns?wallet=&keys= for portfolio page
  • Cache per wallet/key pair with TTL equal to cooldown duration

Acceptance Criteria

  • Single endpoint returns correct active flag and seconds remaining
  • Batch endpoint handles up to 50 key IDs per request
  • Cooldown policy duration returned correctly from contract config
  • Cache expires precisely when cooldown ends
  • Post-trade hook invalidates cooldown cache for the trader

ETA

12 hours

Activity

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

Metadata

Metadata

Assignees

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