feat(frontend): show protocol LP positions as treasury assets with USD and include in CR #33

Merged
PlasticDigits merged 1 commit from 14-feat-frontend-show-protocol-lp-positions-as-treasury-assets-with-usd-and-include-in-cr into master 2026-08-15 12:53:50 +00:00
PlasticDigits commented 2026-08-15 12:49:56 +00:00 (Migrated from gitlab.com)

Summary

  • Allowlisted tokenlist.json type: "lp" shares (UST1/USTR/cUSTC/cLUNC pairs) appear as treasury assets with reserve NAV USD, not LP-mint simulate_swap.
  • CR numerator uses crUsd only: UST1 legs at $1, USTR/other legs at market, pinned wrap legs haircut so native LUNC/USTC is not double-counted.
  • Unlisted factory pairs never enter CR. Unknown dex, over-share, or unpriced CR-eligible legs fail closed (incomplete).

Closes #14.

Test plan

  • cd frontend && npm test (49 tests; includes UST1/USTR $200, UST1/cUSTC $101/$100, CR 210% fixture)
  • npm run type-check && npm run lint
  • Treasury page: existing USTC/LUNC/ALPHA/vFDUSD rows unchanged; no raw UST1/USTR/cLUNC/cUSTC in the asset grid
  • After ops pin a live type: "lp" + treasury balance > 0: row shows pair label, full NAV, finder on the pair; wrap haircut footnote if applicable
  • CR = (spotAssetsUsd + Σ crUsd) / whole UST1 × 100; unpriced LP marks incomplete, not $0
  • Grep: getTokenPriceUsd is not called with an LP mint; skip-list still exact USTR|UST1|CLUNC|CUSTC

Closes #14

## Summary - Allowlisted `tokenlist.json` `type: "lp"` shares (UST1/USTR/cUSTC/cLUNC pairs) appear as treasury assets with **reserve NAV** USD, not LP-mint `simulate_swap`. - CR numerator uses `crUsd` only: UST1 legs at $1, USTR/other legs at market, **pinned wrap legs haircut** so native LUNC/USTC is not double-counted. - Unlisted factory pairs never enter CR. Unknown dex, over-share, or unpriced CR-eligible legs fail closed (`incomplete`). Closes #14. ## Test plan - [ ] `cd frontend && npm test` (49 tests; includes UST1/USTR $200, UST1/cUSTC $101/$100, CR 210% fixture) - [ ] `npm run type-check && npm run lint` - [ ] Treasury page: existing USTC/LUNC/ALPHA/vFDUSD rows unchanged; no raw UST1/USTR/cLUNC/cUSTC in the asset grid - [ ] After ops pin a live `type: "lp"` + treasury balance > 0: row shows pair label, full NAV, finder on the pair; wrap haircut footnote if applicable - [ ] CR = `(spotAssetsUsd + Σ crUsd) / whole UST1 × 100`; unpriced LP marks incomplete, not $0 - [ ] Grep: `getTokenPriceUsd` is not called with an LP mint; skip-list still exact `USTR|UST1|CLUNC|CUSTC` Closes #14
PlasticDigits commented 2026-08-15 12:50:14 +00:00 (Migrated from gitlab.com)

added 1 commit

  • c38ae700 - feat(frontend): count allowlisted protocol LP shares in treasury CR

Compare with previous version

added 1 commit <ul><li>c38ae700 - feat(frontend): count allowlisted protocol LP shares in treasury CR</li></ul> [Compare with previous version](/PlasticDigits2/ustr-cmm/-/merge_requests/11/diffs?diff_id=1963831589&start_sha=e7a26f2ba24974818494d2f2e469d44a3ba54a3a)
PlasticDigits commented 2026-08-15 12:50:14 +00:00 (Migrated from gitlab.com)

marked this merge request as ready

marked this merge request as **ready**
PlasticDigits commented 2026-08-15 12:50:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #14

mentioned in issue #14
PlasticDigits commented 2026-08-15 12:53:50 +00:00 (Migrated from gitlab.com)

mentioned in commit 4482924766

mentioned in commit 44829247668e6f46cf94b0dd182c5bb264c4e7ea
PlasticDigits (Migrated from gitlab.com) merged commit 4482924766 into master 2026-08-15 12:53:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/ustr-cmm!33
No description provided.