Repository navigation
Feature/contract dynamic fees - #804
Merged
Abdulazeem-code merged 13 commits intoOct 3, 2026
Merged
Abdulazeem-code merged 13 commits into
Abdulazeem-code merged 13 commits into
Conversation
|
@Tekprecious 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! 🚀 |
|
@Tekprecious is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
Resolve conflicts and fix failed checks |
…st overflow panics
Owner
|
Resolve conflicts |
Owner
|
Resolve conflicts and fix failed checks |
- Fix cargo fmt issues in payment_proxy and payment_router - Exclude payment_router/fuzz from cargo workspace to fix build errors - Add SOROSWAP and COOLDOWN to cspell dictionary
…mic-fees # Conflicts: # .cspell.json # payment_router/src/lib.rs # stellar-payment-platform/src/middleware/signatureRateLimit.js
Owner
|
Please Resolve conflicts |
Contributor
Author
@Abdulazeem-code conflicts resolved |
Owner
|
Kindly fix failed checks |
Owner
|
Please resolve conflicts |
Owner
|
Conflicts is not resolved yet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #670
Smart Contracts: Implement Dynamic Fees Based on Network Congestion
Description
The platform currently charges a static fee, which can be unprofitable during periods of high network congestion on the Stellar network. This PR introduces a dynamic fee model that scales the platform fee based on the current ledger's base fee, protecting the protocol's profitability during network spikes while keeping fees reasonable for users.
Changes Made
process_single_paymentinpayment_router/src/lib.rsto calculate a dynamic multiplier based on the current network base fee (env.ledger().base_fee() / 100 stroops). The configuredfee_bpsis multiplied by this dynamic factor.MAX_FEE_MULTIPLIERconstant set to10. The fee multiplier is strictly capped at 10x the normal rate to protect users from exorbitant fees during extreme network congestion events. The absolutefee_capcontinues to enforce an overarching maximum fee limit.get_effective_fee_bpsendpoint with identical multiplier logic, ensuring accurate preflight fee estimations for clients interacting with the contract.Acceptance Criteria
get_effective_fee_bps) are updated to reflect the dynamic fee.How to Test
payment_routercontract on a local network or testnet.get_effective_fee_bpsduring normal conditions (base fee = 100 stroops) to confirm the baseline fee is returned.