Skip to content

fix(lending): market-state shows total_supplied as face, not raw lTAO - #13

Merged
Benup211 merged 1 commit into
feat/alpha-vault-and-otcfrom
fix/lending-market-state-face-units
Sep 7, 2026
Merged

Benup211 merged 1 commit into
feat/alpha-vault-and-otcfrom
fix/lending-market-state-face-units

Conversation

@Benup211

@Benup211 Benup211 commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Context

tusdt lending market-state printed MarketState.total_supplied verbatim. That field is tracked in lToken (scaled) units, so a supplier with 997_191_042 lTAO at exchange rate 1.002816870... saw 997191042 (≈ 0.9972 TAO) instead of their true ~1.0 TAO face claim.

Changes

  • market-state renders supply scaled to face (total_supplied × exchange_rate / 1e18) with explicit unit labels, alongside a raw lTAO row.
  • face_from_ltao helper in lending_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).
  • Withdraw command behavior is unchanged.

Verified: pytest 203 passed, ruff (check + format) and ty clean.

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.
@Benup211
Benup211 merged commit 9d3f324 into feat/alpha-vault-and-otc Sep 7, 2026
2 checks passed
@Benup211
Benup211 deleted the fix/lending-market-state-face-units branch September 7, 2026 04:29
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