-
Notifications
You must be signed in to change notification settings - Fork 11
feat(fees): pay underwriters and reserve owners out of the swap fee #546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
heifner
wants to merge
13
commits into
master
Choose a base branch
from
feat/swap-fee-distribution
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f982725
feat(fees): pay underwriters and reserve owners out of the swap fee
heifner 04a8e5d
fix(amm): sum the stacked fee total in u128 so it cannot wrap
heifner 6fbed1d
test(reserv): assert the DECODED swapquote, and document counter satu…
heifner 296c1ab
docs(fees): qualify revert-fee routing and correct the payepoch overview
heifner 9665f78
docs(fees): finish the drainrewards copies and drop the obsolete 7/8 …
heifner cb31b67
docs(fees): correct the fee-model docs; pin zero-net reachability wit…
heifner 9b8bddf
test(fees): cover the positive batch-fee payout; scope the payout claims
heifner 73da2da
fix(bootstrap): bound V4 precision to the depot frame; correct the re…
heifner 8638612
fix(emissions): normalize payouts by the accrued epoch count, not the…
heifner baaace5
docs: finish removing the configured-cadence invariant; correct uwreq…
heifner 504cc7f
docs: accrueepoch runs on pay epochs too; chklocks is not the settlem…
heifner c55cc14
docs: fix the missing relative pronoun in the accrueepoch invariant
heifner 25092af
docs(fees): scope the implementation comments to what each site actua…
heifner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Low] Qualify conservation to the non-clamped path. This states unconditionally that the five share fields sum to
fee, but the paragraph below correctly says they can sum to more thanfeeaftertotal_feeis clamped towire_amount. Please state that five-share conservation holds only whentotal_fee < wire_amount;net + fee == wire_amountremains unconditional.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct — fixed in
25092af3b4. The sentence contradicted the clamp paragraph directly below it, which is the worse form of the error: a reader who trusts the first statement has no reason to read on, and the clamp is precisely the case where the five shares stop summing tofee.Split into the conditional and unconditional halves:
net + fee == wire_amountis called out as unconditional exactly as you say, since it holds on both paths — the clamp setsfee = wire_amount, net = 0, which satisfies it.Comment only. See my note on the other three in this batch regarding test verification.