Goal
Expose current, clock-projected stablecoin global values through
stablecoin_module, using the projection helpers merged in #311.
Scope
- Add a pure
stablecoin_ffi projection operation backed directly by
compute_current_accumulated_rate and
compute_current_redemption_price.
- Add
currentGlobalState() to StablecoinModuleImpl.
- Read and validate
ProtocolParameters, StabilityFeeAccumulator,
RedemptionPriceState, and the canonical CLOCK_01 account through
logos_execution_zone.
- Use the clock account's Unix-millisecond timestamp. Do not accept a
caller-supplied wall clock for the live operation.
- Return raw anchors and timestamps together with
currentAccumulatedRate,
currentRedemptionPrice, and projectedAt, all as exact decimal strings.
- Preserve the on-chain semantics: saturating timestamp subtraction and the
MAXIMUM_COMPOUNDING_WINDOW_MILLISECONDS seven-day clamp.
- Surface invalid global ownership/PDA/data and invalid clock reads through
stable error codes.
Acceptance criteria
- Projection output matches the Rust helpers byte-for-byte for identity,
growth, decay, zero elapsed time, inverted timestamps, exactly-at-clamp, and
beyond-clamp cases.
- The live module method reads each required singleton and the canonical clock;
it never projects from process wall time.
- Maximum fixed-point values supported by the helpers remain exact across the
API boundary; JSON floats are rejected.
- Tests prove
now < last_updated_at and now < last_accrued_at collapse to
the stored anchors without underflow.
nix build .#stablecoin-module and relevant Rust/module tests pass.
Dependencies
Depends on the scaffold, raw accumulator-state, and raw
redemption-price-state sub-issues under #321.
Goal
Expose current, clock-projected stablecoin global values through
stablecoin_module, using the projection helpers merged in #311.Scope
stablecoin_ffiprojection operation backed directly bycompute_current_accumulated_rateandcompute_current_redemption_price.currentGlobalState()toStablecoinModuleImpl.ProtocolParameters,StabilityFeeAccumulator,RedemptionPriceState, and the canonicalCLOCK_01account throughlogos_execution_zone.caller-supplied wall clock for the live operation.
currentAccumulatedRate,currentRedemptionPrice, andprojectedAt, all as exact decimal strings.MAXIMUM_COMPOUNDING_WINDOW_MILLISECONDSseven-day clamp.stable error codes.
Acceptance criteria
growth, decay, zero elapsed time, inverted timestamps, exactly-at-clamp, and
beyond-clamp cases.
it never projects from process wall time.
API boundary; JSON floats are rejected.
now < last_updated_atandnow < last_accrued_atcollapse tothe stored anchors without underflow.
nix build .#stablecoin-moduleand relevant Rust/module tests pass.Dependencies
Depends on the scaffold, raw accumulator-state, and raw
redemption-price-state sub-issues under #321.