Skip to content

Add unique trader count tracking to bonding curve contract #985

Description

@Chucks1093

Summary

Extend the bonding curve contract to track unique wallet addresses that have traded a key, exposing a count metric and a has-traded check for analytics and eligibility logic.

Scope

  • Unique trader set updated on first buy or sell per wallet per key
  • get_unique_trader_count(key_id) — returns total unique traders
  • has_traded(key_id, wallet) — returns bool
  • Trader set stored efficiently using a bitmap or sorted set pattern
  • UniqueTraderAdded event emitted on first trade per wallet

Acceptance Criteria

  • Unique count increments only on first trade per wallet
  • Repeat trades by same wallet do not increment count
  • has_traded returns correct bool for traded and untouched wallets
  • UniqueTraderAdded event emitted exactly once per wallet
  • get_unique_trader_count returns correct value after bulk trades

ETA

24 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