feat: support flexible pricing via pricing trait - #153
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hpmaxi
added this pull request to stack #158
September 23, 2026 20:20
luchobonatti
requested changes
Sep 24, 2026
Member
There was a problem hiding this comment.
DirectUnitPricing matches today's behaviour and everything is green (212 tests, clippy, fmt, wasm). My doubt is the derived scheme: §8.1 says NAV is attested, not derived, and nothing wires it yet. Thoughts inline. Would you also fill in the PR template?
Contributor
Author
|
Template filled in. |
luchobonatti
approved these changes
Sep 25, 2026
luchobonatti
left a comment
Member
There was a problem hiding this comment.
Derived scheme dropped, one Pricing alias, §8.1 stands. 207 tests, clippy and fmt clean on c660900. Branch is behind main; a rebase before merge.
hpmaxi
force-pushed
the
feat/72-pricing-trait
branch
from
September 25, 2026 15:04
c660900 to
eacb1ae
Compare
Extract epoch share price resolution and conversion arithmetic into the PricingScheme trait. Provide DirectUnitPricing (default off-chain NAV) and DerivedNetAssetPricing ((attested + balance - liabilities) / supply). Conversions round in the vault's favour. Closes #72
The design attests the share price itself; the derived scheme was unused and read a per-share price as total assets.
hpmaxi
force-pushed
the
feat/72-pricing-trait
branch
from
September 25, 2026 15:17
eacb1ae to
1231c14
Compare
This branch was successfully deployed
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.
Summary
Closes #72
Epoch pricing read
nav_per_share()directly in the settlement code. A pricing trait puts share-price resolution and the two conversions behind one interface, so a vault variant can change the scheme without touching the epoch state machine.Changes
Deviations
Acceptance criteria
(attested_assets + balance - liabilities) / supplyvia the abstraction. (Not implemented; see Deviations.)async-vaultepoch lifecycle interacts only through the pricing abstraction.Test plan
Automated tests
nix develop -c cargo test -p async-vault— 207 passed.nix develop -c cargo clippy -p async-vault --all-targets -- -D warnings— clean.Manual verification
None.
Breaking changes
None.
Checklist
Screenshots
None.