Skip to content

Support flexible pricing schemes via pricing trait #72

Description

@hpmaxi

Priority

High — must be addressed in current sprint

User story / Problem statement

Currently, fulfill_epoch couples epoch settlement to nav_per_share() read from the oracle feed client, assuming a single direct unit share price model. However, different RWA vaults adopt different pricing calculations: some receive direct unit share price attestations from off-chain fund accounting, while others attest total off-chain deployed value and require deriving net assets from on-chain balances and liabilities. Hardcoding a single calculation into the vault core restricts adopters and ties the state machine to a specific fund accounting approach.

Expected outcome

Extract pricing calculation into a flexible abstraction or trait (e.g., leveraging or reviving a dedicated pricing module/trait), enabling vaults to support both direct unit NAV attestation and derived net-asset formulas without modifying core epoch settlement logic.

Acceptance criteria

  • Define a clear pricing trait/interface for epoch share price resolution.
  • Support direct unit NAV attestation (off-chain unit share price) as the standard default scheme.
  • Support or specify derived net-asset NAV calculation (attested_assets + balance - liabilities) / supply via the abstraction.
  • The async-vault epoch lifecycle interacts only through the pricing abstraction.
  • Conversions round in the vault's favour across all supported schemes.
  • Invariant tests verify price preservation and precision boundaries.

Technical notes

Re-evaluates the role of the pricing crate or introduces a pricing trait. This separates valuation methodology from the async epoch state machine.

Refs: ARCHITECTURE §4.2 · invariants: I16, I17

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestepic:contractsRust: port the reference and close the code deltas

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions