Skip to content

feat: nav oracle contracts and guards - #69

Merged
hpmaxi merged 3 commits into
mainfrom
feat/nav-oracle
Sep 7, 2026
Merged

feat: nav oracle contracts and guards#69
hpmaxi merged 3 commits into
mainfrom
feat/nav-oracle

Conversation

@hpmaxi

@hpmaxi hpmaxi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #64

@hpmaxi
hpmaxi requested a review from luchobonatti September 3, 2026 20:18
@hpmaxi hpmaxi self-assigned this Sep 3, 2026
The suite asserted a monotonic-date guard attest never implemented, so the
workspace tests were red. Assert the cooldown and deviation guards it does
enforce, and pin the contract-stamped timestamp so changing it is deliberate.

@luchobonatti luchobonatti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Clean port, CI green.

One bug: is_stale() never checks the ripcord. A fresh record with the ripcord raised gives state() == Paused but is_stale() == false, and the name reads like a health check. Fold the ripcord in, or rename it is_expired. Worth fixing before #65 consumes this.

panic_with_error!(e, OracleError::CooldownActive);
}
// Per-share symmetric deviation cap against the previous strike.
let diff = (report.nav_per_share - prev.nav_per_share).abs();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cap uses abs(diff), so it also caps losses. A real 15% drop with a 2% cap takes eight attestations to land, and redemptions pay the inflated price the whole way. Cap the upside only.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port the NAV oracle

2 participants