Skip to content

Separate pricing from payment #73

Description

@hpmaxi

Priority

High — must be addressed in current sprint

User story / Problem statement

fulfill_epoch refuses unless the vault covers the epoch's redemptions in full, so one large
redeemer blocks every small one in the same epoch, and an epoch stays unpriced until enough capital
has come back. The design pays claims as cash arrives, in order, without walking a queue.

Expected outcome

An epoch prices whether or not the cash is there. Claims pay in order of cumulative position as the
reserve covers them.

Acceptance criteria

  • Fulfilment fixes the price and records the liability without requiring full coverage.
  • A claim pays when the reserve covers that claim's own amount, and is refused otherwise with an
    error that says so.
  • Claims are not ordered. A covered claim pays whatever else is outstanding, in any epoch, and a
    test asserts a small covered claim pays while a larger one waits.
  • Paying a covered claim may leave a larger one waiting, and that is accepted. No claim is ever
    paid money the vault does not hold.
  • The uncovered amount is exposed as a view, and nothing may leave for the custodian while it is
    above zero. A test asserts both.
  • No entrypoint iterates over requests or epochs.

Technical notes

There is no queue. The architecture says an earlier unpaid claim never blocks a later one that is
already covered, so a claim is measured against its own amount and nothing else. The only running
total needed is committed, the priced and unclaimed liability, and the uncovered amount derives from
it.

Reserves are protected at the outbound edge rather than the claim edge: free reserve clamps at zero,
so the treasury cannot deploy money already owed to a holder.

The test that matters is an epoch that prices more than the vault holds: the small claim is paid, the
large one is refused with a reason, and no transfer is attempted against money that is not there.

Depends on #72, which is what makes committed liabilities legible.

Refs: ARCHITECTURE §4.3 · invariants: I11, I12, I13

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions