Bound the sponsored priority fee instead of the compute unit price - #4959
Merged
Merged
Conversation
squadgazzz
marked this pull request as ready for review
September 22, 2026 16:04
squadgazzz
force-pushed
the
solana-orderbook/cap-sponsored-priority-fee
branch
from
September 22, 2026 16:28
6e7830e to
d398507
Compare
tilacog
approved these changes
Sep 22, 2026
tilacog
reviewed
Sep 22, 2026
Comment on lines
137
to
141
| /// Roughly a thousandth of a cent at 200 dollars per SOL, and four orders of | ||
| /// magnitude above what wallets set today. | ||
| fn default_max_priority_fee_lamports() -> u64 { | ||
| 100_000 | ||
| } |
Contributor
There was a problem hiding this comment.
I think this might be off.
Contributor
There was a problem hiding this comment.
100,000 lamports = 0.0001 SOL = $0.02 at $200/SOL.
Contributor
Author
There was a problem hiding this comment.
Checked a real one on chain, https://explorer.solana.com/tx/S9LaNbET8j53nUB1FP3JJAHib8QK2p7KtrKYAVctaTTxXJVqXyGqAfxQfUTmcPrVaMj9XoyyxnvVsgvQrNnFRfn pays 113 lamports of priority fee (total 10113, base 10000 for two signatures).
So the default is around 1000x today's traffic, not what I wrote in the comment. Kept 100000 though, since wallets raise the price 10x to 100x under congestion, and I would rather overpay 2 cents than reject real placements on a bad day. Comment fixed.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
The funder pays the transaction fee on a sponsored order, and part of that fee is the priority fee the client chooses. So a placement decides how much of the funder's balance it spends, and
POST /api/v1/ordersis public.The priority fee is
compute unit price * compute unit limit. Today only the price is capped, which leaves the product free: a price comfortably under the cap, paired with the maximum limit, still costs the funder 0.0014 SOL per order. The number worth bounding is the fee itself, so that is what this bounds.It comes from config because congestion is not predictable from code and raising the ceiling should not need a release. The default of 100000 lamports is two cents at 200 dollars per SOL, and close to a thousand times what a real sponsored creation pays: the last one on chain paid 113 lamports of priority fee,
S9LaNbET8j53nUB1FP3JJAHi..., total fee 10113 against a 10000 base for two signatures.Changes
[sponsoring] max-priority-fee-lamports, default 100000, replaces the compute unit price capHow to test
New unit tests and an updated integration test. The integration case pairs a price below the old cap with a limit that breaks the new ceiling, so the current code accepts it and this one refuses it.