Skip to content

Accrue interest and funding by the wall clock, and correct the halt section for Alpenglow - #163

Merged
mikemaccana merged 2 commits into
mainfrom
claude/friendly-ride-g7mk1o
Sep 23, 2026
Merged

mikemaccana merged 2 commits into
mainfrom
claude/friendly-ride-g7mk1o

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

Follows Dean Little's review of the Time chapter: interest and funding now accrue by the Clock's timestamp rather than by elapsed slots. Price freshness stays in slots.

Merge after quicknode/solana-program-examples#151. This PR names last_accrual_timestamp, last_funding_timestamp and funding_rate_per_second, which that PR adds. The companion AI plugin's rule changes in quicknode/solana-finance-claude-plugin#66.

Why

A rate quoted per year or per hour only became a rate per slot through a guess at the slot length. The companion's lending default assumed 400 ms slots and charged twice the quoted APR once the network moved to 200 ms. A leader can move the timestamp by a second or two. At a 20% annual rate that is about a hundred-millionth of the debt, so the argument that seconds at the liquidation line are worth money does not hold for accrual.

Changes

  • Time chapter. The accrual section now says interest and funding count seconds, and answers the leader-manipulation argument with numbers. The shorter-slot section now covers windows only, and a new War Story explains the SPL token-lending SLOTS_PER_YEAR constant, which truncated to 2 slots a second. The programs table and What You Learnt follow.
  • Decision tree figure. The fourth question now asks whether it is a rate or a deadline quoted to somebody in human time.
  • Halt section, corrected for Alpenglow. It said the first block after a restart carries a timestamp hours later, and that the vault's sixty-second window refuses the old price. Under Alpenglow the timestamp cannot jump: it trails real time and catches up. The section now says so, and lists the vault among the programs that check LastRestartSlot, as the companion's vault code already does.
  • Other chapters. Lending, Perpetual Futures, Arithmetic of Money and Operating Financial Software follow the change, as do the glossary, the funding-index and rate-curve figures, and the Amazon description.

Checks

npm run lint, node scripts/check-figure-geometry.mjs and npm run build-pdf all pass on the branch after merging main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXqcBq93zfcZ2F8jeoSaez


Generated by Claude Code

Mike MacCana added 2 commits September 22, 2026 23:29
…ection for Alpenglow

The lending market and the perpetual futures venue now accrue for the
seconds on the Clock's timestamp rather than for elapsed slots, following
the companion repository. A rate quoted per year or per hour only became a
rate per slot through a guess at the slot length, and the reduction to
200 ms slots doubled what a slot-counted rate charges. A leader can move
the timestamp by a second or two, which against an annual rate is about a
hundred-millionth of the debt, so the liquidation-line argument for slots
does not hold for accrual. Freshness stays in slots.

Time chapter: the accrual section, the shorter-slot section (with the SPL
token-lending constant as a War Story), the programs table, What You
Learnt, and the clock decision tree's fourth question, which now asks
about a rate or a deadline quoted in human time.

The halt section said the first block after a restart carries a timestamp
hours later and that the vault's sixty-second window refuses the old price.
Under Alpenglow the timestamp cannot jump: it trails real time and catches
up, which the companion's vault code already handles with a restart check.
Both statements now say so.

Lending, Perpetual Futures, Arithmetic of Money, Operating Financial
Software, the glossary, the funding-index and rate-curve figures, and the
Amazon description follow.

Claude-Session: https://claude.ai/code/session_01CXqcBq93zfcZ2F8jeoSaez
@mikemaccana
mikemaccana merged commit 380496f into main Sep 23, 2026
1 check passed
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