Repository navigation
fix(lending): market-state shows total_supplied as face, not raw lTAO - #13
Merged
Benup211 merged 1 commit intoSep 7, 2026
Merged
Conversation
MarketState.total_supplied is tracked in lToken (scaled) units, but market-state printed it verbatim so a supplier holding 997_191_042 lTAO at exchange rate 1.002816870... saw '0.9972' instead of their ~1.0 TAO claim. Render it scaled to face (total_supplied x exchange_rate / 1e18) with explicit unit labels, alongside a raw lTAO row. Adds the face_from_ltao helper and pins the real-chain value. Withdraw commands are unchanged.
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.
Context
tusdt lending market-stateprintedMarketState.total_suppliedverbatim. That field is tracked in lToken (scaled) units, so a supplier with 997_191_042 lTAO at exchange rate 1.002816870... saw997191042(≈0.9972 TAO) instead of their true ~1.0 TAO face claim.Changes
market-staterenders supply scaled to face (total_supplied × exchange_rate / 1e18) with explicit unit labels, alongside a raw lTAO row.face_from_ltaohelper inlending_interest.py+ unit tests pinning the real-chain value (face_from_ltao(997_191_042, 1_002_816_870_398_849_427) == 999_999_999).Verified: pytest 203 passed, ruff (check + format) and ty clean.