Skip to content

Add bonding curve preset selection at creator registration #403

Description

@Chucks1093

Summary

Every creator currently uses the same bonding curve, which means the same price growth rate regardless of how they want to build their community. A creator who wants to reward early believers heavily needs a steep early curve. One who wants to stay accessible to late fans needs a flatter one. Letting creators choose a curve preset at registration makes the marketplace more expressive and gives each creator's keys a distinct character that matches their community strategy.

Scope

  • Define a CurvePreset enum with three variants stored in creator state:
    • Linear — price grows proportionally with supply (current default behavior)
    • Quadratic — price grows with the square of supply, rewards early buyers heavily
    • Flat — price grows slowly regardless of supply, keeps keys accessible at scale
  • Add curve_preset: CurvePreset parameter to register_creator (defaults to Linear if omitted for backwards compatibility)
  • Route buy and sell quote calculations through a shared compute_price(supply, amount, preset) function that dispatches to the correct formula per variant
  • Add get_curve_preset(creator_id) -> CurvePreset view function
  • The preset is immutable after registration

Acceptance Criteria

  • Linear preset produces the same prices as the current implementation (no regression)
  • Quadratic preset produces higher prices than Linear at the same supply level
  • Flat preset produces lower prices than Linear at the same supply level
  • get_curve_preset returns the correct variant for each registered creator
  • Two creators with different presets have independent price curves with no cross-contamination
  • Preset is unchanged after registration — no update function exists
  • All three presets satisfy buy/sell quote symmetry: quote for N keys in equals quote for N keys out at the same supply
  • Unit tests cover all three presets for buy quote, sell quote, and symmetry

Coordinate on Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignStellar WaveIssues in the Stellar wave program

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions