Skip to content

feat(compounding): gas-aware compounding economics module + tests - #9

Open
StSora wants to merge 1 commit into
intuition-box:mainfrom
StSora:feat/gas-aware-compounding
Open

feat(compounding): gas-aware compounding economics module + tests#9
StSora wants to merge 1 commit into
intuition-box:mainfrom
StSora:feat/gas-aware-compounding

Conversation

@StSora

@StSora StSora commented Jul 25, 2026

Copy link
Copy Markdown

Phase 1 of the auto-compounding strategy: the pure economics core, shared by the agent's compound gate and the app's projection card.

  • src/lib/compounding.ts: profitability gate (compound when accrued >= M * (gas + fee)), break-even interval T*, next-compound estimate, net-reinvested (cost + performance fee deducted), and simple vs compounded projections plus a sampled curve for the UI.
  • test/unit/compounding.test.ts: bun:test suite covering the two signed-off examples.

Cadence falls out of the numbers, never hardcoded: a 10K position (~$0.20/day, $0.15 gas) compounds ~weekly (T* ~7.5d, 45x/yr); a 10M position ($2,000/day) compounds daily (365x/yr, ~7.57% effective APY vs 7.30% nominal). Verified with 15/15 logic checks.

Fits the agent constraints: read (accrued yield + live gas) -> trigger a pre-signed bounded compound. No delegation authoring, no custody.

Phase 1 of the auto-compounding strategy: the pure economics core, shared by
the agent's compound gate and the app's projection card.

- src/lib/compounding.ts: profitability gate (compound when accrued >=
  M * (gas + fee)), break-even interval T*, next-compound estimate,
  net-reinvested (cost + performance fee deducted), and simple vs compounded
  projections plus a sampled curve for the UI.
- test/unit/compounding.test.ts: bun:test suite covering the two signed-off
  examples.

Cadence falls out of the numbers, never hardcoded: a 10K position
(~$0.20/day, $0.15 gas) compounds ~weekly (T* ~7.5d, ~45x/yr); a 10M
position (~$2,000/day) compounds daily (365x/yr, ~7.57% effective APY vs
7.30% nominal). Verified with 15/15 logic checks.

Fits the agent constraints: read (accrued yield + live gas) -> trigger a
pre-signed bounded compound. No delegation authoring, no custody.
@host-intuition-box

host-intuition-box Bot commented Jul 25, 2026

Copy link
Copy Markdown

The preview deployment for Hourglass is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-07-25 13:25:54 CET

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