Repository navigation
Accrue interest and funding by the wall clock, and correct the halt section for Alpenglow - #163
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_timestampandfunding_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
SLOTS_PER_YEARconstant, which truncated to 2 slots a second. The programs table and What You Learnt follow.LastRestartSlot, as the companion's vault code already does.Checks
npm run lint,node scripts/check-figure-geometry.mjsandnpm run build-pdfall pass on the branch after merging main.🤖 Generated with Claude Code
https://claude.ai/code/session_01CXqcBq93zfcZ2F8jeoSaez
Generated by Claude Code