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 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 2 times, most recently from 4f13a58 to 0a4d55e Compare October 29, 2026 07:36
AkpakaProsper added a commit to AkpakaProsper/accesslayer-contracts that referenced this pull request Oct 29, 2026
AkpakaProsper added a commit to AkpakaProsper/accesslayer-contracts that referenced this pull request Oct 29, 2026
@AkpakaProsper
AkpakaProsper force-pushed the feat/issue-1038-build-fee-discount-contract-for-high-volume-r2 branch from 0a4d55e to 331aa08 Compare October 29, 2026 07:37
AkpakaProsper added a commit to AkpakaProsper/accesslayer-contracts that referenced this pull request Oct 29, 2026
@AkpakaProsper
AkpakaProsper force-pushed the feat/issue-1038-build-fee-discount-contract-for-high-volume-r2 branch from 331aa08 to bc39820 Compare October 29, 2026 07:59
AkpakaProsper added a commit to AkpakaProsper/accesslayer-contracts that referenced this pull request Oct 29, 2026
@AkpakaProsper
AkpakaProsper force-pushed the feat/issue-1038-build-fee-discount-contract-for-high-volume-r2 branch from bc39820 to 7cb1614 Compare October 29, 2026 09:18
@AkpakaProsper
AkpakaProsper force-pushed the feat/issue-1038-build-fee-discount-contract-for-high-volume-r2 branch from 7cb1614 to fb8140c Compare November 10, 2026 15:56
@drips-wave

drips-wave Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Possible malicious code: please review before merging.

An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch.

Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file.

@AkpakaProsper: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it.

Flagged files at commit fb8140c:

Only merge once you're confident these files are safe.

ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network.

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