Skip to content

Add volume-based protocol fee discount tiers for high-activity creators #522

Description

@Chucks1093

Summary

Every creator currently pays the same protocol fee regardless of how much trading volume they generate. Rewarding high-volume creators with a reduced protocol fee gives them more earnings and incentivizes growing the platform. The admin configures discount tiers by cumulative trade volume, and the contract automatically applies the lowest eligible fee rate to each creator.

Scope

  • Add a DiscountTier config to protocol state: a list of { min_volume: i128, fee_bps: u32 } entries sorted by min_volume ascending
  • Track cumulative trade volume per creator: updated on every buy and sell, stored in creator state
  • On each buy/sell, determine the applicable fee bps by finding the highest tier the creator's cumulative volume qualifies for
  • Add update_discount_tiers(tiers: Vec<DiscountTier>) admin-only function — replaces the full tier list
  • Add get_discount_tiers() -> Vec<DiscountTier> view function
  • Add get_creator_volume(creator_id) -> i128 view function returning cumulative trade volume
  • Maximum 5 discount tiers

Acceptance Criteria

  • Creator below all tier thresholds pays the base protocol fee
  • Creator meeting a tier threshold pays the discounted fee for that tier
  • Creator meeting multiple thresholds pays the lowest applicable fee
  • Cumulative volume increases correctly on every buy and sell
  • Admin can update tiers; new rates apply on the next trade
  • More than 5 tiers reverts at update time

ETA: 24 hours


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 Campaign

    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