Skip to content

Add Target HF leverage solver#139

Open
Sikkra wants to merge 1 commit into
Dgetsylver:mainfrom
Sikkra:bounty-5-target-hf
Open

Add Target HF leverage solver#139
Sikkra wants to merge 1 commit into
Dgetsylver:mainfrom
Sikkra:bounty-5-target-hf

Conversation

@Sikkra
Copy link
Copy Markdown

@Sikkra Sikkra commented May 19, 2026

Closes #5

Summary

  • Adds a Target HF numeric input beside the leverage controls.
  • Solves leverage from the target health factor and updates slider, leverage input, supplied/borrowed totals, and HF preview together.
  • Rejects target HF values below 1 / c_factor with an inline error and preserves the previous slider value.
  • Keeps slider-driven updates bidirectional by syncing the Target HF field from the current leverage/HF preview.

Verification

  • npm run build (passes; existing Vite chunk-size warning remains)
  • git diff --check
  • npx tsc --noEmit (still fails on existing repo type/config issues: .ts import extension settings, AuthModalParams.network, and the main-branch demo reserve mock missing ReserveStats fields)
  • Local Edge/Playwright fallback on http://127.0.0.1:5204/: HF 1.8 solved leverage to 1.8x, preview HF rendered 1.8000, supplied/borrowed rendered 1,800.00 / 800.00; invalid HF 1.2 showed the 1.2500 floor error without changing slider; slider 2.0x updated Target HF and preview to 1.6000; browser errors 0.

Note: the Codex in-app browser pane was unavailable in this session, so I used the local Edge/Playwright fallback for UI verification.

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.

A3: "Target HF" input that auto-solves leverage

1 participant