Skip to content

Vault Strategy: describe the restart check on the price feed - #166

Merged
mikemaccana merged 1 commit into
mainfrom
claude/friendly-ride-g7mk1o
Sep 23, 2026
Merged

mikemaccana merged 1 commit into
mainfrom
claude/friendly-ride-g7mk1o

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

The companion's vault strategy refuses any Pyth price posted at or before the LastRestartSlot sysvar's slot, with PricePredatesRestart. After a halt the timestamp trails real time, so a price from before the halt can still pass the 60-second window. The Time chapter already lists the vault among the programs that make this check (#163), but the Vault Strategy chapter never mentioned it.

Changes

  • Valuing the fund. The list of prices the loader refuses now includes one posted before the cluster's last restart.
  • Failure modes. The feed bullet names PricePredatesRestart, says why the 60-second window alone does not catch a pre-halt price, and points to the Time chapter.
  • Testing. It names test_deposit_rejects_price_from_before_restart, which simulates a halt, checks that a deposit is refused, and checks that it goes through once Pyth posts again.

Both identifiers exist on the companion repository's main.

Checks

npm run lint, node scripts/check-figure-geometry.mjs and npm run build-pdf all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXqcBq93zfcZ2F8jeoSaez


Generated by Claude Code

The companion's vault strategy rejects any Pyth price posted at or before the
LastRestartSlot sysvar's slot, with PricePredatesRestart, because after a
halt the timestamp trails real time and a pre-halt price can still pass the
60-second window. The Time chapter already lists the vault among the programs
that make this check; the Vault Strategy chapter did not mention it. The
price-load paragraph, the failure modes and the testing section now do.

Claude-Session: https://claude.ai/code/session_01CXqcBq93zfcZ2F8jeoSaez
@mikemaccana
mikemaccana merged commit 60d258e into main Sep 23, 2026
1 check passed
@mikemaccana
mikemaccana deleted the claude/friendly-ride-g7mk1o branch October 13, 2026 00:23
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.

1 participant