Skip to content

feat: add volume-based fee discount tiers for high-volume traders - #1202

Open
AkpakaProsper wants to merge 2 commits into
accesslayerorg:mainfrom
AkpakaProsper:feat/issue-1038-build-fee-discount-contract-for-high-volume-r2
Open

AkpakaProsper wants to merge 2 commits into
accesslayerorg:mainfrom
AkpakaProsper:feat/issue-1038-build-fee-discount-contract-for-high-volume-r2

Conversation

@AkpakaProsper

Copy link
Copy Markdown

Overview

This PR adds a volume-based fee discount system to the creator-keys bonding curve. It tracks each wallet's rolling 30-day trading volume, assigns a discount tier (bronze/silver/gold) at admin-configurable thresholds, exposes the current tier and discount in basis points via get_discount(wallet), and emits a VolumeDiscountTierChanged event whenever a wallet transitions between tiers.

Related Issue

Changes

📈 Volume Discount Tiers

  • [MODIFY] creator-keys/src/dynamic_fees.rs

    • Adds per-wallet 30-day rolling volume tracking with tier assignment.
    • Configurable bronze (5%), silver (10%), gold (20%) thresholds, admin-settable.
    • get_discount(wallet) returns the current tier and discount in bps.
    • Discount is applied when computing fees on bonding curve trades.
  • [MODIFY] creator-keys/src/events.rs

    • Adds the VolumeDiscountTierChanged event, emitted on tier transitions.

Verification Results

cargo test -p creator-keys
✅ dynamic_fees + events tests pass
Acceptance Criteria Status
30-day rolling volume computed correctly per wallet ✅ Rolling window tracked per wallet in dynamic_fees.rs
Discount tier assigned correctly at each threshold ✅ Bronze/silver/gold thresholds configurable by admin
get_discount returns correct tier and bps ✅ Returns tier + discount bps
Discount applied correctly in bonding curve fee computation ✅ Fee computation applies tier discount
VolumeDiscountTierChanged event emitted on tier change ✅ Event added in events.rs and emitted on transition

Closes #1038

AkpakaProsper added a commit to AkpakaProsper/accesslayer-contracts that referenced this pull request Oct 24, 2026
AkpakaProsper added a commit to AkpakaProsper/accesslayer-contracts that referenced this pull request Oct 24, 2026
@AkpakaProsper
AkpakaProsper force-pushed the feat/issue-1038-build-fee-discount-contract-for-high-volume-r2 branch from 7e2d5ec to 120ed2c Compare October 24, 2026 10:12
@AkpakaProsper
AkpakaProsper force-pushed the feat/issue-1038-build-fee-discount-contract-for-high-volume-r2 branch from 120ed2c to 4f13a58 Compare October 24, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build fee discount contract for high-volume trader tier rewards

1 participant