Skip to content

feat: implement dynamic fee tiers based on pool volume#470

Merged
Yunusabdul38 merged 1 commit intoWeb3Novalabs:mainfrom
EDOHWARES:feature/dynamic-fee-tiers
Mar 27, 2026
Merged

feat: implement dynamic fee tiers based on pool volume#470
Yunusabdul38 merged 1 commit intoWeb3Novalabs:mainfrom
EDOHWARES:feature/dynamic-fee-tiers

Conversation

@EDOHWARES
Copy link
Copy Markdown
Contributor

Dynamic Fee Tiers Based on Volume

Branch: feature/dynamic-fee-tiers
Issue Reference: #317

Description

This PR implements a dynamic protocol fee system where the fee percentage applied to a pool is determined by its total volume (total stake) at the point of resolution. This incentivizes higher participation by offering lower fee tiers for high-volume markets.

Key Changes

  • Data Models:
    • Added FeeTier struct to define stake_threshold and fee_bps.
    • Updated Pool struct to store the resulting fee_bps determined at resolution time.
    • Added DataKey::FeeTiers for persistent configuration storage.
  • Dynamic Resolution Logic:
    • Updated resolve_pool, resolve_pool_from_price, and oracle_resolve to calculate and store the applicable fee tier.
    • Added internal helper calculate_dynamic_fee to find the highest threshold tier satisfied by the pool volume.
  • Admin Functions:
    • set_fee_tiers: Allows governance to update the fee schedule.
    • get_fee_tiers: Public view function to check active tiers.

Closes #317

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@EDOHWARES Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

@EDOHWARES is attempting to deploy a commit to the shola's projects Team on Vercel.

A member of the Team first needs to authorize it.

@EDOHWARES
Copy link
Copy Markdown
Contributor Author

@Yunusabdul38 , pls review

@Yunusabdul38 Yunusabdul38 merged commit 6f2fd9f into Web3Novalabs:main Mar 27, 2026
1 of 2 checks passed
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.

Support Dynamic Fee Tiers Based on Volume

2 participants