Skip to content

Build LP reward contract for liquidity providers on key pairs #1002

Description

@Chucks1093

Summary

Implement a liquidity provider reward contract that distributes a share of trading fees to wallets that provide liquidity for key pairs, proportional to their liquidity contribution.

Scope

  • add_liquidity(key_id, amount) — locks tokens as liquidity and records LP share
  • remove_liquidity(lp_id) — returns tokens plus accrued fee rewards
  • claim_lp_rewards(lp_id) — claims rewards without removing liquidity
  • get_lp_position(lp_id) — returns contribution, share, and pending rewards
  • LPAdded and LPRewardClaimed events emitted

Acceptance Criteria

  • LP share computed proportionally from total liquidity pool
  • Rewards accrue correctly proportional to share and trading volume
  • remove_liquidity returns correct principal plus rewards
  • claim_lp_rewards transfers correct pending amount
  • get_lp_position returns accurate values at any point

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