Skip to content

Implement protocol fee collection and treasury distribution contract #994

Description

@Chucks1093

Summary

Build a treasury contract that collects protocol fees from bonding curve trades, accumulates them, and distributes to designated recipients on a configurable schedule.

Scope

  • collect_fee(key_id, amount) — called by bonding curve on each trade
  • get_treasury_balance() — returns total accumulated fees
  • distribute(recipients[], amounts[]) — admin-only batch payout
  • FeeCollected and FeeDistributed events emitted
  • Distribution history stored per epoch

Acceptance Criteria

  • Fees accumulated correctly across all key trades
  • get_treasury_balance returns accurate running total
  • distribute validates amounts sum does not exceed balance
  • FeeCollected emitted on every trade with key ID and amount
  • Distribution history retrievable per epoch

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